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

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

Issue 848493003: Don't scope check in SelectorChecker. (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/RuleSet.h ('k') | sky/engine/core/css/SelectorChecker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/RuleSet.cpp
diff --git a/sky/engine/core/css/RuleSet.cpp b/sky/engine/core/css/RuleSet.cpp
index d62931dbc8380aacdbc28fdb6257fd8a6a61d349..ce4528128d32bd1cb7e82dcb27b9ef6169aa7376 100644
--- a/sky/engine/core/css/RuleSet.cpp
+++ b/sky/engine/core/css/RuleSet.cpp
@@ -93,12 +93,19 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
#endif
const CSSSelector* it = &component;
+
+ if (it->pseudoType() == CSSSelector::PseudoHost) {
+ m_hostRules.append(ruleData);
+ return true;
+ }
+
for (; it; it = it->tagHistory()) {
+ // Host rules can't match when combined with other selectors, so we just
+ // ignore them.
+ if (it->pseudoType() == CSSSelector::PseudoHost)
+ return true;
extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
}
- // FIXME: this null check should not be necessary. See crbug.com/358475
- if (it)
- extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
// Prefer rule sets in order of most likely to apply infrequently.
if (!id.isEmpty()) {
@@ -109,7 +116,6 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
addToRuleSet(className, ensurePendingRules()->classRules, ruleData);
return true;
}
-
if (!tagName.isEmpty()) {
addToRuleSet(tagName, ensurePendingRules()->tagRules, ruleData);
return true;
« no previous file with comments | « sky/engine/core/css/RuleSet.h ('k') | sky/engine/core/css/SelectorChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698