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

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

Issue 2327743002: Rename Node::shadowHost() to Node::ownerShadowHost() (Closed)
Patch Set: fix Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c85fc1ec1f5a9142ca0c7e7de10350f4bf413d39..a465fc89ec02e531c3f541c69d4e9963803bc578 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -136,13 +136,13 @@ static bool scopeContainsLastMatchedElement(const SelectorChecker::SelectorCheck
// Because Blink treats a shadow host's TreeScope as a separate one from its descendent shadow roots,
// if the last matched element is a shadow host, the condition above isn't met, even though it
// should be.
- return context.element == context.scope->shadowHost() && (!context.previousElement || context.previousElement->isInDescendantTreeOf(context.element));
+ return context.element == context.scope->ownerShadowHost() && (!context.previousElement || context.previousElement->isInDescendantTreeOf(context.element));
}
static inline bool nextSelectorExceedsScope(const SelectorChecker::SelectorCheckingContext& context)
{
if (context.scope && context.scope->isInShadowTree())
- return context.element == context.scope->shadowHost();
+ return context.element == context.scope->ownerShadowHost();
return false;
}
@@ -357,10 +357,10 @@ 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->ownerShadowHost() && context.scope->ownerShadowHost()->treeScope() == context.element->treeScope())
return SelectorFailsCompletely;
- Element* shadowHost = context.element->shadowHost();
+ Element* shadowHost = context.element->ownerShadowHost();
if (!shadowHost)
return SelectorFailsCompletely;
nextContext.element = shadowHost;
@@ -585,7 +585,7 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, MatchResu
const CSSSelector& selector = *context.selector;
// Only :host and :host-context() should match the host: http://drafts.csswg.org/css-scoping/#host-element
- if (context.scope && context.scope->shadowHost() == element && (!selector.isHostPseudoClass()
+ if (context.scope && context.scope->ownerShadowHost() == element && (!selector.isHostPseudoClass()
&& !context.treatShadowHostAsNormalScope
&& selector.match() != CSSSelector::PseudoElement))
return false;
@@ -1065,7 +1065,7 @@ bool SelectorChecker::checkPseudoHost(const SelectorCheckingContext& context, Ma
// :host only matches a shadow host when :host is in a shadow tree of the shadow host.
if (!context.scope)
return false;
- const ContainerNode* shadowHost = context.scope->shadowHost();
+ const ContainerNode* shadowHost = context.scope->ownerShadowHost();
if (!shadowHost || shadowHost != element)
return false;
ASSERT(element.shadow());
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698