| Index: Source/core/css/resolver/ScopedStyleResolver.cpp
|
| diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| index 0b84c3a1d12cf448ad8fdb4eac51cd0c4d033e66..e64a1c1e5dad177cd470d821f206c0761df7e1c0 100644
|
| --- a/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| +++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
|
| @@ -46,6 +46,12 @@
|
|
|
| namespace blink {
|
|
|
| +ScopedStyleResolver::~ScopedStyleResolver()
|
| +{
|
| + if (m_treeBoundaryCrossingRuleSet)
|
| + treeScope().document().styleEngine().removeTreeBoundaryCrossingScope();
|
| +}
|
| +
|
| TreeScope* ScopedStyleResolver::treeScopeFor(Document& document, const CSSStyleSheet* sheet)
|
| {
|
| ASSERT(sheet);
|
| @@ -131,6 +137,7 @@ void ScopedStyleResolver::resetAuthorStyle()
|
| m_authorStyleSheets.clear();
|
| m_keyframesRuleMap.clear();
|
| m_treeBoundaryCrossingRuleSet = nullptr;
|
| + treeScope().document().styleEngine().removeTreeBoundaryCrossingScope();
|
| }
|
|
|
| StyleRuleKeyframes* ScopedStyleResolver::keyframeStylesForAnimation(const StringImpl* animationName)
|
| @@ -188,11 +195,19 @@ void ScopedStyleResolver::collectMatchingShadowHostRules(ElementRuleCollector& c
|
|
|
| void ScopedStyleResolver::collectMatchingTreeBoundaryCrossingRules(ElementRuleCollector& collector, bool includeEmptyRules, CascadeOrder cascadeOrder)
|
| {
|
| + if (!m_treeBoundaryCrossingRuleSet)
|
| + return;
|
| +
|
| + ASSERT(!collector.scopeContainsLastMatchedElement());
|
| + collector.setScopeContainsLastMatchedElement(true);
|
| +
|
| RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange();
|
| for (const auto& rules : *m_treeBoundaryCrossingRuleSet) {
|
| MatchRequest request(rules->m_ruleSet.get(), includeEmptyRules, &treeScope().rootNode(), rules->m_parentStyleSheet, rules->m_parentIndex);
|
| collector.collectMatchingRules(request, ruleRange, cascadeOrder, true);
|
| }
|
| +
|
| + collector.setScopeContainsLastMatchedElement(false);
|
| }
|
|
|
| void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector)
|
| @@ -243,7 +258,7 @@ void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRule
|
|
|
| if (!m_treeBoundaryCrossingRuleSet) {
|
| m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRuleSubSet());
|
| - treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(treeScope().rootNode());
|
| + treeScope().document().styleEngine().addTreeBoundaryCrossingScope();
|
| }
|
|
|
| m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, sheetIndex, ruleSetForScope.release()));
|
|
|