| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index 7d79c4509285dd9a56b10a3a931230cbccdaa47d..56e69b05bac772a198385b665d19f8c410ddd634 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -917,7 +917,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
|
| document().incDOMTreeVersion();
|
|
|
| StyleResolver* styleResolver = document().styleResolverIfExists();
|
| - bool testShouldInvalidateStyle = attached() && styleResolver && styleChangeType() < SubtreeStyleChange;
|
| + bool testShouldInvalidateStyle = confusingAndOftenMisusedAttached() && styleResolver && styleChangeType() < SubtreeStyleChange;
|
| bool shouldInvalidateStyle = false;
|
|
|
| if (isStyledElement() && name == styleAttr) {
|
| @@ -1032,7 +1032,7 @@ static bool checkSelectorForClassChange(const SpaceSplitString& oldClasses, cons
|
| void Element::classAttributeChanged(const AtomicString& newClassString)
|
| {
|
| StyleResolver* styleResolver = document().styleResolverIfExists();
|
| - bool testShouldInvalidateStyle = attached() && styleResolver && styleChangeType() < SubtreeStyleChange;
|
| + bool testShouldInvalidateStyle = confusingAndOftenMisusedAttached() && styleResolver && styleChangeType() < SubtreeStyleChange;
|
| bool shouldInvalidateStyle = false;
|
|
|
| if (classStringHasClassName(newClassString)) {
|
| @@ -1675,7 +1675,7 @@ static void inline checkForEmptyStyleChange(Element* element, RenderStyle* style
|
| static void checkForSiblingStyleChanges(Element* e, RenderStyle* style, bool finishedParsingCallback,
|
| Node* beforeChange, Node* afterChange, int childCountDelta)
|
| {
|
| - if (!e->attached() || e->document().hasPendingForcedStyleRecalc() || e->styleChangeType() >= SubtreeStyleChange)
|
| + if (!e->confusingAndOftenMisusedAttached() || e->document().hasPendingForcedStyleRecalc() || e->styleChangeType() >= SubtreeStyleChange)
|
| return;
|
|
|
| // :empty selector.
|
| @@ -2222,7 +2222,7 @@ RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
|
| return usedStyle;
|
| }
|
|
|
| - if (!attached())
|
| + if (!confusingAndOftenMisusedAttached())
|
| // FIXME: Try to do better than this. Ensure that styleForElement() works for elements that are not in the
|
| // document tree and figure out when to destroy the computed style for such elements.
|
| return 0;
|
| @@ -2831,7 +2831,7 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
|
| }
|
|
|
| if (oldValue != newValue) {
|
| - if (attached() && hasSelectorForAttribute(&document(), name.localName()))
|
| + if (confusingAndOftenMisusedAttached() && hasSelectorForAttribute(&document(), name.localName()))
|
| setNeedsStyleRecalc();
|
|
|
| if (isUpgradedCustomElement())
|
|
|