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

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

Issue 129633003: Add a first pass of a class descendant invalidator, and a containing RuleSetAnalyzer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Implement tree walk for descendant class invalidation. 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 2c1dc4c1baf841dd990e8fe7c0838f2d70b72a92..a64525517455bd864871c2485a407edec4b20bec 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -646,6 +646,25 @@ void Node::setIsLink(bool isLink)
setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag);
}
+void Node::markAncestorsWithChildNeedsInvalidation()
+{
+ for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
+ node->setChildNeedsInvalidation();
+ if (document().childNeedsInvalidation())
+ document().scheduleStyleRecalc();
+}
+
+// get rid of this method!
+void Node::setNeedsInvalidation()
+{
+ markAncestorsWithChildNeedsInvalidation();
+}
+
+bool Node::needsInvalidation() const
+{
+ return false;
+}
+
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