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

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

Issue 2326783002: Simplified compound feature extraction. (Closed)
Patch Set: Unreachable code detected by compiler. Created 4 years, 3 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/css/RuleFeature.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 bool treeBoundaryCrossing = false; 165 bool treeBoundaryCrossing = false;
166 bool insertionPointCrossing = false; 166 bool insertionPointCrossing = false;
167 bool forceSubtree = false; 167 bool forceSubtree = false;
168 bool contentPseudoCrossing = false; 168 bool contentPseudoCrossing = false;
169 bool invalidatesSlotted = false; 169 bool invalidatesSlotted = false;
170 bool hasNthPseudo = false; 170 bool hasNthPseudo = false;
171 }; 171 };
172 172
173 static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&); 173 static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&);
174 174
175 enum UseFeaturesType { UseFeatures, ForceSubtree };
176
177 enum PositionType { Subject, Ancestor }; 175 enum PositionType { Subject, Ancestor };
176 enum FeatureInvalidationType { NormalInvalidation, RequiresSubtreeInvalidati on };
178 177
179 void extractInvalidationSetFeaturesFromSimpleSelector(const CSSSelector&, In validationSetFeatures&); 178 void extractInvalidationSetFeaturesFromSimpleSelector(const CSSSelector&, In validationSetFeatures&);
180 const CSSSelector* extractInvalidationSetFeaturesFromCompound(const CSSSelec tor&, InvalidationSetFeatures&, PositionType, CSSSelector::PseudoType = CSSSelec tor::PseudoUnknown); 179 const CSSSelector* extractInvalidationSetFeaturesFromCompound(const CSSSelec tor&, InvalidationSetFeatures&, PositionType, CSSSelector::PseudoType = CSSSelec tor::PseudoUnknown);
181 const CSSSelector* extractInvalidationSetFeaturesFromSelectorList(const CSSS elector&, InvalidationSetFeatures&, PositionType); 180 FeatureInvalidationType extractInvalidationSetFeaturesFromSelectorList(const CSSSelector&, InvalidationSetFeatures&, PositionType);
182 void updateFeaturesFromCombinator(const CSSSelector&, 181 void updateFeaturesFromCombinator(const CSSSelector&,
183 const CSSSelector* lastCompoundSelectorInAdjacentChain, 182 const CSSSelector* lastCompoundSelectorInAdjacentChain,
184 InvalidationSetFeatures& lastCompoundInAdjacentChainFeatures, 183 InvalidationSetFeatures& lastCompoundInAdjacentChainFeatures,
185 InvalidationSetFeatures*& siblingFeatures, 184 InvalidationSetFeatures*& siblingFeatures,
186 InvalidationSetFeatures& descendantFeatures); 185 InvalidationSetFeatures& descendantFeatures);
187 186
188 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&); 187 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&);
189 void addFeaturesToInvalidationSets(const CSSSelector&, InvalidationSetFeatur es& descendantFeatures); 188 void addFeaturesToInvalidationSets(const CSSSelector&, InvalidationSetFeatur es* siblingFeatures, InvalidationSetFeatures& descendantFeatures);
190 const CSSSelector* addFeaturesToInvalidationSetsForCompoundSelector(const CS SSelector&, InvalidationSetFeatures* siblingFeatures, InvalidationSetFeatures& d escendantFeatures); 189 const CSSSelector* addFeaturesToInvalidationSetsForCompoundSelector(const CS SSelector&, InvalidationSetFeatures* siblingFeatures, InvalidationSetFeatures& d escendantFeatures);
191 void addFeaturesToInvalidationSetsForSimpleSelector(const CSSSelector&, Inva lidationSetFeatures* siblingFeatures, InvalidationSetFeatures& descendantFeature s); 190 void addFeaturesToInvalidationSetsForSimpleSelector(const CSSSelector&, Inva lidationSetFeatures* siblingFeatures, InvalidationSetFeatures& descendantFeature s);
192 void addFeaturesToInvalidationSetsForSelectorList(const CSSSelector&, Invali dationSetFeatures* siblingFeatures, InvalidationSetFeatures& descendantFeatures) ; 191 void addFeaturesToInvalidationSetsForSelectorList(const CSSSelector&, Invali dationSetFeatures* siblingFeatures, InvalidationSetFeatures& descendantFeatures) ;
193 void addFeaturesToUniversalSiblingInvalidationSet(const InvalidationSetFeatu res& siblingFeatures, const InvalidationSetFeatures& descendantFeatures); 192 void addFeaturesToUniversalSiblingInvalidationSet(const InvalidationSetFeatu res& siblingFeatures, const InvalidationSetFeatures& descendantFeatures);
194 193
195 void addClassToInvalidationSet(const AtomicString& className, Element&); 194 void addClassToInvalidationSet(const AtomicString& className, Element&);
196 195
197 FeatureMetadata m_metadata; 196 FeatureMetadata m_metadata;
198 InvalidationSetMap m_classInvalidationSets; 197 InvalidationSetMap m_classInvalidationSets;
199 InvalidationSetMap m_attributeInvalidationSets; 198 InvalidationSetMap m_attributeInvalidationSets;
200 InvalidationSetMap m_idInvalidationSets; 199 InvalidationSetMap m_idInvalidationSets;
201 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 200 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
202 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet; 201 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet;
203 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet; 202 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet;
204 203
205 // If true, the RuleFeatureSet is alive and can be used. 204 // If true, the RuleFeatureSet is alive and can be used.
206 unsigned m_isAlive : 1; 205 unsigned m_isAlive : 1;
207 206
208 friend class RuleFeatureSetTest; 207 friend class RuleFeatureSetTest;
209 }; 208 };
210 209
211 } // namespace blink 210 } // namespace blink
212 211
213 #endif // RuleFeature_h 212 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698