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

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

Issue 2680083002: Initial Implementation of Iframe Attribute for Feature Policy (Part 1) (Closed)
Patch Set: Codereview: nit Created 3 years, 10 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/HTMLIFrameElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
index 0ac2d2966cbac6d8d8208423e76f45e6e820f7f5..b95120597c5e8e93838348787c43b88cfcd63a15 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
@@ -40,6 +40,7 @@ inline HTMLIFrameElement::HTMLIFrameElement(Document& document)
: HTMLFrameElementBase(iframeTag, document),
m_didLoadNonEmptyDocument(false),
m_sandbox(HTMLIFrameElementSandbox::create(this)),
+ m_allow(HTMLIFrameElementAllow::create(this)),
m_referrerPolicy(ReferrerPolicyDefault) {}
DEFINE_NODE_FACTORY(HTMLIFrameElement)
@@ -47,6 +48,7 @@ DEFINE_NODE_FACTORY(HTMLIFrameElement)
DEFINE_TRACE(HTMLIFrameElement) {
visitor->trace(m_sandbox);
visitor->trace(m_permissions);
+ visitor->trace(m_allow);
HTMLFrameElementBase::trace(visitor);
Supplementable<HTMLIFrameElement>::trace(visitor);
}
@@ -63,6 +65,10 @@ DOMTokenList* HTMLIFrameElement::permissions() const {
return m_permissions.get();
}
+DOMTokenList* HTMLIFrameElement::allow() const {
+ return m_allow.get();
+}
+
bool HTMLIFrameElement::isPresentationAttribute(
const QualifiedName& name) const {
if (name == widthAttr || name == heightAttr || name == alignAttr ||
@@ -158,6 +164,9 @@ void HTMLIFrameElement::parseAttribute(
m_csp = value;
if (m_csp != oldCSP)
frameOwnerPropertiesChanged();
+ } else if (RuntimeEnabledFeatures::featurePolicyEnabled() &&
+ name == allowAttr) {
+ m_allow->setValue(value);
} else {
if (name == srcAttr)
logUpdateAttributeIfIsolatedWorldAndInDocument("iframe", params);
@@ -220,6 +229,19 @@ void HTMLIFrameElement::sandboxValueWasSet() {
setSynchronizedLazyAttribute(sandboxAttr, m_sandbox->value());
}
+void HTMLIFrameElement::allowValueWasSet() {
+ String invalidTokens;
+ m_allowedFeatureNames = m_allow->parseAllowedFeatureNames(invalidTokens);
+ if (!invalidTokens.isNull()) {
+ document().addConsoleMessage(ConsoleMessage::create(
+ OtherMessageSource, ErrorMessageLevel,
+ "Error while parsing the 'allow' attribute: " + invalidTokens));
+ }
+ setSynchronizedLazyAttribute(allowAttr, m_allow->value());
+ // TODO(lunalu): Once allowedFeatureNames is passed to frame owner, call
+ // frameOwnerPropertiesChanged.
+}
+
ReferrerPolicy HTMLIFrameElement::referrerPolicyAttribute() {
return m_referrerPolicy;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.h ('k') | third_party/WebKit/Source/core/html/HTMLIFrameElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698