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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp

Issue 2836753002: Rebuild layout tree in flat tree order. (Closed)
Patch Set: Rebased Created 3 years, 7 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
Index: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
index 563d2ae1b55118b3c35f187d285dcc805b38abd8..a8779c6ce24ee25574e337dd775086df662aa3ae 100644
--- a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
@@ -106,17 +106,6 @@ Node* FlatTreeTraversal::V0ResolveDistributionStartingAt(
return nullptr;
}
-static HTMLSlotElement* FinalDestinationSlotFor(const Node& node) {
- HTMLSlotElement* slot = node.AssignedSlot();
- if (!slot)
- return nullptr;
- for (HTMLSlotElement* next = slot->AssignedSlot(); next;
- next = next->AssignedSlot()) {
- slot = next;
- }
- return slot;
-}
-
// TODO(hayato): This may return a wrong result for a node which is not in a
// document flat tree. See FlatTreeTraversalTest's redistribution test for
// details.
@@ -162,7 +151,7 @@ Node* FlatTreeTraversal::TraverseSiblings(const Node& node,
Node* FlatTreeTraversal::TraverseSiblingsForV1HostChild(
const Node& node,
TraversalDirection direction) {
- HTMLSlotElement* slot = FinalDestinationSlotFor(node);
+ HTMLSlotElement* slot = node.FinalDestinationSlot();
if (!slot)
return nullptr;
if (Node* sibling_in_distributed_nodes =
@@ -195,7 +184,7 @@ ContainerNode* FlatTreeTraversal::TraverseParent(
return node.ParentOrShadowHostNode();
if (node.IsChildOfV1ShadowHost()) {
- HTMLSlotElement* slot = FinalDestinationSlotFor(node);
+ HTMLSlotElement* slot = node.FinalDestinationSlot();
if (!slot)
return nullptr;
return TraverseParent(*slot);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698