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

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

Issue 26270004: Element should not use confusingAndOftenMisusedAttached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/dom/Node.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 71a661bb4c62127641195229b702e5efb2b2d71d..68940d9558c2c38692f2501a7bbbff52b3c504f8 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -976,7 +976,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
document().incDOMTreeVersion();
StyleResolver* styleResolver = document().styleResolverIfExists();
- bool testShouldInvalidateStyle = confusingAndOftenMisusedAttached() && styleResolver && styleChangeType() < SubtreeStyleChange;
+ bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange;
bool shouldInvalidateStyle = false;
if (isStyledElement() && name == styleAttr) {
@@ -1091,7 +1091,7 @@ static bool checkSelectorForClassChange(const SpaceSplitString& oldClasses, cons
void Element::classAttributeChanged(const AtomicString& newClassString)
{
StyleResolver* styleResolver = document().styleResolverIfExists();
- bool testShouldInvalidateStyle = confusingAndOftenMisusedAttached() && styleResolver && styleChangeType() < SubtreeStyleChange;
+ bool testShouldInvalidateStyle = inActiveDocument() && styleResolver && styleChangeType() < SubtreeStyleChange;
bool shouldInvalidateStyle = false;
if (classStringHasClassName(newClassString)) {
@@ -1769,7 +1769,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->confusingAndOftenMisusedAttached() || e->document().hasPendingForcedStyleRecalc() || e->styleChangeType() >= SubtreeStyleChange)
+ if (!e->inActiveDocument() || e->document().hasPendingForcedStyleRecalc() || e->styleChangeType() >= SubtreeStyleChange)
return;
// :empty selector.
@@ -2313,7 +2313,7 @@ RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
return usedStyle;
}
- if (!confusingAndOftenMisusedAttached())
+ if (!inActiveDocument())
// 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;
@@ -2931,7 +2931,7 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
}
if (oldValue != newValue) {
- if (confusingAndOftenMisusedAttached() && hasSelectorForAttribute(&document(), name.localName()))
+ if (inActiveDocument() && hasSelectorForAttribute(&document(), name.localName()))
setNeedsStyleRecalc();
if (isUpgradedCustomElement())
« no previous file with comments | « no previous file | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698