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

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

Issue 801283006: Get rid of SelectorCheckingContext. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: missing static. 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 | « no previous file | 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/ElementRuleCollector.cpp
diff --git a/sky/engine/core/css/ElementRuleCollector.cpp b/sky/engine/core/css/ElementRuleCollector.cpp
index a97ae378a079816d9ca68feef48de1385a115436..b9fd6dbec387fbe76df572b84e3936cb925d94b4 100644
--- a/sky/engine/core/css/ElementRuleCollector.cpp
+++ b/sky/engine/core/css/ElementRuleCollector.cpp
@@ -130,17 +130,15 @@ void ElementRuleCollector::sortAndTransferMatchedRules()
inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const ContainerNode* scope)
{
- SelectorChecker selectorChecker;
- SelectorChecker::SelectorCheckingContext context(ruleData.selector(), m_context.element());
- context.scope = scope;
- if (selectorChecker.match(context)) {
- if (selectorChecker.matchedAttributeSelector())
+ SelectorChecker checker(*m_context.element());
+ if (checker.match(ruleData.selector(), scope)) {
+ if (checker.matchedAttributeSelector())
m_style->setUnique();
- if (selectorChecker.matchedFocusSelector())
+ if (checker.matchedFocusSelector())
m_style->setAffectedByFocus();
- if (selectorChecker.matchedHoverSelector())
+ if (checker.matchedHoverSelector())
m_style->setAffectedByHover();
- if (selectorChecker.matchedActiveSelector())
+ if (checker.matchedActiveSelector())
m_style->setAffectedByActive();
return true;
}
« no previous file with comments | « no previous file | sky/engine/core/css/SelectorChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698