Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp

Issue 1641583002: Add use counter for indirect adjacent selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698