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

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

Issue 1626563002: Match 'i' attribute selector modifier case-insensitively (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop valueEqualsIgnoringCase Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/attribute-selector-case-insensitive.html ('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 "core/css/parser/CSSSelectorParser.h" 5 #include "core/css/parser/CSSSelectorParser.h"
6 6
7 #include "core/css/CSSSelectorList.h" 7 #include "core/css/CSSSelectorList.h"
8 #include "core/css/StyleSheetContents.h" 8 #include "core/css/StyleSheetContents.h"
9 #include "core/frame/UseCounter.h" 9 #include "core/frame/UseCounter.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 m_failedParsing = true; 601 m_failedParsing = true;
602 return CSSSelector::AttributeExact; 602 return CSSSelector::AttributeExact;
603 } 603 }
604 } 604 }
605 605
606 CSSSelector::AttributeMatchType CSSSelectorParser::consumeAttributeFlags(CSSPars erTokenRange& range) 606 CSSSelector::AttributeMatchType CSSSelectorParser::consumeAttributeFlags(CSSPars erTokenRange& range)
607 { 607 {
608 if (range.peek().type() != IdentToken) 608 if (range.peek().type() != IdentToken)
609 return CSSSelector::CaseSensitive; 609 return CSSSelector::CaseSensitive;
610 const CSSParserToken& flag = range.consumeIncludingWhitespace(); 610 const CSSParserToken& flag = range.consumeIncludingWhitespace();
611 if (String(flag.value()) == "i") 611 if (flag.valueEqualsIgnoringCase("i"))
612 return CSSSelector::CaseInsensitive; 612 return CSSSelector::CaseInsensitive;
613 m_failedParsing = true; 613 m_failedParsing = true;
614 return CSSSelector::CaseSensitive; 614 return CSSSelector::CaseSensitive;
615 } 615 }
616 616
617 bool CSSSelectorParser::consumeANPlusB(CSSParserTokenRange& range, std::pair<int , int>& result) 617 bool CSSSelectorParser::consumeANPlusB(CSSParserTokenRange& range, std::pair<int , int>& result)
618 { 618 {
619 const CSSParserToken& token = range.consume(); 619 const CSSParserToken& token = range.consume();
620 if (token.type() == NumberToken && token.numericValueType() == IntegerValueT ype) { 620 if (token.type() == NumberToken && token.numericValueType() == IntegerValueT ype) {
621 result = std::make_pair(0, static_cast<int>(token.numericValue())); 621 result = std::make_pair(0, static_cast<int>(token.numericValue()));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 if (!splitAfter || !splitAfter->tagHistory()) 764 if (!splitAfter || !splitAfter->tagHistory())
765 return compoundSelector; 765 return compoundSelector;
766 766
767 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); 767 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory();
768 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector ::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS elector); 768 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector ::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS elector);
769 return secondCompound.release(); 769 return secondCompound.release();
770 } 770 }
771 771
772 } // namespace blink 772 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/attribute-selector-case-insensitive.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698