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

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

Issue 143873016: Implement style invalidation tree walk for targeted style recalc upon class change. (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/Node.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 66bbfbc6ed3a15a48c01fb584c3860fdf2c6ef0b..183ff52c39b1e6e3c3e8d5759542844d14bc1077 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -639,6 +639,20 @@ void Node::setIsLink(bool isLink)
setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag);
}
+void Node::setNeedsStyleInvalidation()
+{
+ setFlag(NeedsStyleInvalidation);
+ markAncestorsWithChildNeedsStyleInvalidation();
+}
+
+void Node::markAncestorsWithChildNeedsStyleInvalidation()
+{
+ for (Node* node = this; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
+ node->setChildNeedsStyleInvalidation();
+ if (document().childNeedsStyleInvalidation())
+ document().scheduleStyleRecalc();
+}
+
void Node::markAncestorsWithChildNeedsDistributionRecalc()
{
for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/shadow/SelectRuleFeatureSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698