Chromium Code Reviews| 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 bb729dca535bbf0d9c7c63f0bfcffcfaedc17c3a..b8c76c9a1b81511e35f06dd45457ac3abc1e5edd 100644 |
| --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
| +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp |
| @@ -114,16 +114,17 @@ static Element* parentElement( |
| return context.element->parentElement(); |
| } |
| +// If context has scope, return slot that matches the scope, otherwise return |
| +// the assigned slot for scope-less matching of ::slotted pseudo element. |
| static const HTMLSlotElement* findSlotElementInScope( |
| const SelectorChecker::SelectorCheckingContext& context) { |
| if (!context.scope) |
| - return nullptr; |
| + return context.element->assignedSlot(); |
|
rune
2017/01/11 11:34:27
Not sure I understand this one. This is fixing a k
kochi
2017/01/13 10:46:45
ElemenetRuleCollector::hasAnyMatchingRules() does
|
| - const HTMLSlotElement* slot = context.element->assignedSlot(); |
| - while (slot) { |
| + for (const HTMLSlotElement* slot = context.element->assignedSlot(); slot; |
| + slot = slot->assignedSlot()) { |
| if (slot->treeScope() == context.scope->treeScope()) |
| return slot; |
| - slot = slot->assignedSlot(); |
| } |
| return nullptr; |
| } |