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

Unified Diff: Source/core/css/ElementRuleCollector.cpp

Issue 1313713005: Reland of moved unused CascadeOrder. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@shadow-cascade-order-20150817
Patch Set: Created 5 years, 4 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 | « Source/core/css/ElementRuleCollector.h ('k') | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/ElementRuleCollector.cpp
diff --git a/Source/core/css/ElementRuleCollector.cpp b/Source/core/css/ElementRuleCollector.cpp
index 162a4c2ce8b1d7a160aae793c4b393f4a68c2332..69ed650cf4f929ce06e16266efa5c974b081b4f1 100644
--- a/Source/core/css/ElementRuleCollector.cpp
+++ b/Source/core/css/ElementRuleCollector.cpp
@@ -129,7 +129,7 @@
}
template<typename RuleDataListType>
-void ElementRuleCollector::collectMatchingRulesForList(const RuleDataListType* rules, CascadeOrder cascadeOrder, const MatchRequest& matchRequest)
+void ElementRuleCollector::collectMatchingRulesForList(const RuleDataListType* rules, const MatchRequest& matchRequest)
{
if (!rules)
return;
@@ -177,7 +177,7 @@
}
matched++;
- didMatchRule(ruleData, result, cascadeOrder, matchRequest);
+ didMatchRule(ruleData, result, matchRequest);
}
if (StyleResolver* resolver = m_context.element()->document().styleResolver()) {
@@ -187,7 +187,7 @@
}
}
-void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules)
+void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, bool matchingTreeBoundaryRules)
{
ASSERT(matchRequest.ruleSet);
ASSERT(m_context.element());
@@ -196,11 +196,11 @@
const AtomicString& pseudoId = element.shadowPseudoId();
if (!pseudoId.isEmpty()) {
ASSERT(element.isStyledElement());
- collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), matchRequest);
}
if (element.isVTTElement())
- collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), matchRequest);
// Check whether other types of rules are applicable in the current tree scope. Criteria for this:
// a) it's a UA rule
// b) the rules comes from a scoped style sheet within the same tree scope
@@ -213,23 +213,23 @@
// We need to collect the rules for id, class, tag, and everything else into a buffer and
// then sort the buffer.
if (element.hasID())
- collectMatchingRulesForList(matchRequest.ruleSet->idRules(element.idForStyleResolution()), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->idRules(element.idForStyleResolution()), matchRequest);
if (element.isStyledElement() && element.hasClass()) {
for (size_t i = 0; i < element.classNames().size(); ++i)
- collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), matchRequest);
}
if (element.isLink())
- collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest);
if (SelectorChecker::matchesFocusPseudoClass(element))
- collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), cascadeOrder, matchRequest);
- collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localNameForSelectorMatching()), cascadeOrder, matchRequest);
- collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeOrder, matchRequest);
-}
-
-void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& matchRequest, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules)
-{
- collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), cascadeOrder, matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localNameForSelectorMatching()), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest);
+}
+
+void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& matchRequest, bool matchingTreeBoundaryRules)
+{
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), matchRequest);
}
template<class CSSRuleCollection>
@@ -295,7 +295,7 @@
}
}
-void ElementRuleCollector::didMatchRule(const RuleData& ruleData, const SelectorChecker::MatchResult& result, CascadeOrder cascadeOrder, const MatchRequest& matchRequest)
+void ElementRuleCollector::didMatchRule(const RuleData& ruleData, const SelectorChecker::MatchResult& result, const MatchRequest& matchRequest)
{
PseudoId dynamicPseudo = result.dynamicPseudo;
// If we're matching normal rules, set a pseudo bit if
@@ -313,7 +313,7 @@
if (m_style && ruleData.containsUncommonAttributeSelector())
m_style->setUnique();
- m_matchedRules.append(MatchedRule(&ruleData, result.specificity, cascadeOrder, matchRequest.styleSheetIndex, matchRequest.styleSheet));
+ m_matchedRules.append(MatchedRule(&ruleData, result.specificity, matchRequest.styleSheetIndex, matchRequest.styleSheet));
}
}
« no previous file with comments | « Source/core/css/ElementRuleCollector.h ('k') | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698