Bug 1643798 - Fix feature policy check for fullscreen so that it gets reflected properly in document.fullscreenEnabled. r=baku

See bug 1606660 comment 8 as to why checking it only in
Element.requestFullscreen is wrong.

Do you know how to test this? I'm not very familiar with feature-policy.

Differential Revision: https://phabricator.services.mozilla.com/D78567
This commit is contained in:
Emilio Cobos Álvarez
2020-06-25 13:17:04 +00:00
parent bd911114ea
commit 12c0ddfdee
6 changed files with 29 additions and 21 deletions

View File

@@ -3100,10 +3100,8 @@ static const char* GetFullscreenError(CallerType aCallerType,
return nullptr;
}
// Ensure feature policy allows using the fullscreen API
if (!FeaturePolicyUtils::IsFeatureAllowed(aDocument,
NS_LITERAL_STRING("fullscreen"))) {
return "FullscreenDeniedFeaturePolicy";
if (const char* error = aDocument->GetFullscreenError(aCallerType)) {
return error;
}
// Bypass user interaction checks if preference is set