mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 23:18:26 +00:00
Issue #1691 - Part 9: Make import() work when the active script is in another document. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Associate event handler with active script when they are compiled.
(cherry picked from commit 1a3cc5d6828a05a6309d959fad3c7e959ab9eb8d)
This commit is contained in:
@@ -2259,9 +2259,11 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> scriptContent(do_QueryInterface(aRequest->Element()));
|
||||
MOZ_ASSERT_IF(!scriptContent, aRequest->AsModuleRequest()->IsDynamicImport());
|
||||
if (scriptContent) {
|
||||
bool isDynamicImport = aRequest->IsModuleRequest() &&
|
||||
aRequest->AsModuleRequest()->IsDynamicImport();
|
||||
if (!isDynamicImport) {
|
||||
nsCOMPtr<nsIContent> scriptContent(do_QueryInterface(aRequest->Element()));
|
||||
MOZ_ASSERT(scriptContent);
|
||||
nsIDocument* ownerDoc = scriptContent->OwnerDoc();
|
||||
if (ownerDoc != mDocument) {
|
||||
// Willful violation of HTML5 as of 2010-12-01
|
||||
|
||||
Reference in New Issue
Block a user