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

Unified Diff: Source/WebCore/dom/StyledElement.cpp

Issue 14234005: CSP blocks style application in cloned nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CSP blocks style application in cloned nodes Created 7 years, 8 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
« no previous file with comments | « Source/WebCore/dom/StyledElement.h ('k') | Source/WebCore/svg/SVGElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/StyledElement.cpp
diff --git a/Source/WebCore/dom/StyledElement.cpp b/Source/WebCore/dom/StyledElement.cpp
index 9a2c8325699881899d96e56046d970ba9f6a3e8f..a4143baab6bc2aa56b7a1dca81b165dc07627eca 100644
--- a/Source/WebCore/dom/StyledElement.cpp
+++ b/Source/WebCore/dom/StyledElement.cpp
@@ -157,16 +157,16 @@ MutableStylePropertySet* StyledElement::ensureMutableInlineStyle()
return static_cast<MutableStylePropertySet*>(inlineStyle.get());
}
-void StyledElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue)
+void StyledElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason reason)
{
if (name == styleAttr)
- styleAttributeChanged(newValue);
+ styleAttributeChanged(newValue, reason);
else if (isPresentationAttribute(name)) {
elementData()->m_presentationAttributeStyleIsDirty = true;
setNeedsStyleRecalc(InlineStyleChange);
}
- Element::attributeChanged(name, newValue);
+ Element::attributeChanged(name, newValue, reason);
}
PropertySetCSSStyleDeclaration* StyledElement::inlineStyleCSSOMWrapper()
@@ -197,7 +197,7 @@ inline void StyledElement::setInlineStyleFromString(const AtomicString& newStyle
inlineStyle->parseDeclaration(newStyleString, document()->elementSheet()->contents());
}
-void StyledElement::styleAttributeChanged(const AtomicString& newStyleString)
+void StyledElement::styleAttributeChanged(const AtomicString& newStyleString, AttributeModificationReason modificationReason)
{
WTF::OrdinalNumber startLineNumber = WTF::OrdinalNumber::beforeFirst();
if (document() && document()->scriptableDocumentParser() && !document()->isInDocumentWrite())
@@ -207,7 +207,7 @@ void StyledElement::styleAttributeChanged(const AtomicString& newStyleString)
if (PropertySetCSSStyleDeclaration* cssomWrapper = inlineStyleCSSOMWrapper())
cssomWrapper->clearParentElement();
ensureUniqueElementData()->m_inlineStyle.clear();
- } else if (document()->contentSecurityPolicy()->allowInlineStyle(document()->url(), startLineNumber))
+ } else if (modificationReason == ModifiedByCloning || document()->contentSecurityPolicy()->allowInlineStyle(document()->url(), startLineNumber))
setInlineStyleFromString(newStyleString);
elementData()->m_styleAttributeIsDirty = false;
« no previous file with comments | « Source/WebCore/dom/StyledElement.h ('k') | Source/WebCore/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698