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

Side by Side Diff: third_party/WebKit/Source/core/css/RuleFeature.h

Issue 2254443002: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // Collect descendant and sibling invalidation sets. 95 // Collect descendant and sibling invalidation sets.
96 void collectInvalidationSetsForClass(InvalidationLists&, Element&, const Ato micString& className) const; 96 void collectInvalidationSetsForClass(InvalidationLists&, Element&, const Ato micString& className) const;
97 void collectInvalidationSetsForId(InvalidationLists&, Element&, const Atomic String& id) const; 97 void collectInvalidationSetsForId(InvalidationLists&, Element&, const Atomic String& id) const;
98 void collectInvalidationSetsForAttribute(InvalidationLists&, Element&, const QualifiedName& attributeName) const; 98 void collectInvalidationSetsForAttribute(InvalidationLists&, Element&, const QualifiedName& attributeName) const;
99 void collectInvalidationSetsForPseudoClass(InvalidationLists&, Element&, CSS Selector::PseudoType) const; 99 void collectInvalidationSetsForPseudoClass(InvalidationLists&, Element&, CSS Selector::PseudoType) const;
100 100
101 void collectSiblingInvalidationSetForClass(InvalidationLists&, Element&, con st AtomicString& className, unsigned minDirectAdjacent) const; 101 void collectSiblingInvalidationSetForClass(InvalidationLists&, Element&, con st AtomicString& className, unsigned minDirectAdjacent) const;
102 void collectSiblingInvalidationSetForId(InvalidationLists&, Element&, const AtomicString& id, unsigned minDirectAdjacent) const; 102 void collectSiblingInvalidationSetForId(InvalidationLists&, Element&, const AtomicString& id, unsigned minDirectAdjacent) const;
103 void collectSiblingInvalidationSetForAttribute(InvalidationLists&, Element&, const QualifiedName& attributeName, unsigned minDirectAdjacent) const; 103 void collectSiblingInvalidationSetForAttribute(InvalidationLists&, Element&, const QualifiedName& attributeName, unsigned minDirectAdjacent) const;
104 void collectUniversalSiblingInvalidationSet(InvalidationLists&, unsigned min DirectAdjacent) const; 104 void collectUniversalSiblingInvalidationSet(InvalidationLists&, unsigned min DirectAdjacent) const;
105 void collectNthInvalidationSet(InvalidationLists&) const;
106 105
107 bool hasIdsInSelectors() const 106 bool hasIdsInSelectors() const
108 { 107 {
109 return m_idInvalidationSets.size() > 0; 108 return m_idInvalidationSets.size() > 0;
110 } 109 }
111 110
112 DECLARE_TRACE(); 111 DECLARE_TRACE();
113 112
114 HeapVector<RuleFeature> siblingRules; 113 HeapVector<RuleFeature> siblingRules;
115 HeapVector<RuleFeature> uncommonAttributeRules; 114 HeapVector<RuleFeature> uncommonAttributeRules;
(...skipping 19 matching lines...) Expand all
135 unsigned maxDirectAdjacentSelectors = 0; 134 unsigned maxDirectAdjacentSelectors = 0;
136 }; 135 };
137 136
138 SelectorPreMatch collectFeaturesFromSelector(const CSSSelector&, FeatureMeta data&); 137 SelectorPreMatch collectFeaturesFromSelector(const CSSSelector&, FeatureMeta data&);
139 138
140 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType); 139 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType);
141 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType); 140 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType);
142 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType); 141 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType);
143 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali dationType); 142 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali dationType);
144 SiblingInvalidationSet& ensureUniversalSiblingInvalidationSet(); 143 SiblingInvalidationSet& ensureUniversalSiblingInvalidationSet();
145 DescendantInvalidationSet& ensureNthInvalidationSet();
146 144
147 void updateInvalidationSets(const RuleData&); 145 void updateInvalidationSets(const RuleData&);
148 void updateInvalidationSetsForContentAttribute(const RuleData&); 146 void updateInvalidationSetsForContentAttribute(const RuleData&);
149 147
150 struct InvalidationSetFeatures { 148 struct InvalidationSetFeatures {
151 DISALLOW_NEW(); 149 DISALLOW_NEW();
152 150
153 Vector<AtomicString> classes; 151 Vector<AtomicString> classes;
154 Vector<AtomicString> attributes; 152 Vector<AtomicString> attributes;
155 AtomicString id; 153 AtomicString id;
156 AtomicString tagName; 154 AtomicString tagName;
157 unsigned maxDirectAdjacentSelectors = UINT_MAX; 155 unsigned maxDirectAdjacentSelectors = UINT_MAX;
158 bool customPseudoElement = false; 156 bool customPseudoElement = false;
159 bool hasBeforeOrAfter = false; 157 bool hasBeforeOrAfter = false;
160 bool treeBoundaryCrossing = false; 158 bool treeBoundaryCrossing = false;
161 bool adjacent = false; 159 bool adjacent = false;
162 bool insertionPointCrossing = false; 160 bool insertionPointCrossing = false;
163 bool forceSubtree = false; 161 bool forceSubtree = false;
164 bool contentPseudoCrossing = false; 162 bool contentPseudoCrossing = false;
165 bool invalidatesSlotted = false; 163 bool invalidatesSlotted = false;
166 bool hasNthPseudo = false;
167 }; 164 };
168 165
169 static bool extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&); 166 static bool extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&);
170 167
171 enum UseFeaturesType { UseFeatures, ForceSubtree }; 168 enum UseFeaturesType { UseFeatures, ForceSubtree };
172 169
173 enum PositionType { Subject, Ancestor }; 170 enum PositionType { Subject, Ancestor };
174 std::pair<const CSSSelector*, UseFeaturesType> extractInvalidationSetFeature s(const CSSSelector&, InvalidationSetFeatures&, PositionType, CSSSelector::Pseud oType = CSSSelector::PseudoUnknown); 171 std::pair<const CSSSelector*, UseFeaturesType> extractInvalidationSetFeature s(const CSSSelector&, InvalidationSetFeatures&, PositionType, CSSSelector::Pseud oType = CSSSelector::PseudoUnknown);
175 172
176 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&); 173 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&);
177 void addFeaturesToInvalidationSets(const CSSSelector*, InvalidationSetFeatur es* siblingFeatures, InvalidationSetFeatures& descendantFeatures); 174 void addFeaturesToInvalidationSets(const CSSSelector*, InvalidationSetFeatur es* siblingFeatures, InvalidationSetFeatures& descendantFeatures);
178 void addFeaturesToUniversalSiblingInvalidationSet(const InvalidationSetFeatu res& siblingFeatures, const InvalidationSetFeatures& descendantFeatures); 175 void addFeaturesToUniversalSiblingInvalidationSet(const InvalidationSetFeatu res& siblingFeatures, const InvalidationSetFeatures& descendantFeatures);
179 176
180 void addClassToInvalidationSet(const AtomicString& className, Element&); 177 void addClassToInvalidationSet(const AtomicString& className, Element&);
181 178
182 FeatureMetadata m_metadata; 179 FeatureMetadata m_metadata;
183 InvalidationSetMap m_classInvalidationSets; 180 InvalidationSetMap m_classInvalidationSets;
184 InvalidationSetMap m_attributeInvalidationSets; 181 InvalidationSetMap m_attributeInvalidationSets;
185 InvalidationSetMap m_idInvalidationSets; 182 InvalidationSetMap m_idInvalidationSets;
186 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 183 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
187 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet; 184 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet;
188 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet;
189 185
190 friend class RuleFeatureSetTest; 186 friend class RuleFeatureSetTest;
191 }; 187 };
192 188
193 } // namespace blink 189 } // namespace blink
194 190
195 #endif // RuleFeature_h 191 #endif // RuleFeature_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698