Issue #3020 - Update currentScript when dealing with shadow DOM.

`currentScript` should be null when evaluating scripts from shadow DOM.
This commit is contained in:
Moonchild
2026-03-24 15:53:04 +01:00
committed by roytam1
parent 94ffd74cab
commit eee99b32cc
+3 -1
View File
@@ -324,7 +324,9 @@ class ScriptLoader final : public nsISupports
: mOldScript(aScriptLoader->mCurrentScript)
, mScriptLoader(aScriptLoader)
{
mScriptLoader->mCurrentScript = aCurrentScript;
nsCOMPtr<nsINode> node = do_QueryInterface(aCurrentScript);
mScriptLoader->mCurrentScript =
node && !node->IsInShadowTree() ? aCurrentScript : nullptr;
}
~AutoCurrentScriptUpdater()
{