mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 14:54:25 +00:00
Issue #3020 - Update currentScript when dealing with shadow DOM.
`currentScript` should be null when evaluating scripts from shadow DOM.
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user