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

Unified Diff: Source/core/css/parser/CSSSelectorParser.cpp

Issue 1149913008: Compute the linkMatchType inside the CSSSelectorParser. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Do it inside consumeComplexSelector. Created 5 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 | « Source/core/css/parser/CSSParserValues.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSSelectorParser.cpp
diff --git a/Source/core/css/parser/CSSSelectorParser.cpp b/Source/core/css/parser/CSSSelectorParser.cpp
index 418544ee70e32a76acfff019803f5a167fe22114..ce97d983bf94dcff6d9853443ddf33ec720c5887 100644
--- a/Source/core/css/parser/CSSSelectorParser.cpp
+++ b/Source/core/css/parser/CSSSelectorParser.cpp
@@ -129,8 +129,11 @@ PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumeComplexSelector(CSSParse
return nullptr;
while (CSSSelector::Relation combinator = consumeCombinator(range)) {
OwnPtr<CSSParserSelector> nextSelector = consumeCompoundSelector(range);
- if (!nextSelector)
- return combinator == CSSSelector::Descendant ? selector.release() : nullptr;
+ if (!nextSelector) {
+ if (combinator != CSSSelector::Descendant)
+ return nullptr;
+ break;
+ }
CSSParserSelector* end = nextSelector.get();
while (end->tagHistory())
end = end->tagHistory();
@@ -142,6 +145,7 @@ PassOwnPtr<CSSParserSelector> CSSSelectorParser::consumeComplexSelector(CSSParse
selector = nextSelector.release();
}
+ selector->updateLinkMatchType();
return selector.release();
}
« no previous file with comments | « Source/core/css/parser/CSSParserValues.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698