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; |
} |