| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 break; | 55 break; |
| 56 case CSSSelector::PseudoSpatialNavigationFocus: | 56 case CSSSelector::PseudoSpatialNavigationFocus: |
| 57 if (context.mode() != UASheetMode) | 57 if (context.mode() != UASheetMode) |
| 58 feature = UseCounter::CSSSelectorInternalPseudoSpatialNaviga
tionFocus; | 58 feature = UseCounter::CSSSelectorInternalPseudoSpatialNaviga
tionFocus; |
| 59 break; | 59 break; |
| 60 default: | 60 default: |
| 61 break; | 61 break; |
| 62 } | 62 } |
| 63 if (feature != UseCounter::NumberOfFeatures) | 63 if (feature != UseCounter::NumberOfFeatures) |
| 64 context.useCounter()->count(feature); | 64 context.useCounter()->count(feature); |
| 65 if (current->relation() == CSSSelector::IndirectAdjacent) |
| 66 context.useCounter()->count(UseCounter::CSSSelectorIndirectAdjac
ent); |
| 65 if (current->selectorList()) | 67 if (current->selectorList()) |
| 66 recordSelectorStats(context, *current->selectorList()); | 68 recordSelectorStats(context, *current->selectorList()); |
| 67 } | 69 } |
| 68 } | 70 } |
| 69 } | 71 } |
| 70 | 72 |
| 71 CSSSelectorList CSSSelectorParser::parseSelector(CSSParserTokenRange range, cons
t CSSParserContext& context, StyleSheetContents* styleSheet) | 73 CSSSelectorList CSSSelectorParser::parseSelector(CSSParserTokenRange range, cons
t CSSParserContext& context, StyleSheetContents* styleSheet) |
| 72 { | 74 { |
| 73 CSSSelectorParser parser(context, styleSheet); | 75 CSSSelectorParser parser(context, styleSheet); |
| 74 range.consumeWhitespace(); | 76 range.consumeWhitespace(); |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 | 781 |
| 780 if (!splitAfter || !splitAfter->tagHistory()) | 782 if (!splitAfter || !splitAfter->tagHistory()) |
| 781 return compoundSelector; | 783 return compoundSelector; |
| 782 | 784 |
| 783 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); | 785 OwnPtr<CSSParserSelector> secondCompound = splitAfter->releaseTagHistory(); |
| 784 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS
elector); | 786 secondCompound->appendTagHistory(secondCompound->pseudoType() == CSSSelector
::PseudoSlotted ? CSSSelector::ShadowSlot : CSSSelector::ShadowPseudo, compoundS
elector); |
| 785 return secondCompound.release(); | 787 return secondCompound.release(); |
| 786 } | 788 } |
| 787 | 789 |
| 788 } // namespace blink | 790 } // namespace blink |
| OLD | NEW |