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

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

Issue 273523008: SelectorChecker::parentElement should walk up to ShadowHost only if an element is in a shadow tree … (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « LayoutTests/fast/dom/shadow/style-with-hat-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index eff32607837754fcff7e2bca5a3902e7eff25b5e..cc023da531c544ca9e7c6c5304e925a22c7c647a 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -84,7 +84,7 @@ Element* SelectorChecker::parentElement(const SelectorCheckingContext& context,
return context.element->parentOrShadowHostElement();
// If context.scope is a shadow host, we should walk up from a shadow root to its shadow host.
- if (context.behaviorAtBoundary & SelectorChecker::ScopeIsShadowHost)
+ if ((context.behaviorAtBoundary & SelectorChecker::ScopeIsShadowHost) && context.scope == context.element->shadowHost())
return context.element->parentOrShadowHostElement();
if ((context.behaviorAtBoundary & SelectorChecker::BoundaryBehaviorMask) != SelectorChecker::StaysWithinTreeScope)
« no previous file with comments | « LayoutTests/fast/dom/shadow/style-with-hat-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698