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

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

Issue 2873433002: Enable Feature Policy without experimental features or fullscreen (Closed)
Patch Set: Update webkit_unit_tests(vibrate is not valid feature name) and layout_tests for fp-fullscreen (exp… Created 3 years, 7 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 f0e48fbf779f72f15e131b0357344568cdd7f096..62cae8d20feafce876c9684321e708aa2bd79f7d 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -63,6 +63,26 @@ bool AllowedToUseFullscreen(const Frame* frame) {
if (!frame)
return false;
+ // TODO(lunalu): Re-enable fullscreen in feature policy once all fullscreen
iclelland 2017/05/09 17:58:45 As mentioned offline, I don't really like this, ev
+ // tests have been re-written that "allowfullscreen" / "fullscreen" policy
+ // cannot be updated dynamically, by replacing the block below by commented
+ // block below.
+ // crbug.com/666761
+ // 2. If |document|'s browsing context is a top-level browsing context, then
+ // return true.
+ if (frame->IsMainFrame())
+ return true;
+
+ // 3. If |document|'s browsing context has a browsing context container that
+ // is an iframe element with an |allowattribute| attribute specified, and
+ // whose node document is allowed to use the feature indicated by
+ // |allowattribute|, then return true.
+ if (frame->Owner() && frame->Owner()->AllowFullscreen())
+ return AllowedToUseFullscreen(frame->Tree().Parent());
+
+ // 4. Return false.
+ return false;
+ /*
if (!RuntimeEnabledFeatures::featurePolicyEnabled()) {
// 2. If |document|'s browsing context is a top-level browsing context, then
// return true.
@@ -83,6 +103,7 @@ bool AllowedToUseFullscreen(const Frame* frame) {
// 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