Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index 0c0bac11e5865c4574f89b638f7c5c9570ba7629..f49b9a9a740cf7f9dbe53045b689878019c961a3 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -1109,22 +1109,13 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne |
| document().incDOMTreeVersion(); |
| StyleResolver* styleResolver = document().styleResolver(); |
| - bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange; |
| - |
| - 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) { |
| AtomicString oldId = elementData()->idForStyleResolution(); |
| AtomicString newId = makeIdForStyleResolution(newValue, document().inQuirksMode()); |
| if (newId != oldId) { |
| elementData()->setIdForStyleResolution(newId); |
| + bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange; |
|
Mike West
2015/06/07 13:59:43
Nit: You can fold this into the `if` on the next l
sof
2015/06/07 19:01:15
Or give it a better name :)
|
| if (testShouldInvalidateStyle) |
| document().styleEngine().idChangedForElement(oldId, newId, *this); |
| } |
| @@ -1132,6 +1123,13 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne |
| classAttributeChanged(newValue); |
| } else if (name == HTMLNames::nameAttr) { |
| setHasName(!newValue.isNull()); |
| + } else if (isStyledElement()) { |
| + if (name == styleAttr) { |
| + styleAttributeChanged(newValue, reason); |
| + } else if (isPresentationAttribute(name)) { |
| + elementData()->m_presentationAttributeStyleIsDirty = true; |
| + setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::fromAttribute(name)); |
| + } |
| } |
| invalidateNodeListCachesInAncestors(&name, this); |