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

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 1885453002: Rename Node::treeScope() to Node::treeScopeOrDocument() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 8 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: 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();

Powered by Google App Engine
This is Rietveld 408576698