Bug 1283526 part 1 - Revert behavior of allowfullscreen attribute for non-sandboxed iframe. r=smaug

MozReview-Commit-ID: BayA4tQBsfC
This commit is contained in:
Xidorn Quan
2016-07-04 10:19:35 +10:00
parent 4286bfd2f8
commit 26868bd866
7 changed files with 14 additions and 98 deletions

View File

@@ -2556,10 +2556,6 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed)
// neither iframe nor embed
return NS_OK;
}
nsIDocument* doc = frameElement->GetUncomposedDoc();
if (!doc || !doc->FullscreenEnabledInternal()) {
return NS_OK;
}
}
// If we have no parent then we're the root docshell; no ancestor of the
@@ -3837,13 +3833,6 @@ nsDocShell::IsSandboxedFrom(nsIDocShell* aTargetDocShell)
return true;
}
void
nsDocShell::ApplySandboxAndFullscreenFlags(nsIDocument* aDoc)
{
aDoc->SetSandboxFlags(mSandboxFlags);
aDoc->SetFullscreenEnabled(GetFullscreenAllowed());
}
NS_IMETHODIMP
nsDocShell::GetTreeOwner(nsIDocShellTreeOwner** aTreeOwner)
{
@@ -8062,9 +8051,9 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
blankDoc->SetContainer(this);
// Apply the sandbox and fullscreen enabled flags to the document.
// These are immutable after being set here.
ApplySandboxAndFullscreenFlags(blankDoc);
// Copy our sandbox flags to the document. These are immutable
// after being set here.
blankDoc->SetSandboxFlags(mSandboxFlags);
// create a content viewer for us and the new document
docFactory->CreateInstanceForDocument(