Bug 1417494 - Take iframe sandboxing into account for <noscript> parsing. r=bz

MozReview-Commit-ID: GTUCSQq5aDm
This commit is contained in:
Henri Sivonen
2017-11-16 11:49:50 +02:00
parent f0664f5364
commit d045cdff6b
5 changed files with 53 additions and 8 deletions

View File

@@ -649,16 +649,11 @@ nsHtml5TreeOpExecutor::IsScriptEnabled()
// Note that if we have no document or no docshell or no global or whatnot we
// want to claim script _is_ enabled, so we don't parse the contents of
// <noscript> tags!
if (!mDocument || !mDocShell)
if (!mDocument || !mDocShell) {
return true;
nsCOMPtr<nsIScriptGlobalObject> globalObject = do_QueryInterface(mDocument->GetInnerWindow());
// Getting context is tricky if the document hasn't had its
// GlobalObject set yet
if (!globalObject) {
globalObject = mDocShell->GetScriptGlobalObject();
}
NS_ENSURE_TRUE(globalObject && globalObject->GetGlobalJSObject(), true);
return xpc::Scriptability::Get(globalObject->GetGlobalJSObject()).Allowed();
return mDocument->IsScriptEnabled();
}
void