| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(bl
ock); | 519 OwnPtr<CSSParserSelector> innerSelector = consumeCompoundSelector(bl
ock); |
| 520 block.consumeWhitespace(); | 520 block.consumeWhitespace(); |
| 521 if (!innerSelector || !block.atEnd() || !RuntimeEnabledFeatures::sha
dowDOMV1Enabled()) | 521 if (!innerSelector || !block.atEnd() || !RuntimeEnabledFeatures::sha
dowDOMV1Enabled()) |
| 522 return nullptr; | 522 return nullptr; |
| 523 Vector<OwnPtr<CSSParserSelector>> selectorVector; | 523 Vector<OwnPtr<CSSParserSelector>> selectorVector; |
| 524 selectorVector.append(innerSelector.release()); | 524 selectorVector.append(innerSelector.release()); |
| 525 selector->adoptSelectorVector(selectorVector); | 525 selector->adoptSelectorVector(selectorVector); |
| 526 return selector.release(); | 526 return selector.release(); |
| 527 } | 527 } |
| 528 case CSSSelector::PseudoDir: |
| 528 case CSSSelector::PseudoLang: | 529 case CSSSelector::PseudoLang: |
| 529 { | 530 { |
| 530 // FIXME: CSS Selectors Level 4 allows :lang(*-foo) | 531 // FIXME: CSS Selectors Level 4 allows :lang("foo") |
| 531 const CSSParserToken& ident = block.consumeIncludingWhitespace(); | 532 const CSSParserToken& ident = block.consumeIncludingWhitespace(); |
| 532 if (ident.type() != IdentToken || !block.atEnd()) | 533 if (ident.type() != IdentToken || !block.atEnd()) |
| 533 return nullptr; | 534 return nullptr; |
| 534 selector->setArgument(ident.value()); | 535 selector->setArgument(ident.value()); |
| 535 return selector.release(); | 536 return selector.release(); |
| 536 } | 537 } |
| 537 case CSSSelector::PseudoNthChild: | 538 case CSSSelector::PseudoNthChild: |
| 538 case CSSSelector::PseudoNthLastChild: | 539 case CSSSelector::PseudoNthLastChild: |
| 539 case CSSSelector::PseudoNthOfType: | 540 case CSSSelector::PseudoNthOfType: |
| 540 case CSSSelector::PseudoNthLastOfType: | 541 case CSSSelector::PseudoNthLastOfType: |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 784 |
| 784 if (!splitAfter || !splitAfter->tagHistory()) | 785 if (!splitAfter || !splitAfter->tagHistory()) |
| 785 return compoundSelector; | 786 return compoundSelector; |
| 786 | 787 |
| 787 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); | 788 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); |
| 788 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, std::move
(compoundSelector)); | 789 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, std::move
(compoundSelector)); |
| 789 return secondCompound.release(); | 790 return secondCompound.release(); |
| 790 } | 791 } |
| 791 | 792 |
| 792 } // namespace blink | 793 } // namespace blink |
| OLD | NEW |