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

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

Issue 1224673002: Implement proposed shadow tree cascade order. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added documentation 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
Index: Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 72417408eb4f8990bd40edceca5e33a0ca0f3fa7..23150ca2aa99660be1cc8d54daa60e40b3fb6d7b 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -160,36 +160,44 @@ void ScopedStyleResolver::addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyfr
}
}
-void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& collector, bool includeEmptyRules, CascadeOrder cascadeOrder)
+void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& collector, bool includeEmptyRules)
{
ASSERT(!collector.scopeContainsLastMatchedElement());
collector.setScopeContainsLastMatchedElement(true);
for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
ASSERT(m_authorStyleSheets[i]->ownerNode());
MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet(), includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], i);
- collector.collectMatchingRules(matchRequest, cascadeOrder);
+ collector.collectMatchingRules(matchRequest);
}
collector.setScopeContainsLastMatchedElement(false);
}
-void ScopedStyleResolver::collectMatchingShadowHostRules(ElementRuleCollector& collector, bool includeEmptyRules, CascadeOrder cascadeOrder)
+void ScopedStyleResolver::collectMatchingShadowHostRules(ElementRuleCollector& collector, bool includeEmptyRules)
{
ASSERT(!collector.scopeContainsLastMatchedElement());
collector.setScopeContainsLastMatchedElement(true);
for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) {
ASSERT(m_authorStyleSheets[i]->ownerNode());
MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet(), includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], i);
- collector.collectMatchingShadowHostRules(matchRequest, cascadeOrder);
+ collector.collectMatchingShadowHostRules(matchRequest);
}
collector.setScopeContainsLastMatchedElement(false);
}
-void ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector& collector, bool includeEmptyRules, CascadeOrder cascadeOrder)
+void ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector& collector, bool includeEmptyRules)
{
+ if (!m_treeBoundaryCrossingRuleSet)
+ return;
+
+ ASSERT(!collector.scopeContainsLastMatchedElement());
+ collector.setScopeContainsLastMatchedElement(true);
+
for (const auto& rules : *m_treeBoundaryCrossingRuleSet) {
MatchRequest request(rules->m_ruleSet.get(), includeEmptyRules, &treeScope().rootNode(), rules->m_parentStyleSheet, rules->m_parentIndex);
- collector.collectMatchingRules(request, cascadeOrder, true);
+ collector.collectMatchingRules(request, true);
}
+
+ collector.setScopeContainsLastMatchedElement(false);
}
void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector)

Powered by Google App Engine
This is Rietveld 408576698