Index: Source/core/css/ElementRuleCollector.cpp |
diff --git a/Source/core/css/ElementRuleCollector.cpp b/Source/core/css/ElementRuleCollector.cpp |
index ed245341ee8f55b0216a8778fc6ba3333af4da53..02eda6c8cd8337ab377793b835fc2c20fa4bda26 100644 |
--- a/Source/core/css/ElementRuleCollector.cpp |
+++ b/Source/core/css/ElementRuleCollector.cpp |
@@ -79,9 +79,9 @@ PassRefPtrWillBeRawPtr<CSSRuleList> ElementRuleCollector::matchedCSSRuleList() |
return m_cssRuleList.release(); |
} |
-inline void ElementRuleCollector::addMatchedRule(const RuleData* rule, unsigned specificity, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet) |
+inline void ElementRuleCollector::addMatchedRule(const RuleData* rule, unsigned specificity, CascadeOrder cascadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet) |
{ |
- m_matchedRules.append(MatchedRule(rule, specificity, cascadeScope, cascadeOrder, styleSheetIndex, parentStyleSheet)); |
+ m_matchedRules.append(MatchedRule(rule, specificity, cascadeOrder, styleSheetIndex, parentStyleSheet)); |
} |
void ElementRuleCollector::clearMatchedRules() |
@@ -130,7 +130,7 @@ static bool rulesApplicableInCurrentTreeScope(const Element* element, const Cont |
return false; |
} |
-void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeScope cascadeScope, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules) |
+void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules) |
{ |
ASSERT(matchRequest.ruleSet); |
ASSERT(m_context.element()); |
@@ -139,11 +139,11 @@ void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest |
const AtomicString& pseudoId = element.shadowPseudoId(); |
if (!pseudoId.isEmpty()) { |
ASSERT(element.isStyledElement()); |
- collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), ignoreCascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId), cascadeOrder, matchRequest, ruleRange); |
} |
if (element.isVTTElement()) |
- collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), cascadeOrder, matchRequest, ruleRange); |
// 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 |
@@ -156,23 +156,23 @@ void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest |
// 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()), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->idRules(element.idForStyleResolution()), cascadeOrder, matchRequest, ruleRange); |
if (element.isStyledElement() && element.hasClass()) { |
for (size_t i = 0; i < element.classNames().size(); ++i) |
- collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->classRules(element.classNames()[i]), cascadeOrder, matchRequest, ruleRange); |
} |
if (element.isLink()) |
- collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), cascadeOrder, matchRequest, ruleRange); |
if (SelectorChecker::matchesFocusPseudoClass(element)) |
- collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
- collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localName()), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
- collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->tagRules(element.localName()), cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeOrder, matchRequest, ruleRange); |
} |
-void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeScope cascadeScope, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules) |
+void ElementRuleCollector::collectMatchingShadowHostRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeOrder cascadeOrder, bool matchingTreeBoundaryRules) |
{ |
- collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), cascadeScope, cascadeOrder, matchRequest, ruleRange); |
+ collectMatchingRulesForList(matchRequest.ruleSet->shadowHostRules(), cascadeOrder, matchRequest, ruleRange); |
} |
CSSRuleList* ElementRuleCollector::nestedRuleList(CSSRule* rule) |
@@ -274,7 +274,7 @@ inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const Co |
return true; |
} |
-void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, CascadeScope cascadeScope, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange) |
+void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange) |
{ |
if (m_canUseFastReject && m_selectorFilter.fastRejectSelector<RuleData::maximumIdentifierCount>(ruleData.descendantSelectorIdentifierHashes())) |
return; |
@@ -309,7 +309,7 @@ void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, Cascad |
ruleRange.firstRuleIndex = ruleRange.lastRuleIndex; |
// Add this rule to our list of matched rules. |
- addMatchedRule(&ruleData, result.specificity, cascadeScope, cascadeOrder, matchRequest.styleSheetIndex, matchRequest.styleSheet); |
+ addMatchedRule(&ruleData, result.specificity, cascadeOrder, matchRequest.styleSheetIndex, matchRequest.styleSheet); |
return; |
} |
} |
@@ -317,9 +317,6 @@ void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, Cascad |
static inline bool compareRules(const MatchedRule& matchedRule1, const MatchedRule& matchedRule2) |
{ |
- if (matchedRule1.cascadeScope() != matchedRule2.cascadeScope()) |
- return matchedRule1.cascadeScope() > matchedRule2.cascadeScope(); |
- |
unsigned specificity1 = matchedRule1.specificity(); |
unsigned specificity2 = matchedRule2.specificity(); |
if (specificity1 != specificity2) |
@@ -343,7 +340,6 @@ bool ElementRuleCollector::hasAnyMatchingRules(RuleSet* ruleSet) |
// information about "scope". |
int firstRuleIndex = -1, lastRuleIndex = -1; |
RuleRange ruleRange(firstRuleIndex, lastRuleIndex); |
- // FIXME: Verify whether it's ok to ignore CascadeScope here. |
collectMatchingRules(MatchRequest(ruleSet), ruleRange); |
return !m_matchedRules.isEmpty(); |