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

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

Issue 1163163003: Call isStyledElement() only once in Element::attributeChanged() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index df7cfc8d14fcaeeffc9cf1d8ac3a0cde8982f163..4a4ef0569508f30a08b0697bcaf95d736e25c699 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1110,11 +1110,13 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
StyleResolver* styleResolver = document().styleResolver();
bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange;
- if (isStyledElement() && name == styleAttr) {
- styleAttributeChanged(newValue, reason);
- } else if (isStyledElement() && isPresentationAttribute(name)) {
- elementData()->m_presentationAttributeStyleIsDirty = true;
- setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
+ if (isStyledElement()) {
+ if (name == styleAttr) {
+ styleAttributeChanged(newValue, reason);
+ } else if (isPresentationAttribute(name)) {
+ elementData()->m_presentationAttributeStyleIsDirty = true;
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::fromAttribute(name));
+ }
}
if (name == HTMLNames::idAttr) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698