| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 return nullptr; | 302 return nullptr; |
| 303 | 303 |
| 304 selector->setSelectorList(adoptPtr(selectorList)); | 304 selector->setSelectorList(adoptPtr(selectorList)); |
| 305 selector->pseudoType(); // FIXME: Do we need to force the pseudo type to
be cached? | 305 selector->pseudoType(); // FIXME: Do we need to force the pseudo type to
be cached? |
| 306 ASSERT(selector->pseudoType() != CSSSelector::PseudoUnknown); | 306 ASSERT(selector->pseudoType() != CSSSelector::PseudoUnknown); |
| 307 return selector.release(); | 307 return selector.release(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 if (colons == 1 && token.valueEqualsIgnoringCase("not")) { | 310 if (colons == 1 && token.valueEqualsIgnoringCase("not")) { |
| 311 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(block)
; | 311 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(block)
; |
| 312 block.consumeWhitespace(); |
| 312 if (!innerSelector || !innerSelector->isSimple() || !block.atEnd()) | 313 if (!innerSelector || !innerSelector->isSimple() || !block.atEnd()) |
| 313 return nullptr; | 314 return nullptr; |
| 314 Vector<OwnPtr<CSSParserSelector>> selectorVector; | 315 Vector<OwnPtr<CSSParserSelector>> selectorVector; |
| 315 selectorVector.append(innerSelector.release()); | 316 selectorVector.append(innerSelector.release()); |
| 316 selector->adoptSelectorVector(selectorVector); | 317 selector->adoptSelectorVector(selectorVector); |
| 317 return selector.release(); | 318 return selector.release(); |
| 318 } | 319 } |
| 319 | 320 |
| 320 if (colons == 1 && token.valueEqualsIgnoringCase("lang")) { | 321 if (colons == 1 && token.valueEqualsIgnoringCase("lang")) { |
| 321 // FIXME: CSS Selectors Level 4 allows :lang(*-foo) | 322 // FIXME: CSS Selectors Level 4 allows :lang(*-foo) |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 context.useCounter()->count(feature); | 677 context.useCounter()->count(feature); |
| 677 if (current->relation() == CSSSelector::ShadowDeep) | 678 if (current->relation() == CSSSelector::ShadowDeep) |
| 678 context.useCounter()->count(UseCounter::CSSDeepCombinator); | 679 context.useCounter()->count(UseCounter::CSSDeepCombinator); |
| 679 if (current->selectorList()) | 680 if (current->selectorList()) |
| 680 recordSelectorStats(context, *current->selectorList()); | 681 recordSelectorStats(context, *current->selectorList()); |
| 681 } | 682 } |
| 682 } | 683 } |
| 683 } | 684 } |
| 684 | 685 |
| 685 } // namespace blink | 686 } // namespace blink |
| OLD | NEW |