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

Unified Diff: sky/engine/core/css/SelectorChecker.cpp

Issue 838863002: Remove SelectorChecker::ContextFlags. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « sky/engine/core/css/SelectorChecker.h ('k') | sky/engine/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/SelectorChecker.cpp
diff --git a/sky/engine/core/css/SelectorChecker.cpp b/sky/engine/core/css/SelectorChecker.cpp
index 487c662deafc17ee8bf2d3e9c20b416a1e64ef95..92959f4ec7c60882789abcee170514c184983b2d 100644
--- a/sky/engine/core/css/SelectorChecker.cpp
+++ b/sky/engine/core/css/SelectorChecker.cpp
@@ -64,8 +64,7 @@ bool SelectorChecker::match(const SelectorCheckingContext& context) const
// FIXME(sky): Get rid of SelectorCheckingContext.
SelectorCheckingContext matchContext(context);
- bool isShadowHost = isHostInItsShadowTree(*context.element, context.scope)
- && !(context.contextFlags & TreatShadowHostAsNormalScope);
+ bool isShadowHost = isHostInItsShadowTree(*context.element, context.scope);
while (true) {
const CSSSelector& selector = *matchContext.selector;
@@ -287,7 +286,10 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context) c
return true;
SelectorCheckingContext subContext(context);
- subContext.contextFlags = TreatShadowHostAsNormalScope;
+
+ // Treat the inside of :host() rules as if they were defined in the
+ // same scope as the host.
+ subContext.scope = &context.element->treeScope().rootNode();
for (subContext.selector = selector.selectorList()->first(); subContext.selector; subContext.selector = CSSSelectorList::next(*subContext.selector)) {
if (match(subContext))
« no previous file with comments | « sky/engine/core/css/SelectorChecker.h ('k') | sky/engine/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698