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

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

Issue 1331573002: Revert 201092 "Reland of moved unused CascadeOrder. (patchset #1..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 years, 3 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 | « trunk/Source/core/css/ElementRuleCollector.h ('k') | trunk/Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/css/ElementRuleCollector.cpp
===================================================================
--- trunk/Source/core/css/ElementRuleCollector.cpp (revision 201870)
+++ trunk/Source/core/css/ElementRuleCollector.cpp (working copy)
@@ -129,7 +129,7 @@
}
template<typename RuleDataListType>
-void ElementRuleCollector::collectMatchingRulesForList(const RuleDataListType* rules, const MatchRequest& matchRequest)
+void ElementRuleCollector::collectMatchingRulesForList(const RuleDataListType* rules, CascadeOrder cascadeOrder, const MatchRequest& matchRequest)
{
if (!rules)
return;
@@ -177,7 +177,7 @@
}
matched++;
- didMatchRule(ruleData, result, matchRequest);
+ didMatchRule(ruleData, result, cascadeOrder, matchRequest);
}
if (StyleResolver* resolver = m_context.element()->document().styleResolver()) {
@@ -187,7 +187,7 @@
}
}
-void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, bool matchingTreeBoundaryRules)
+void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, CascadeOrder cascadeOrder, 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), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), cascadeOrder, matchRequest);
}
if (element.isVTTElement())
- collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), cascadeOrder, 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()), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->idRules(element.idForStyleResolution()), cascadeOrder, matchRequest);
if (element.isStyledElement() && element.hasClass()) {
for (size_t i = 0; i < element.classNames().size(); ++i)
- collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), cascadeOrder, matchRequest);
}
if (element.isLink())
- collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), cascadeOrder, matchRequest);
if (SelectorChecker::matchesFocusPseudoClass(element))
- collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest);
- collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localNameForSelectorMatching()), matchRequest);
- collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest);
+ 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, bool matchingTreeBoundaryRules)
+void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& matchRequest, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules)
{
- collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), matchRequest);
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), cascadeOrder, matchRequest);
}
template<class CSSRuleCollection>
@@ -295,7 +295,7 @@
}
}
-void ElementRuleCollector::didMatchRule(const RuleData& ruleData, const SelectorChecker::MatchResult& result, const MatchRequest& matchRequest)
+void ElementRuleCollector::didMatchRule(const RuleData& ruleData, const SelectorChecker::MatchResult& result, CascadeOrder cascadeOrder, 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, matchRequest.styleSheetIndex, matchRequest.styleSheet));
+ m_matchedRules.append(MatchedRule(&ruleData, result.specificity, cascadeOrder, matchRequest.styleSheetIndex, matchRequest.styleSheet));
}
}
« no previous file with comments | « trunk/Source/core/css/ElementRuleCollector.h ('k') | trunk/Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698