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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2359813002: Allows inline style in User-Agent shadow trees under CSP (Closed)
Patch Set: Check using containingShadowRoot and ShadowRootType Created 4 years, 3 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/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index c3a1e143cca4358eb8619f5b7f574d4ce9154ec1..a70da0b7f8cd17c79bc6ff87a8f3bde279ee877f 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -3618,7 +3618,7 @@ void Element::styleAttributeChanged(const AtomicString& newStyleString, Attribut
if (newStyleString.isNull()) {
ensureUniqueElementData().m_inlineStyle.clear();
- } else if (modificationReason == ModifiedByCloning || ContentSecurityPolicy::shouldBypassMainWorld(&document()) || document().contentSecurityPolicy()->allowInlineStyle(document().url(), String(), startLineNumber, newStyleString)) {
+ } else if (modificationReason == ModifiedByCloning || ContentSecurityPolicy::shouldBypassMainWorld(&document()) || (containingShadowRoot() && containingShadowRoot()->type() == ShadowRootType::UserAgent) || document().contentSecurityPolicy()->allowInlineStyle(document().url(), String(), startLineNumber, newStyleString)) {
setInlineStyleFromString(newStyleString);
}

Powered by Google App Engine
This is Rietveld 408576698