| Index: third_party/WebKit/Source/core/css/SelectorChecker.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
|
| index c5d4b4d515eda624e7418022b8cb6f4f8eaf742e..0140854f1df6e0361e066df07bc356014298b44a 100644
|
| --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
|
| +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
|
| @@ -104,7 +104,7 @@ static Element* parentElement(const SelectorChecker::SelectorCheckingContext& co
|
| // e.g. shadowRoot.querySelector(':host *'),
|
| // (a) context.element has the same treescope as context.scope, need to walk up to its shadow host.
|
| // (b) Otherwise, should not walk up from a shadow root to a shadow host.
|
| - if (context.scope && (context.scope == context.element->containingShadowRoot() || context.scope->treeScope() == context.element->treeScope()))
|
| + if (context.scope && (context.scope == context.element->containingShadowRoot() || context.scope->treeScopeOrDocument() == context.element->treeScopeOrDocument()))
|
| return context.element->parentOrShadowHostElement();
|
| return context.element->parentElement();
|
| }
|
| @@ -116,7 +116,7 @@ static const HTMLSlotElement* findSlotElementInScope(const SelectorChecker::Sele
|
|
|
| const HTMLSlotElement* slot = context.element->assignedSlot();
|
| while (slot) {
|
| - if (slot->treeScope() == context.scope->treeScope())
|
| + if (slot->treeScopeOrDocument() == context.scope->treeScopeOrDocument())
|
| return slot;
|
| slot = slot->assignedSlot();
|
| }
|
| @@ -129,7 +129,7 @@ static bool scopeContainsLastMatchedElement(const SelectorChecker::SelectorCheck
|
| if (!context.scope)
|
| return true;
|
|
|
| - if (context.scope->treeScope() == context.element->treeScope())
|
| + if (context.scope->treeScopeOrDocument() == context.element->treeScopeOrDocument())
|
| return true;
|
|
|
| // Because Blink treats a shadow host's TreeScope as a separate one from its descendent shadow roots,
|
| @@ -348,7 +348,7 @@ SelectorChecker::Match SelectorChecker::matchForRelation(const SelectorCheckingC
|
| if (!m_isUARule && !m_isQuerySelector && context.selector->getPseudoType() == CSSSelector::PseudoShadow)
|
| Deprecation::countDeprecation(context.element->document(), UseCounter::CSSSelectorPseudoShadow);
|
| // If we're in the same tree-scope as the scoping element, then following a shadow descendant combinator would escape that and thus the scope.
|
| - if (context.scope && context.scope->shadowHost() && context.scope->shadowHost()->treeScope() == context.element->treeScope())
|
| + if (context.scope && context.scope->shadowHost() && context.scope->shadowHost()->treeScopeOrDocument() == context.element->treeScopeOrDocument())
|
| return SelectorFailsCompletely;
|
|
|
| Element* shadowHost = context.element->shadowHost();
|
|
|