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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2421473004: CSP: Fire 'SecurityPolicyViolation' on the offending element. (Closed)
Patch Set: Test. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 3818 matching lines...) Expand 10 before | Expand all | Expand 10 after
3829 if (document().scriptableDocumentParser() && !document().isInDocumentWrite()) 3829 if (document().scriptableDocumentParser() && !document().isInDocumentWrite())
3830 startLineNumber = document().scriptableDocumentParser()->lineNumber(); 3830 startLineNumber = document().scriptableDocumentParser()->lineNumber();
3831 3831
3832 if (newStyleString.isNull()) { 3832 if (newStyleString.isNull()) {
3833 ensureUniqueElementData().m_inlineStyle.clear(); 3833 ensureUniqueElementData().m_inlineStyle.clear();
3834 } else if (modificationReason == ModifiedByCloning || 3834 } else if (modificationReason == ModifiedByCloning ||
3835 ContentSecurityPolicy::shouldBypassMainWorld(&document()) || 3835 ContentSecurityPolicy::shouldBypassMainWorld(&document()) ||
3836 (containingShadowRoot() && 3836 (containingShadowRoot() &&
3837 containingShadowRoot()->type() == ShadowRootType::UserAgent) || 3837 containingShadowRoot()->type() == ShadowRootType::UserAgent) ||
3838 document().contentSecurityPolicy()->allowInlineStyle( 3838 document().contentSecurityPolicy()->allowInlineStyle(
3839 document().url(), String(), startLineNumber, newStyleString)) { 3839 this, document().url(), String(), startLineNumber,
3840 newStyleString)) {
3840 setInlineStyleFromString(newStyleString); 3841 setInlineStyleFromString(newStyleString);
3841 } 3842 }
3842 3843
3843 elementData()->m_styleAttributeIsDirty = false; 3844 elementData()->m_styleAttributeIsDirty = false;
3844 3845
3845 setNeedsStyleRecalc( 3846 setNeedsStyleRecalc(
3846 LocalStyleChange, 3847 LocalStyleChange,
3847 StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange)); 3848 StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange));
3848 InspectorInstrumentation::didInvalidateStyleAttr(this); 3849 InspectorInstrumentation::didInvalidateStyleAttr(this);
3849 } 3850 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
4080 } 4081 }
4081 4082
4082 DEFINE_TRACE_WRAPPERS(Element) { 4083 DEFINE_TRACE_WRAPPERS(Element) {
4083 if (hasRareData()) { 4084 if (hasRareData()) {
4084 visitor->traceWrappers(elementRareData()); 4085 visitor->traceWrappers(elementRareData());
4085 } 4086 }
4086 ContainerNode::traceWrappers(visitor); 4087 ContainerNode::traceWrappers(visitor);
4087 } 4088 }
4088 4089
4089 } // namespace blink 4090 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698