| Index: sky/engine/core/css/ElementRuleCollector.cpp
|
| diff --git a/sky/engine/core/css/ElementRuleCollector.cpp b/sky/engine/core/css/ElementRuleCollector.cpp
|
| index b9fd6dbec387fbe76df572b84e3936cb925d94b4..9df4ab7c35eed9da92cbf6bd57092a47d33bd87e 100644
|
| --- a/sky/engine/core/css/ElementRuleCollector.cpp
|
| +++ b/sky/engine/core/css/ElementRuleCollector.cpp
|
| @@ -43,7 +43,6 @@ ElementRuleCollector::ElementRuleCollector(const ElementResolveContext& context,
|
| RenderStyle* style)
|
| : m_context(context)
|
| , m_style(style)
|
| - , m_matchingUARules(false)
|
| { }
|
|
|
| ElementRuleCollector::~ElementRuleCollector()
|
| @@ -81,14 +80,6 @@ void ElementRuleCollector::addElementStyleProperties(const StylePropertySet* pro
|
| m_result.isCacheable = false;
|
| }
|
|
|
| -static bool rulesApplicableInCurrentTreeScope(const Element* element, const ContainerNode* scopingNode)
|
| -{
|
| - TreeScope& treeScope = element->treeScope();
|
| - return !scopingNode ||
|
| - treeScope == scopingNode->treeScope() ||
|
| - SelectorChecker::isHostInItsShadowTree(*element, scopingNode);
|
| -}
|
| -
|
| void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeOrder cascadeOrder)
|
| {
|
| ASSERT(matchRequest.ruleSet);
|
| @@ -96,9 +87,6 @@ void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest
|
|
|
| Element& element = *m_context.element();
|
|
|
| - if (!m_matchingUARules && !rulesApplicableInCurrentTreeScope(&element, matchRequest.scope))
|
| - return;
|
| -
|
| // We need to collect the rules for id, class, tag, and everything else into a buffer and
|
| // then sort the buffer.
|
| if (element.hasID())
|
| @@ -112,6 +100,11 @@ void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest
|
| collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), cascadeOrder, matchRequest, ruleRange);
|
| }
|
|
|
| +void ElementRuleCollector::collectMatchingHostRules(const MatchRequest& matchRequest, RuleRange& ruleRange, CascadeOrder cascadeOrder)
|
| +{
|
| + collectMatchingRulesForList(matchRequest.ruleSet->hostRules(), cascadeOrder, matchRequest, ruleRange);
|
| +}
|
| +
|
| void ElementRuleCollector::sortAndTransferMatchedRules()
|
| {
|
| if (!m_matchedRules || m_matchedRules->isEmpty())
|
| @@ -128,10 +121,10 @@ void ElementRuleCollector::sortAndTransferMatchedRules()
|
| }
|
| }
|
|
|
| -inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const ContainerNode* scope)
|
| +inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData)
|
| {
|
| SelectorChecker checker(*m_context.element());
|
| - if (checker.match(ruleData.selector(), scope)) {
|
| + if (checker.match(ruleData.selector())) {
|
| if (checker.matchedAttributeSelector())
|
| m_style->setUnique();
|
| if (checker.matchedFocusSelector())
|
| @@ -148,7 +141,7 @@ inline bool ElementRuleCollector::ruleMatches(const RuleData& ruleData, const Co
|
| void ElementRuleCollector::collectRuleIfMatches(const RuleData& ruleData, CascadeOrder cascadeOrder, const MatchRequest& matchRequest, RuleRange& ruleRange)
|
| {
|
| StyleRule* rule = ruleData.rule();
|
| - if (ruleMatches(ruleData, matchRequest.scope)) {
|
| + if (ruleMatches(ruleData)) {
|
| // If the rule has no properties to apply, then ignore it in the non-debug mode.
|
| const StylePropertySet& properties = rule->properties();
|
| if (properties.isEmpty())
|
|
|