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

Unified Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 334263020: Refactor SelectorChecker::BehaviorAtBoundary (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
Index: Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 7aea947d29f22752782d2655c7e800600e2611e4..22a68cfaf0b4c007ff977deb20dd9b7d15fc68c7 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -115,18 +115,15 @@ void ScopedStyleResolver::addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyfr
void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& collector, bool includeEmptyRules, bool applyAuthorStyles, CascadeScope cascadeScope, CascadeOrder cascadeOrder)
{
const ContainerNode* scopingNode = &m_scopingNode;
- unsigned behaviorAtBoundary = SelectorChecker::DoesNotCrossBoundary;
+ unsigned contextFlags = SelectorChecker::DefaultBehavior;
if (!applyAuthorStyles)
- behaviorAtBoundary |= SelectorChecker::ScopeContainsLastMatchedElement;
-
- if (m_scopingNode.isShadowRoot())
- behaviorAtBoundary |= SelectorChecker::ScopeIsShadowRoot;
+ contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement;
RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet(), includeEmptyRules, scopingNode, m_authorStyleSheets[i], applyAuthorStyles, i);
- collector.collectMatchingRules(matchRequest, ruleRange, static_cast<SelectorChecker::BehaviorAtBoundary>(behaviorAtBoundary), cascadeScope, cascadeOrder);
+ collector.collectMatchingRules(matchRequest, ruleRange, static_cast<SelectorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder);
}
}

Powered by Google App Engine
This is Rietveld 408576698