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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 m_failedParsing = true; | 460 m_failedParsing = true; |
461 return CSSSelector::AttributeExact; | 461 return CSSSelector::AttributeExact; |
462 } | 462 } |
463 } | 463 } |
464 | 464 |
465 CSSSelector::AttributeMatchType CSSSelectorParser::consumeAttributeFlags(CSSPars
erTokenRange& range) | 465 CSSSelector::AttributeMatchType CSSSelectorParser::consumeAttributeFlags(CSSPars
erTokenRange& range) |
466 { | 466 { |
467 if (range.peek().type() != IdentToken) | 467 if (range.peek().type() != IdentToken) |
468 return CSSSelector::CaseSensitive; | 468 return CSSSelector::CaseSensitive; |
469 const CSSParserToken& flag = range.consumeIncludingWhitespace(); | 469 const CSSParserToken& flag = range.consumeIncludingWhitespace(); |
470 if (String(flag.value()) == "i") { | 470 if (String(flag.value()) == "i") |
471 if (RuntimeEnabledFeatures::cssAttributeCaseSensitivityEnabled() || isUA
SheetBehavior(m_context.mode())) | 471 return CSSSelector::CaseInsensitive; |
472 return CSSSelector::CaseInsensitive; | |
473 } | |
474 m_failedParsing = true; | 472 m_failedParsing = true; |
475 return CSSSelector::CaseSensitive; | 473 return CSSSelector::CaseSensitive; |
476 } | 474 } |
477 | 475 |
478 bool CSSSelectorParser::consumeANPlusB(CSSParserTokenRange& range, std::pair<int
, int>& result) | 476 bool CSSSelectorParser::consumeANPlusB(CSSParserTokenRange& range, std::pair<int
, int>& result) |
479 { | 477 { |
480 const CSSParserToken& token = range.consume(); | 478 const CSSParserToken& token = range.consume(); |
481 if (token.type() == NumberToken && token.numericValueType() == IntegerValueT
ype) { | 479 if (token.type() == NumberToken && token.numericValueType() == IntegerValueT
ype) { |
482 result = std::make_pair(0, static_cast<int>(token.numericValue())); | 480 result = std::make_pair(0, static_cast<int>(token.numericValue())); |
483 return true; | 481 return true; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 compoundSelector->insertTagHistory(CSSSelector::SubSelector, simpleSelec
tor, relation); | 678 compoundSelector->insertTagHistory(CSSSelector::SubSelector, simpleSelec
tor, relation); |
681 return compoundSelector; | 679 return compoundSelector; |
682 } | 680 } |
683 | 681 |
684 // All other simple selectors are added to the end of the compound. | 682 // All other simple selectors are added to the end of the compound. |
685 compoundSelector->appendTagHistory(CSSSelector::SubSelector, simpleSelector)
; | 683 compoundSelector->appendTagHistory(CSSSelector::SubSelector, simpleSelector)
; |
686 return compoundSelector; | 684 return compoundSelector; |
687 } | 685 } |
688 | 686 |
689 } // namespace blink | 687 } // namespace blink |
OLD | NEW |