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

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

Issue 2613213002: Support Style Sharing for Shadow DOM V1 (Closed)
Patch Set: update Created 3 years, 11 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/css/resolver/SharedStyleFinder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
- 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;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698