Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |