Bug 691947 - Relax DOM full-screen API security constraints for requests coming from chrome. r=roc

This commit is contained in:
Chris Pearce 2011-11-03 19:37:38 +13:00
parent 702c5e844c
commit 29e76a123f
2 changed files with 11 additions and 1 deletions

View File

@ -5813,7 +5813,9 @@ nsContentUtils::IsFullScreenApiEnabled()
bool nsContentUtils::IsRequestFullScreenAllowed()
{
return !sTrustedFullScreenOnly || nsEventStateManager::IsHandlingUserInput();
return !sTrustedFullScreenOnly ||
nsEventStateManager::IsHandlingUserInput() ||
IsCallerChrome();
}
bool

View File

@ -8607,6 +8607,14 @@ nsDocument::GetMozFullScreenEnabled(bool *aFullScreen)
NS_ENSURE_ARG_POINTER(aFullScreen);
*aFullScreen = false;
if (nsContentUtils::IsCallerChrome() &&
nsContentUtils::IsFullScreenApiEnabled()) {
// Chrome code can always use the full-screen API, provided it's not
// explicitly disabled.
*aFullScreen = true;
return NS_OK;
}
if (!nsContentUtils::IsFullScreenApiEnabled() ||
nsContentUtils::HasPluginWithUncontrolledEventDispatch(this) ||
!IsVisible()) {