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

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

Issue 201573003: Reset SelectorCheckingContext.elementStyle for :ancestor matching. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/ancestor-first-child-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 d108a2212a19d65c3c00954beb3308920912cb3c..68d0054c076d20e1d5e064a5dd1b3815ab1164f7 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -904,21 +904,23 @@ bool SelectorChecker::checkOne(const SelectorCheckingContext& context, const Sib
subContext.scope = shadowHost;
// Use NodeRenderingTraversal to traverse a composed ancestor list of a given element.
Element* nextElement = &element;
+ SelectorCheckingContext hostContext(subContext);
do {
MatchResult subResult;
- subContext.element = nextElement;
- if (match(subContext, siblingTraversalStrategy, &subResult) == SelectorMatches) {
+ hostContext.element = nextElement;
+ if (match(hostContext, siblingTraversalStrategy, &subResult) == SelectorMatches) {
matched = true;
// Consider div:host(div:host(div:host(div:host...))).
- maxSpecificity = std::max(maxSpecificity, subContext.selector->specificity() + subResult.specificity);
+ maxSpecificity = std::max(maxSpecificity, hostContext.selector->specificity() + subResult.specificity);
break;
}
- subContext.behaviorAtBoundary = DoesNotCrossBoundary;
- subContext.scope = 0;
+ hostContext.behaviorAtBoundary = DoesNotCrossBoundary;
+ hostContext.scope = 0;
if (selector.pseudoType() == CSSSelector::PseudoHost)
break;
+ hostContext.elementStyle = 0;
nextElement = NodeRenderingTraversal::parentElement(nextElement);
} while (nextElement);
}
« no previous file with comments | « LayoutTests/fast/dom/shadow/ancestor-first-child-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698