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

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

Issue 1519833002: Ship Case-insensitive attribute selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop feature. Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698