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

Side by Side 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: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/parser/CSSParserValues.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSSelectorParser.h" 6 #include "core/css/parser/CSSSelectorParser.h"
7 7
8 #include "core/css/CSSSelectorList.h" 8 #include "core/css/CSSSelectorList.h"
9 #include "core/css/StyleSheetContents.h" 9 #include "core/css/StyleSheetContents.h"
10 #include "core/frame/UseCounter.h" 10 #include "core/frame/UseCounter.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Vector<OwnPtr<CSSParserSelector>> selectorList; 84 Vector<OwnPtr<CSSParserSelector>> selectorList;
85 OwnPtr<CSSParserSelector> selector = consumeComplexSelector(range); 85 OwnPtr<CSSParserSelector> selector = consumeComplexSelector(range);
86 if (!selector) 86 if (!selector)
87 return; 87 return;
88 selectorList.append(selector.release()); 88 selectorList.append(selector.release());
89 while (!range.atEnd() && range.peek().type() == CommaToken) { 89 while (!range.atEnd() && range.peek().type() == CommaToken) {
90 range.consumeIncludingWhitespace(); 90 range.consumeIncludingWhitespace();
91 selector = consumeComplexSelector(range); 91 selector = consumeComplexSelector(range);
92 if (!selector) 92 if (!selector)
93 return; 93 return;
94 selector->updateLinkMatchType();
Timothy Loh 2015/06/02 04:20:58 Probably better to be in consumeComplexSelector?
94 selectorList.append(selector.release()); 95 selectorList.append(selector.release());
95 } 96 }
96 97
97 if (!m_failedParsing) 98 if (!m_failedParsing)
98 output.adoptSelectorVector(selectorList); 99 output.adoptSelectorVector(selectorList);
99 } 100 }
100 101
101 void CSSSelectorParser::consumeCompoundSelectorList(CSSParserTokenRange& range, CSSSelectorList& output) 102 void CSSSelectorParser::consumeCompoundSelectorList(CSSParserTokenRange& range, CSSSelectorList& output)
102 { 103 {
103 Vector<OwnPtr<CSSParserSelector>> selectorList; 104 Vector<OwnPtr<CSSParserSelector>> selectorList;
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 compoundSelector->insertTagHistory(CSSSelector::SubSelector, simpleSelec tor, relation); 663 compoundSelector->insertTagHistory(CSSSelector::SubSelector, simpleSelec tor, relation);
663 return compoundSelector; 664 return compoundSelector;
664 } 665 }
665 666
666 // All other simple selectors are added to the end of the compound. 667 // All other simple selectors are added to the end of the compound.
667 compoundSelector->appendTagHistory(CSSSelector::SubSelector, simpleSelector) ; 668 compoundSelector->appendTagHistory(CSSSelector::SubSelector, simpleSelector) ;
668 return compoundSelector; 669 return compoundSelector;
669 } 670 }
670 671
671 } // namespace blink 672 } // namespace blink
OLDNEW
« 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