| 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
|
|
|
|
|