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 "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 Loading... | |
| 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.valueEqualsIgnoringASCIICase("i")) |
|
rune
2016/01/22 21:48:01
Briefly looking through the relevant specs, it see
fs
2016/01/22 23:53:17
I was hoping we could. I was planning on doing tha
rune
2016/01/24 10:46:26
In another context I was trying to find out if we
fs
2016/01/25 09:47:19
If you look at the TC I added, you'll see one exam
rune
2016/01/25 10:15:29
I ran your new cases locally, and those test pass
fs
2016/01/25 11:30:31
Ok, so looks like it pans out fine in these cases,
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |