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

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 2789363002: Styling slot fallback content with ::slotted()
Patch Set: rebase Created 3 years, 8 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/css/SelectorChecker.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
index 86a68368667e7ce6e0f9daff6d0c8b93e0a910f4..f32020804c7b50187b81f898a62c182a6a152c64 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -123,8 +123,12 @@ static const HTMLSlotElement* FindSlotElementInScope(
if (!context.scope)
return context.element->AssignedSlot();
- for (const HTMLSlotElement* slot = context.element->AssignedSlot(); slot;
- slot = slot->AssignedSlot()) {
+ const HTMLSlotElement* slot = context.element->AssignedSlot();
+ if (!slot)
+ slot = HTMLSlotElement::FindFallbackSlotElementFor(*context.element);
+
+ // Find the slot element that matches the scope.
+ for (; slot; slot = slot->AssignedSlot()) {
if (slot->GetTreeScope() == context.scope->GetTreeScope())
return slot;
}

Powered by Google App Engine
This is Rietveld 408576698