зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1335368 part 4. Stop using IsCallerChrome in nsContentUtils::IsRequestFullScreenAllowed. r=bholley
This commit is contained in:
Родитель
80365681f6
Коммит
4dafb92c93
|
@ -3315,9 +3315,9 @@ Element::AttrValueToCORSMode(const nsAttrValue* aValue)
|
|||
}
|
||||
|
||||
static const char*
|
||||
GetFullScreenError(nsIDocument* aDoc)
|
||||
GetFullScreenError(CallerType aCallerType)
|
||||
{
|
||||
if (!nsContentUtils::IsRequestFullScreenAllowed()) {
|
||||
if (!nsContentUtils::IsRequestFullScreenAllowed(aCallerType)) {
|
||||
return "FullscreenDeniedNotInputDriven";
|
||||
}
|
||||
|
||||
|
@ -3334,7 +3334,7 @@ Element::RequestFullscreen(CallerType aCallerType, ErrorResult& aError)
|
|||
// spoof the browser chrome/window and phish logins etc.
|
||||
// Note that requests for fullscreen inside a web app's origin are exempt
|
||||
// from this restriction.
|
||||
if (const char* error = GetFullScreenError(OwnerDoc())) {
|
||||
if (const char* error = GetFullScreenError(aCallerType)) {
|
||||
OwnerDoc()->DispatchFullscreenError(error);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6831,11 +6831,11 @@ nsContentUtils::IsFullScreenApiEnabled()
|
|||
|
||||
/* static */
|
||||
bool
|
||||
nsContentUtils::IsRequestFullScreenAllowed()
|
||||
nsContentUtils::IsRequestFullScreenAllowed(CallerType aCallerType)
|
||||
{
|
||||
return !sTrustedFullScreenOnly ||
|
||||
EventStateManager::IsHandlingUserInput() ||
|
||||
IsCallerChrome();
|
||||
aCallerType == CallerType::System;
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -2000,7 +2000,7 @@ public:
|
|||
* a mouse-click or key press), unless this check has been disabled by
|
||||
* setting the pref "full-screen-api.allow-trusted-requests-only" to false.
|
||||
*/
|
||||
static bool IsRequestFullScreenAllowed();
|
||||
static bool IsRequestFullScreenAllowed(mozilla::dom::CallerType aCallerType);
|
||||
|
||||
/**
|
||||
* Returns true if calling execCommand with 'cut' or 'copy' arguments
|
||||
|
|
Загрузка…
Ссылка в новой задаче