| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 range.consume(); | 271 range.consume(); |
| 272 colons++; | 272 colons++; |
| 273 } | 273 } |
| 274 | 274 |
| 275 const CSSParserToken& token = range.peek(); | 275 const CSSParserToken& token = range.peek(); |
| 276 if (token.type() != IdentToken && token.type() != FunctionToken) | 276 if (token.type() != IdentToken && token.type() != FunctionToken) |
| 277 return nullptr; | 277 return nullptr; |
| 278 | 278 |
| 279 OwnPtr<CSSParserSelector> selector = CSSParserSelector::create(); | 279 OwnPtr<CSSParserSelector> selector = CSSParserSelector::create(); |
| 280 selector->setMatch(colons == 1 ? CSSSelector::PseudoClass : CSSSelector::Pse
udoElement); | 280 selector->setMatch(colons == 1 ? CSSSelector::PseudoClass : CSSSelector::Pse
udoElement); |
| 281 selector->setValue(AtomicString(String(token.value()).lower())); | 281 String value = token.value(); |
| 282 selector->setValue(AtomicString(value.is8Bit() ? value.lower() : value)); |
| 282 | 283 |
| 283 if (token.type() == IdentToken) { | 284 if (token.type() == IdentToken) { |
| 284 range.consume(); | 285 range.consume(); |
| 285 if (selector->pseudoType() == CSSSelector::PseudoUnknown) | 286 if (selector->pseudoType() == CSSSelector::PseudoUnknown) |
| 286 return nullptr; | 287 return nullptr; |
| 287 return selector.release(); | 288 return selector.release(); |
| 288 } | 289 } |
| 289 | 290 |
| 290 CSSParserTokenRange block = range.consumeBlock(); | 291 CSSParserTokenRange block = range.consumeBlock(); |
| 291 block.consumeWhitespace(); | 292 block.consumeWhitespace(); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 context.useCounter()->count(feature); | 678 context.useCounter()->count(feature); |
| 678 if (current->relation() == CSSSelector::ShadowDeep) | 679 if (current->relation() == CSSSelector::ShadowDeep) |
| 679 context.useCounter()->count(UseCounter::CSSDeepCombinator); | 680 context.useCounter()->count(UseCounter::CSSDeepCombinator); |
| 680 if (current->selectorList()) | 681 if (current->selectorList()) |
| 681 recordSelectorStats(context, *current->selectorList()); | 682 recordSelectorStats(context, *current->selectorList()); |
| 682 } | 683 } |
| 683 } | 684 } |
| 684 } | 685 } |
| 685 | 686 |
| 686 } // namespace blink | 687 } // namespace blink |
| OLD | NEW |