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

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

Issue 2749033006: Handle fallback content case in FlatTreeTraversal::traverseSiblings() (Closed)
Patch Set: Created 3 years, 9 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 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;

Powered by Google App Engine
This is Rietveld 408576698