Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
This commit is contained in:
@@ -6572,8 +6572,6 @@ nsresult nsDocShell::CreateAboutBlankDocumentViewer(
|
||||
// after being set here.
|
||||
blankDoc->SetSandboxFlags(sandboxFlags);
|
||||
|
||||
blankDoc->InitFeaturePolicy();
|
||||
|
||||
// create a content viewer for us and the new document
|
||||
docFactory->CreateInstanceForDocument(
|
||||
NS_ISUPPORTS_CAST(nsIDocShell*, this), blankDoc, "view",
|
||||
@@ -6591,6 +6589,12 @@ nsresult nsDocShell::CreateAboutBlankDocumentViewer(
|
||||
/* aLocationFlags */ 0);
|
||||
rv = mIsBeingDestroyed ? NS_ERROR_NOT_AVAILABLE : NS_OK;
|
||||
}
|
||||
|
||||
if (Element* embedderElement = blankDoc->GetEmbedderElement()) {
|
||||
blankDoc->InitFeaturePolicy(AsVariant(embedderElement));
|
||||
} else {
|
||||
blankDoc->InitFeaturePolicy(AsVariant(Nothing{}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user