| 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;
|
| }
|
|
|