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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameElement.cpp

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Add Frame element unit test Created 3 years, 6 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/html/HTMLFrameElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameElement.cpp
index 641ba2ae5ae1af3641cc9c59731b8099e18baf20..b81126dc1deee26be6935ac10b8ab6b06ca19e62 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameElement.cpp
@@ -76,4 +76,28 @@ void HTMLFrameElement::ParseAttribute(
}
}
+Vector<WebParsedFeaturePolicyDeclaration>
+HTMLFrameElement::ConstructContainerPolicy() const {
+ WebParsedFeaturePolicy base_container_policy =
+ HTMLFrameOwnerElement::ConstructContainerPolicy();
+ // Frame elements are not allowed to enable the fullscreen feature. Remove any
+ // fullscreen policy which was added by the generic ConstructContainerPolicy
+ // algorithm.
+ Vector<WebParsedFeaturePolicyDeclaration> filtered_container_policy;
+ for (size_t i = 0; i < base_container_policy.size(); ++i) {
+ if (base_container_policy[i].feature !=
+ WebFeaturePolicyFeature::kFullscreen) {
+ filtered_container_policy.push_back(base_container_policy[i]);
+ }
+ }
+ // Add an empty whitelist for the fullscreen feature so that the framed
+ // content is unable to use the API, regardless of origin.
+ WebParsedFeaturePolicyDeclaration whitelist;
+ whitelist.feature = WebFeaturePolicyFeature::kFullscreen;
+ whitelist.matches_all_origins = false;
+ whitelist.origins = Vector<WebSecurityOrigin>(0UL);
+ filtered_container_policy.push_back(whitelist);
+ return filtered_container_policy;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698