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

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

Issue 2749033006: Handle fallback content case in FlatTreeTraversal::traverseSiblings() (Closed)
Patch Set: Address hayato's comments. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversalTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f2a05a3b0fefa6471fe9a7003b8f7fc9251c5ed2 100644
--- a/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp
@@ -134,6 +134,15 @@ Node* FlatTreeTraversal::traverseSiblings(const Node& node,
direction))
return found;
+ // 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.supportsDistribution() && slot.assignedNodes().isEmpty())
+ return traverseSiblings(slot, direction);
+ }
+
if (!node.isInV0ShadowTree())
return nullptr;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversalTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698