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 12457460b7b20b3f17c50c8fe861b380e63af822..f58be2196185ebc301b469f61ea6cd3abbc3af5d 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 || |
@@ -149,6 +155,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); |
@@ -211,6 +220,18 @@ 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()); |
+ // frameOwnerPropertiesChanged(); |
iclelland
2017/02/08 15:06:24
I presume this is for a future CL -- if so, can yo
lunalu1
2017/02/08 19:50:29
Done.
|
+} |
+ |
ReferrerPolicy HTMLIFrameElement::referrerPolicyAttribute() { |
return m_referrerPolicy; |
} |