Chromium Code Reviews| 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 8e498b52afc88b645c2629d9c170bf420a0405c4..43254c76eeba006d7f8f85783784ad91a22bb4e0 100644 |
| --- a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp |
| +++ b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp |
| @@ -134,6 +134,18 @@ Node* FlatTreeTraversal::traverseSiblings(const Node& node, |
| direction)) |
| return found; |
| + if (node.isInV1ShadowTree()) { |
|
hayato
2017/03/16 09:32:56
Instead of this early check, could you use slot.su
kochi
2017/03/16 10:09:54
Done.
Actually it looks better now. Thanks for th
|
| + // Slotted nodes are already handled in traverseSiblingsForV1HostChild() |
| + // above, here is for fallback contents. |
| + Element* parent = node.parentElement(); |
| + if (parent && isHTMLSlotElement(parent)) { |
| + HTMLSlotElement& slot = toHTMLSlotElement(*parent); |
| + if (!slot.assignedNodes().isEmpty()) |
| + return nullptr; |
| + return traverseSiblings(slot, direction); |
| + } |
| + } |
| + |
| if (!node.isInV0ShadowTree()) |
| return nullptr; |