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 <memory> | 7 #include <memory> |
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/css/parser/CSSParserContext.h" | 10 #include "core/css/parser/CSSParserContext.h" |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // Also, selectors where we use a ShadowPseudo combinator between the | 742 // Also, selectors where we use a ShadowPseudo combinator between the |
743 // element and the pseudo element for matching (custom pseudo elements, | 743 // element and the pseudo element for matching (custom pseudo elements, |
744 // ::cue, ::shadow), we need a universal selector to set the combinator | 744 // ::cue, ::shadow), we need a universal selector to set the combinator |
745 // (relation) on in the cases where there are no simple selectors preceding | 745 // (relation) on in the cases where there are no simple selectors preceding |
746 // the pseudo element. | 746 // the pseudo element. |
747 bool explicitForHost = | 747 bool explicitForHost = |
748 compoundSelector->isHostPseudoSelector() && !elementName.isNull(); | 748 compoundSelector->isHostPseudoSelector() && !elementName.isNull(); |
749 if (tag != anyQName() || explicitForHost || | 749 if (tag != anyQName() || explicitForHost || |
750 compoundSelector->needsImplicitShadowCombinatorForMatching()) | 750 compoundSelector->needsImplicitShadowCombinatorForMatching()) |
751 compoundSelector->prependTagSelector( | 751 compoundSelector->prependTagSelector( |
752 tag, determinedPrefix == nullAtom && | 752 tag, |
753 determinedElementName == starAtom && !explicitForHost); | 753 determinedPrefix == nullAtom && determinedElementName == starAtom && |
| 754 !explicitForHost); |
754 } | 755 } |
755 | 756 |
756 std::unique_ptr<CSSParserSelector> | 757 std::unique_ptr<CSSParserSelector> |
757 CSSSelectorParser::addSimpleSelectorToCompound( | 758 CSSSelectorParser::addSimpleSelectorToCompound( |
758 std::unique_ptr<CSSParserSelector> compoundSelector, | 759 std::unique_ptr<CSSParserSelector> compoundSelector, |
759 std::unique_ptr<CSSParserSelector> simpleSelector) { | 760 std::unique_ptr<CSSParserSelector> simpleSelector) { |
760 compoundSelector->appendTagHistory(CSSSelector::SubSelector, | 761 compoundSelector->appendTagHistory(CSSSelector::SubSelector, |
761 std::move(simpleSelector)); | 762 std::move(simpleSelector)); |
762 return compoundSelector; | 763 return compoundSelector; |
763 } | 764 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 } | 910 } |
910 if (current->relation() == CSSSelector::IndirectAdjacent) | 911 if (current->relation() == CSSSelector::IndirectAdjacent) |
911 m_context->count(UseCounter::CSSSelectorIndirectAdjacent); | 912 m_context->count(UseCounter::CSSSelectorIndirectAdjacent); |
912 if (current->selectorList()) | 913 if (current->selectorList()) |
913 recordUsageAndDeprecations(*current->selectorList()); | 914 recordUsageAndDeprecations(*current->selectorList()); |
914 } | 915 } |
915 } | 916 } |
916 } | 917 } |
917 | 918 |
918 } // namespace blink | 919 } // namespace blink |
OLD | NEW |