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

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

Issue 1058763002: Introduce Node::needsDistributionRecalc and use it in ElementShadow to fix the wrong assertions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Todo in the comment Created 5 years, 8 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/ElementShadow.cpp » ('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 81df1b26477f827cc186c84b1c6b5a547d07a857..574745427d842db534640170fb002ebe0b69f0d0 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -665,6 +665,19 @@ inline static Node& rootInTreeOfTrees(Node& node)
return *root;
}
+#if ENABLE(ASSERT)
+bool Node::needsDistributionRecalc() const
+{
+ // TODO(hayato): If we can prove that this->childNeedsDistributionRecalc()
+ // is enough for either case, in a document, not in a document, remove this
+ // function after renaming Node::childNeedsDistributionRecalc() to a more
+ // appropriate name.
+ if (inDocument())
+ return document().childNeedsDistributionRecalc();
+ return childNeedsDistributionRecalc();
+}
+#endif
+
void Node::updateDistribution()
{
TRACE_EVENT0("blink", "Node::updateDistribution");
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/shadow/ElementShadow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698