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

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

Issue 152623002: Make StyleChange parameter explicit in setNeedsStyleRecalc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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/FullscreenElementStack.cpp » ('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 1ae207412c1c684ae848a9d9dc288cdd16315e5a..de69f9b3a2d1bb23c99412595e67fac5eb492e24 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1005,7 +1005,7 @@ void Element::attributeChanged(const QualifiedName& name, const AtomicString& ne
shouldInvalidateStyle |= !styleResolver;
if (shouldInvalidateStyle)
- setNeedsStyleRecalc();
+ setNeedsStyleRecalc(SubtreeStyleChange);
if (AXObjectCache* cache = document().existingAXObjectCache())
cache->handleAttributeChanged(name, this);
@@ -1667,7 +1667,7 @@ void Element::checkForChildrenAdjacentRuleChanges()
bool childRulesChanged = element->needsStyleRecalc() && element->styleChangeType() >= SubtreeStyleChange;
if (forceCheckOfNextElementCount || forceCheckOfAnyElementSibling)
- element->setNeedsStyleRecalc();
+ element->setNeedsStyleRecalc(SubtreeStyleChange);
if (forceCheckOfNextElementCount)
forceCheckOfNextElementCount--;
@@ -1712,7 +1712,7 @@ ElementShadow& Element::ensureShadow()
void Element::didAffectSelector(AffectedSelectorMask mask)
{
- setNeedsStyleRecalc();
+ setNeedsStyleRecalc(SubtreeStyleChange);
if (ElementShadow* elementShadow = shadowWhereNodeCanBeDistributed(*this))
elementShadow->didAffectSelector(mask);
}
@@ -1805,7 +1805,7 @@ void Element::checkForEmptyStyleChange(RenderStyle* style)
return;
if (!style || (styleAffectedByEmpty() && (!style->emptyState() || hasChildNodes())))
- setNeedsStyleRecalc();
+ setNeedsStyleRecalc(SubtreeStyleChange);
}
void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* beforeChange, Node* afterChange, int childCountDelta)
@@ -1829,7 +1829,7 @@ void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* be
// For performance reasons we just mark the parent node as changed, since we don't want to make childrenChanged O(n^2) by crawling all our kids
// here. recalcStyle will then force a walk of the children when it sees that this has happened.
if ((childrenAffectedByForwardPositionalRules() && afterChange) || (childrenAffectedByBackwardPositionalRules() && beforeChange)) {
- setNeedsStyleRecalc();
+ setNeedsStyleRecalc(SubtreeStyleChange);
return;
}
@@ -1847,11 +1847,11 @@ void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* be
// This is the insert/append case.
if (newFirstChild != firstElementAfterInsertion && firstElementAfterInsertionStyle && firstElementAfterInsertionStyle->firstChildState())
- firstElementAfterInsertion->setNeedsStyleRecalc();
+ firstElementAfterInsertion->setNeedsStyleRecalc(SubtreeStyleChange);
// We also have to handle node removal.
if (childCountDelta < 0 && newFirstChild == firstElementAfterInsertion && newFirstChild && (!newFirstChildStyle || !newFirstChildStyle->firstChildState()))
- newFirstChild->setNeedsStyleRecalc();
+ newFirstChild->setNeedsStyleRecalc(SubtreeStyleChange);
}
// :last-child. In the parser callback case, we don't have to check anything, since we were right the first time.
@@ -1866,19 +1866,19 @@ void Element::checkForSiblingStyleChanges(bool finishedParsingCallback, Node* be
RenderStyle* lastElementBeforeInsertionStyle = lastElementBeforeInsertion ? lastElementBeforeInsertion->renderStyle() : 0;
if (newLastChild != lastElementBeforeInsertion && lastElementBeforeInsertionStyle && lastElementBeforeInsertionStyle->lastChildState())
- lastElementBeforeInsertion->setNeedsStyleRecalc();
+ lastElementBeforeInsertion->setNeedsStyleRecalc(SubtreeStyleChange);
// We also have to handle node removal. The parser callback case is similar to node removal as well in that we need to change the last child
// to match now.
if ((childCountDelta < 0 || finishedParsingCallback) && newLastChild == lastElementBeforeInsertion && newLastChild && (!newLastChildStyle || !newLastChildStyle->lastChildState()))
- newLastChild->setNeedsStyleRecalc();
+ newLastChild->setNeedsStyleRecalc(SubtreeStyleChange);
}
// The + selector. We need to invalidate the first element following the insertion point. It is the only possible element
// that could be affected by this DOM change.
if (childrenAffectedByDirectAdjacentRules() && afterChange) {
if (Node* firstElementAfterInsertion = afterChange->isElementNode() ? afterChange : afterChange->nextElementSibling())
- firstElementAfterInsertion->setNeedsStyleRecalc();
+ firstElementAfterInsertion->setNeedsStyleRecalc(SubtreeStyleChange);
}
}
@@ -3082,7 +3082,7 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
if (oldValue != newValue) {
if (inActiveDocument() && hasSelectorForAttribute(&document(), name.localName()))
- setNeedsStyleRecalc();
+ setNeedsStyleRecalc(SubtreeStyleChange);
if (isUpgradedCustomElement())
CustomElement::attributeDidChange(this, name.localName(), oldValue, newValue);
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/FullscreenElementStack.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698