Index: Source/core/css/resolver/StyleResolver.cpp |
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
index eeac97f337b6c49781d02cea35a2d1cbe7670d2f..bbcd70bf6335af3df04f58b5619e3dfd10b6b56e 100644 |
--- a/Source/core/css/resolver/StyleResolver.cpp |
+++ b/Source/core/css/resolver/StyleResolver.cpp |
@@ -374,11 +374,6 @@ StyleResolver::~StyleResolver() |
{ |
} |
-static inline bool applyAuthorStylesOf(const Element* element) |
-{ |
- return element->treeScope().applyAuthorStyles(); |
-} |
- |
void StyleResolver::matchAuthorRulesForShadowHost(Element* element, ElementRuleCollector& collector, bool includeEmptyRules, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolversInShadowTree) |
{ |
collector.clearMatchedRules(); |
@@ -386,16 +381,16 @@ void StyleResolver::matchAuthorRulesForShadowHost(Element* element, ElementRuleC |
CascadeScope cascadeScope = 0; |
CascadeOrder cascadeOrder = 0; |
- bool applyAuthorStyles = applyAuthorStylesOf(element); |
+ bool isInShadowTree = element->isInShadowTree(); |
for (int j = resolversInShadowTree.size() - 1; j >= 0; --j) |
- resolversInShadowTree.at(j)->collectMatchingAuthorRules(collector, includeEmptyRules, applyAuthorStyles, cascadeScope, cascadeOrder++); |
+ resolversInShadowTree.at(j)->collectMatchingAuthorRules(collector, includeEmptyRules, isInShadowTree, cascadeScope, cascadeOrder++); |
if (resolvers.isEmpty() || resolvers.first()->treeScope() != element->treeScope()) |
++cascadeScope; |
cascadeOrder += resolvers.size(); |
for (unsigned i = 0; i < resolvers.size(); ++i) |
- resolvers.at(i)->collectMatchingAuthorRules(collector, includeEmptyRules, applyAuthorStyles, cascadeScope++, --cascadeOrder); |
+ resolvers.at(i)->collectMatchingAuthorRules(collector, includeEmptyRules, isInShadowTree, cascadeScope++, --cascadeOrder); |
m_treeBoundaryCrossingRules.collectTreeBoundaryCrossingRules(element, collector, includeEmptyRules); |
collector.sortAndTransferMatchedRules(); |
@@ -406,9 +401,9 @@ void StyleResolver::matchAuthorRules(Element* element, ElementRuleCollector& col |
collector.clearMatchedRules(); |
collector.matchedResult().ranges.lastAuthorRule = collector.matchedResult().matchedProperties.size() - 1; |
- bool applyAuthorStyles = applyAuthorStylesOf(element); |
+ bool isInShadowTree = element->isInShadowTree(); |
if (document().styleEngine()->hasOnlyScopedResolverForDocument()) { |
- document().scopedStyleResolver()->collectMatchingAuthorRules(collector, includeEmptyRules, applyAuthorStyles, ignoreCascadeScope); |
+ document().scopedStyleResolver()->collectMatchingAuthorRules(collector, includeEmptyRules, isInShadowTree, ignoreCascadeScope); |
m_treeBoundaryCrossingRules.collectTreeBoundaryCrossingRules(element, collector, includeEmptyRules); |
collector.sortAndTransferMatchedRules(); |
return; |
@@ -432,7 +427,7 @@ void StyleResolver::matchAuthorRules(Element* element, ElementRuleCollector& col |
for (unsigned i = 0; i < resolvers.size(); ++i, --cascadeOrder) { |
ScopedStyleResolver* resolver = resolvers.at(i); |
// FIXME: Need to clarify how to treat style scoped. |
- resolver->collectMatchingAuthorRules(collector, includeEmptyRules, applyAuthorStyles, cascadeScope++, resolver->treeScope() == element->treeScope() && resolver->treeScope().rootNode().isShadowRoot() ? 0 : cascadeOrder); |
+ resolver->collectMatchingAuthorRules(collector, includeEmptyRules, isInShadowTree, cascadeScope++, resolver->treeScope() == element->treeScope() && resolver->treeScope().rootNode().isShadowRoot() ? 0 : cascadeOrder); |
} |
m_treeBoundaryCrossingRules.collectTreeBoundaryCrossingRules(element, collector, includeEmptyRules); |
@@ -1038,16 +1033,14 @@ void StyleResolver::collectScopedResolversForHostedShadowTrees(const Element* el |
void StyleResolver::styleTreeResolveScopedKeyframesRules(const Element* element, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers) |
{ |
- Document& document = element->document(); |
TreeScope& treeScope = element->treeScope(); |
- bool applyAuthorStyles = treeScope.applyAuthorStyles(); |
// Add resolvers for shadow roots hosted by the given element. |
collectScopedResolversForHostedShadowTrees(element, resolvers); |
// Add resolvers while walking up DOM tree from the given element. |
for (ScopedStyleResolver* scopedResolver = scopedResolverFor(element); scopedResolver; scopedResolver = scopedResolver->parent()) { |
- if (scopedResolver->treeScope() == treeScope || (applyAuthorStyles && scopedResolver->treeScope() == document)) |
+ if (scopedResolver->treeScope() == treeScope) |
resolvers.append(scopedResolver); |
} |
} |