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

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

Issue 2469143002: Make siblingRules and uncommonAttributeRules private. (Closed)
Patch Set: Compile fixes Created 4 years, 1 month 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. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 RuleFeatureSet(); 69 RuleFeatureSet();
70 ~RuleFeatureSet(); 70 ~RuleFeatureSet();
71 71
72 void add(const RuleFeatureSet&); 72 void add(const RuleFeatureSet&);
73 void clear(); 73 void clear();
74 74
75 enum SelectorPreMatch { SelectorNeverMatches, SelectorMayMatch }; 75 enum SelectorPreMatch { SelectorNeverMatches, SelectorMayMatch };
76 76
77 SelectorPreMatch collectFeaturesFromRuleData(const RuleData&); 77 SelectorPreMatch collectFeaturesFromRuleData(const RuleData&);
78 78
79 bool usesSiblingRules() const { return !siblingRules.isEmpty(); } 79 bool usesSiblingRules() const { return !m_siblingRules.isEmpty(); }
80 bool usesFirstLineRules() const { return m_metadata.usesFirstLineRules; } 80 bool usesFirstLineRules() const { return m_metadata.usesFirstLineRules; }
81 bool usesWindowInactiveSelector() const { 81 bool usesWindowInactiveSelector() const {
82 return m_metadata.usesWindowInactiveSelector; 82 return m_metadata.usesWindowInactiveSelector;
83 } 83 }
84 bool needsFullRecalcForRuleSetInvalidation() const { 84 bool needsFullRecalcForRuleSetInvalidation() const {
85 return m_metadata.needsFullRecalcForRuleSetInvalidation; 85 return m_metadata.needsFullRecalcForRuleSetInvalidation;
86 } 86 }
87 87
88 unsigned maxDirectAdjacentSelectors() const { 88 unsigned maxDirectAdjacentSelectors() const {
89 return m_metadata.maxDirectAdjacentSelectors; 89 return m_metadata.maxDirectAdjacentSelectors;
90 } 90 }
91 91
92 bool hasSelectorForAttribute(const AtomicString& attributeName) const { 92 bool hasSelectorForAttribute(const AtomicString& attributeName) const {
93 DCHECK(!attributeName.isEmpty()); 93 DCHECK(!attributeName.isEmpty());
94 return m_attributeInvalidationSets.contains(attributeName); 94 return m_attributeInvalidationSets.contains(attributeName);
95 } 95 }
96 96
97 bool hasSelectorForClass(const AtomicString& classValue) const { 97 bool hasSelectorForClass(const AtomicString& classValue) const {
98 DCHECK(!classValue.isEmpty()); 98 DCHECK(!classValue.isEmpty());
99 return m_classInvalidationSets.contains(classValue); 99 return m_classInvalidationSets.contains(classValue);
100 } 100 }
101 101
102 bool hasSelectorForId(const AtomicString& idValue) const { 102 bool hasSelectorForId(const AtomicString& idValue) const {
103 return m_idInvalidationSets.contains(idValue); 103 return m_idInvalidationSets.contains(idValue);
104 } 104 }
105 105
106 const HeapVector<RuleFeature>& siblingRules() const { return m_siblingRules; }
107 const HeapVector<RuleFeature>& uncommonAttributeRules() const {
108 return m_uncommonAttributeRules;
109 }
110
106 // Collect descendant and sibling invalidation sets. 111 // Collect descendant and sibling invalidation sets.
107 void collectInvalidationSetsForClass(InvalidationLists&, 112 void collectInvalidationSetsForClass(InvalidationLists&,
108 Element&, 113 Element&,
109 const AtomicString& className) const; 114 const AtomicString& className) const;
110 void collectInvalidationSetsForId(InvalidationLists&, 115 void collectInvalidationSetsForId(InvalidationLists&,
111 Element&, 116 Element&,
112 const AtomicString& id) const; 117 const AtomicString& id) const;
113 void collectInvalidationSetsForAttribute( 118 void collectInvalidationSetsForAttribute(
114 InvalidationLists&, 119 InvalidationLists&,
115 Element&, 120 Element&,
(...skipping 16 matching lines...) Expand all
132 const QualifiedName& attributeName, 137 const QualifiedName& attributeName,
133 unsigned minDirectAdjacent) const; 138 unsigned minDirectAdjacent) const;
134 void collectUniversalSiblingInvalidationSet(InvalidationLists&, 139 void collectUniversalSiblingInvalidationSet(InvalidationLists&,
135 unsigned minDirectAdjacent) const; 140 unsigned minDirectAdjacent) const;
136 void collectNthInvalidationSet(InvalidationLists&) const; 141 void collectNthInvalidationSet(InvalidationLists&) const;
137 142
138 bool hasIdsInSelectors() const { return m_idInvalidationSets.size() > 0; } 143 bool hasIdsInSelectors() const { return m_idInvalidationSets.size() > 0; }
139 144
140 DECLARE_TRACE(); 145 DECLARE_TRACE();
141 146
142 HeapVector<RuleFeature> siblingRules;
143 HeapVector<RuleFeature> uncommonAttributeRules;
144
145 bool isAlive() const { return m_isAlive; } 147 bool isAlive() const { return m_isAlive; }
146 148
147 protected: 149 protected:
148 InvalidationSet* invalidationSetForSimpleSelector(const CSSSelector&, 150 InvalidationSet* invalidationSetForSimpleSelector(const CSSSelector&,
149 InvalidationType); 151 InvalidationType);
150 152
151 private: 153 private:
152 // Each map entry is either a DescendantInvalidationSet or 154 // Each map entry is either a DescendantInvalidationSet or
153 // SiblingInvalidationSet. 155 // SiblingInvalidationSet.
154 // When both are needed, we store the SiblingInvalidationSet, and use it to 156 // When both are needed, we store the SiblingInvalidationSet, and use it to
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 268
267 void addClassToInvalidationSet(const AtomicString& className, Element&); 269 void addClassToInvalidationSet(const AtomicString& className, Element&);
268 270
269 FeatureMetadata m_metadata; 271 FeatureMetadata m_metadata;
270 InvalidationSetMap m_classInvalidationSets; 272 InvalidationSetMap m_classInvalidationSets;
271 InvalidationSetMap m_attributeInvalidationSets; 273 InvalidationSetMap m_attributeInvalidationSets;
272 InvalidationSetMap m_idInvalidationSets; 274 InvalidationSetMap m_idInvalidationSets;
273 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 275 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
274 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet; 276 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet;
275 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet; 277 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet;
278 HeapVector<RuleFeature> m_siblingRules;
279 HeapVector<RuleFeature> m_uncommonAttributeRules;
276 280
277 // If true, the RuleFeatureSet is alive and can be used. 281 // If true, the RuleFeatureSet is alive and can be used.
278 unsigned m_isAlive : 1; 282 unsigned m_isAlive : 1;
279 283
280 friend class RuleFeatureSetTest; 284 friend class RuleFeatureSetTest;
281 }; 285 };
282 286
283 } // namespace blink 287 } // namespace blink
284 288
285 #endif // RuleFeature_h 289 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGlobalRuleSet.cpp ('k') | third_party/WebKit/Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698