| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 550       selectorVector.append(std::move(innerSelector)); | 550       selectorVector.append(std::move(innerSelector)); | 
| 551       selector->adoptSelectorVector(selectorVector); | 551       selector->adoptSelectorVector(selectorVector); | 
| 552       return selector; | 552       return selector; | 
| 553     } | 553     } | 
| 554     case CSSSelector::PseudoSlotted: { | 554     case CSSSelector::PseudoSlotted: { | 
| 555       DisallowPseudoElementsScope scope(this); | 555       DisallowPseudoElementsScope scope(this); | 
| 556 | 556 | 
| 557       std::unique_ptr<CSSParserSelector> innerSelector = | 557       std::unique_ptr<CSSParserSelector> innerSelector = | 
| 558           consumeCompoundSelector(block); | 558           consumeCompoundSelector(block); | 
| 559       block.consumeWhitespace(); | 559       block.consumeWhitespace(); | 
| 560       if (!innerSelector || !block.atEnd() || | 560       if (!innerSelector || !block.atEnd()) | 
| 561           !RuntimeEnabledFeatures::shadowDOMV1Enabled()) |  | 
| 562         return nullptr; | 561         return nullptr; | 
| 563       Vector<std::unique_ptr<CSSParserSelector>> selectorVector; | 562       Vector<std::unique_ptr<CSSParserSelector>> selectorVector; | 
| 564       selectorVector.append(std::move(innerSelector)); | 563       selectorVector.append(std::move(innerSelector)); | 
| 565       selector->adoptSelectorVector(selectorVector); | 564       selector->adoptSelectorVector(selectorVector); | 
| 566       return selector; | 565       return selector; | 
| 567     } | 566     } | 
| 568     case CSSSelector::PseudoLang: { | 567     case CSSSelector::PseudoLang: { | 
| 569       // FIXME: CSS Selectors Level 4 allows :lang(*-foo) | 568       // FIXME: CSS Selectors Level 4 allows :lang(*-foo) | 
| 570       const CSSParserToken& ident = block.consumeIncludingWhitespace(); | 569       const CSSParserToken& ident = block.consumeIncludingWhitespace(); | 
| 571       if (ident.type() != IdentToken || !block.atEnd()) | 570       if (ident.type() != IdentToken || !block.atEnd()) | 
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 874       splitAfter->releaseTagHistory(); | 873       splitAfter->releaseTagHistory(); | 
| 875   secondCompound->appendTagHistory( | 874   secondCompound->appendTagHistory( | 
| 876       secondCompound->pseudoType() == CSSSelector::PseudoSlotted | 875       secondCompound->pseudoType() == CSSSelector::PseudoSlotted | 
| 877           ? CSSSelector::ShadowSlot | 876           ? CSSSelector::ShadowSlot | 
| 878           : CSSSelector::ShadowPseudo, | 877           : CSSSelector::ShadowPseudo, | 
| 879       std::move(compoundSelector)); | 878       std::move(compoundSelector)); | 
| 880   return secondCompound; | 879   return secondCompound; | 
| 881 } | 880 } | 
| 882 | 881 | 
| 883 }  // namespace blink | 882 }  // namespace blink | 
| OLD | NEW | 
|---|