Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: third_party/WebKit/Source/core/dom/Fullscreen.cpp

Issue 2767983003: Initial Implementation of Iframe Attribute for Feature Policy (Part 4) (Closed)
Patch Set: Codereview: nit + added more unit tests for container policy Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Fullscreen.cpp
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
index 7df6c2701b70d13236e5d112b944e51c3022384a..f44809b9307e5ed8e31a9486b5a16fa3b0b07308 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -80,35 +80,9 @@ bool AllowedToUseFullscreen(const Frame* frame) {
return false;
}
- // If Feature Policy is enabled, then we need this hack to support it, until
- // we have proper support for <iframe allowfullscreen> in FP:
-
- // 1. If FP, by itself, enables fullscreen in this document, then fullscreen
- // is allowed.
- if (frame->IsFeatureEnabled(WebFeaturePolicyFeature::kFullscreen)) {
- return true;
- }
-
- // 2. Otherwise, if the embedding frame's document is allowed to use
- // fullscreen (either through FP or otherwise), and either:
- // a) this is a same-origin embedded document, or
- // b) this document's iframe has the allowfullscreen attribute set,
- // then fullscreen is allowed.
- if (!frame->IsMainFrame()) {
- if (AllowedToUseFullscreen(frame->Tree().Parent())) {
- return (frame->Owner() && frame->Owner()->AllowFullscreen()) ||
- frame->Tree()
- .Parent()
- ->GetSecurityContext()
- ->GetSecurityOrigin()
- ->IsSameSchemeHostPortAndSuborigin(
- frame->GetSecurityContext()->GetSecurityOrigin());
- }
- }
-
- // Otherwise, fullscreen is not allowed. (If we reach here and this is the
- // main frame, then fullscreen must have been disabled by FP.)
- return false;
+ // 2. If Feature Policy is enabled, return the policy for "fullscreen"
+ // feature.
+ return frame->IsFeatureEnabled(WebFeaturePolicyFeature::kFullscreen);
}
bool AllowedToRequestFullscreen(Document& document) {

Powered by Google App Engine
This is Rietveld 408576698