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

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

Issue 1068193002: Make Node::needsDistributionRecalc always check the root node of the tree of trees, instead of the … (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add a test 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 | « LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt ('k') | no next file » | 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 145f30838928870ac400c15ea1e1a4463c384656..0ce5752ad66ac7c3e55b87048c70680f3083f7f2 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -651,11 +651,11 @@ inline static ShadowRoot* oldestShadowRootFor(const Node* node)
}
#endif
-inline static Node& rootInTreeOfTrees(Node& node)
+inline static Node& rootInTreeOfTrees(const Node& node)
{
if (node.inDocument())
return node.document();
- Node* root = &node;
+ Node* root = const_cast<Node*>(&node);
while (Node* host = root->shadowHost())
root = host;
while (Node* ancestor = root->parentNode())
@@ -667,13 +667,7 @@ inline static Node& rootInTreeOfTrees(Node& node)
#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();
+ return rootInTreeOfTrees(*this).childNeedsDistributionRecalc();
}
#endif
« no previous file with comments | « LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698