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

Side by Side Diff: Source/core/css/parser/CSSSelectorParser.cpp

Issue 993713002: Fix template angle bracket syntax in CSS subdirs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
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 "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return; 44 return;
45 selectorList.append(selector.release()); 45 selectorList.append(selector.release());
46 } 46 }
47 47
48 if (!m_failedParsing) 48 if (!m_failedParsing)
49 output.adoptSelectorVector(selectorList); 49 output.adoptSelectorVector(selectorList);
50 } 50 }
51 51
52 void CSSSelectorParser::consumeCompoundSelectorList(CSSParserTokenRange& range, CSSSelectorList& output) 52 void CSSSelectorParser::consumeCompoundSelectorList(CSSParserTokenRange& range, CSSSelectorList& output)
53 { 53 {
54 Vector<OwnPtr<CSSParserSelector> > selectorList; 54 Vector<OwnPtr<CSSParserSelector>> selectorList;
55 OwnPtr<CSSParserSelector> selector = consumeCompoundSelector(range); 55 OwnPtr<CSSParserSelector> selector = consumeCompoundSelector(range);
56 range.consumeWhitespaceAndComments(); 56 range.consumeWhitespaceAndComments();
57 if (!selector) 57 if (!selector)
58 return; 58 return;
59 selectorList.append(selector.release()); 59 selectorList.append(selector.release());
60 while (!range.atEnd() && range.peek().type() == CommaToken) { 60 while (!range.atEnd() && range.peek().type() == CommaToken) {
61 // FIXME: This differs from the spec grammar: 61 // FIXME: This differs from the spec grammar:
62 // Spec: compound_selector S* [ COMMA S* compound_selector ]* S* 62 // Spec: compound_selector S* [ COMMA S* compound_selector ]* S*
63 // Impl: compound_selector S* [ COMMA S* compound_selector S* ]* 63 // Impl: compound_selector S* [ COMMA S* compound_selector S* ]*
64 range.consumeIncludingWhitespaceAndComments(); 64 range.consumeIncludingWhitespaceAndComments();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 selector->setSelectorList(adoptPtr(selectorList)); 305 selector->setSelectorList(adoptPtr(selectorList));
306 selector->pseudoType(); // FIXME: Do we need to force the pseudo type to be cached? 306 selector->pseudoType(); // FIXME: Do we need to force the pseudo type to be cached?
307 ASSERT(selector->pseudoType() != CSSSelector::PseudoUnknown); 307 ASSERT(selector->pseudoType() != CSSSelector::PseudoUnknown);
308 return selector.release(); 308 return selector.release();
309 } 309 }
310 310
311 if (colons == 1 && equalIgnoringCase(token.value(), "not")) { 311 if (colons == 1 && equalIgnoringCase(token.value(), "not")) {
312 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(block) ; 312 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(block) ;
313 if (!innerSelector || !innerSelector->isSimple() || !block.atEnd()) 313 if (!innerSelector || !innerSelector->isSimple() || !block.atEnd())
314 return nullptr; 314 return nullptr;
315 Vector<OwnPtr<CSSParserSelector> > selectorVector; 315 Vector<OwnPtr<CSSParserSelector>> selectorVector;
316 selectorVector.append(innerSelector.release()); 316 selectorVector.append(innerSelector.release());
317 selector->adoptSelectorVector(selectorVector); 317 selector->adoptSelectorVector(selectorVector);
318 return selector.release(); 318 return selector.release();
319 } 319 }
320 320
321 if (colons == 1 && equalIgnoringCase(token.value(), "lang")) { 321 if (colons == 1 && equalIgnoringCase(token.value(), "lang")) {
322 // FIXME: CSS Selectors Level 4 allows :lang(*-foo) 322 // FIXME: CSS Selectors Level 4 allows :lang(*-foo)
323 const CSSParserToken& ident = block.consumeIncludingWhitespaceAndComment s(); 323 const CSSParserToken& ident = block.consumeIncludingWhitespaceAndComment s();
324 if (ident.type() != IdentToken || !block.atEnd()) 324 if (ident.type() != IdentToken || !block.atEnd())
325 return nullptr; 325 return nullptr;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 } 608 }
609 if (specifiers->isContentPseudoElement()) { 609 if (specifiers->isContentPseudoElement()) {
610 specifiers->insertTagHistory(CSSSelector::SubSelector, newSpecifier, CSS Selector::SubSelector); 610 specifiers->insertTagHistory(CSSSelector::SubSelector, newSpecifier, CSS Selector::SubSelector);
611 return specifiers; 611 return specifiers;
612 } 612 }
613 specifiers->appendTagHistory(CSSSelector::SubSelector, newSpecifier); 613 specifiers->appendTagHistory(CSSSelector::SubSelector, newSpecifier);
614 return specifiers; 614 return specifiers;
615 } 615 }
616 616
617 } // namespace blink 617 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698