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

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

Issue 24773003: Rename Node::attached() to confusingAndOftenMisusedAttached() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ElementRareData.h » ('j') | 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 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())
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698