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

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

Issue 1544893003: Don't add rule features across ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused method Created 4 years, 11 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType type) { return ensureClassInvalidationData(className).ensureInva lidationSet(type); } 131 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I nvalidationType type) { return ensureClassInvalidationData(className).ensureInva lidationSet(type); }
132 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType type) { return ensureAttributeInvalidationData(attribute Name).ensureInvalidationSet(type); } 132 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut eName, InvalidationType type) { return ensureAttributeInvalidationData(attribute Name).ensureInvalidationSet(type); }
133 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType type) { return ensureIdInvalidationData(id).ensureInvalidationSet(type); } 133 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio nType type) { return ensureIdInvalidationData(id).ensureInvalidationSet(type); }
134 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType pseudoT ype, InvalidationType type) { return ensurePseudoInvalidationData(pseudoType).en sureInvalidationSet(type); } 134 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType pseudoT ype, InvalidationType type) { return ensurePseudoInvalidationData(pseudoType).en sureInvalidationSet(type); }
135 135
136 void updateInvalidationSets(const RuleData&); 136 void updateInvalidationSets(const RuleData&);
137 void updateInvalidationSetsForContentAttribute(const RuleData&); 137 void updateInvalidationSetsForContentAttribute(const RuleData&);
138 138
139 struct InvalidationSetFeatures { 139 struct InvalidationSetFeatures {
140 DISALLOW_NEW(); 140 DISALLOW_NEW();
141 InvalidationSetFeatures()
142 : maxDirectAdjacentSelectors(UINT_MAX)
143 , customPseudoElement(false)
144 , hasBeforeOrAfter(false)
145 , treeBoundaryCrossing(false)
146 , adjacent(false)
147 , insertionPointCrossing(false)
148 , forceSubtree(false)
149 { }
150 141
151 Vector<AtomicString> classes; 142 Vector<AtomicString> classes;
152 Vector<AtomicString> attributes; 143 Vector<AtomicString> attributes;
153 AtomicString id; 144 AtomicString id;
154 AtomicString tagName; 145 AtomicString tagName;
155 unsigned maxDirectAdjacentSelectors; 146 unsigned maxDirectAdjacentSelectors = UINT_MAX;
156 bool customPseudoElement; 147 bool customPseudoElement = false;
157 bool hasBeforeOrAfter; 148 bool hasBeforeOrAfter = false;
158 bool treeBoundaryCrossing; 149 bool treeBoundaryCrossing = false;
159 bool adjacent; 150 bool adjacent = false;
160 bool insertionPointCrossing; 151 bool insertionPointCrossing = false;
161 bool forceSubtree; 152 bool forceSubtree = false;
153 bool contentPseudoCrossing = false;
162 }; 154 };
163 155
164 static bool extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&); 156 static bool extractInvalidationSetFeature(const CSSSelector&, InvalidationSe tFeatures&);
165 157
166 enum UseFeaturesType { UseFeatures, ForceSubtree }; 158 enum UseFeaturesType { UseFeatures, ForceSubtree };
167 159
168 enum PositionType { Subject, Ancestor }; 160 enum PositionType { Subject, Ancestor };
169 std::pair<const CSSSelector*, UseFeaturesType> extractInvalidationSetFeature s(const CSSSelector&, InvalidationSetFeatures&, PositionType, CSSSelector::Pseud oType = CSSSelector::PseudoUnknown); 161 std::pair<const CSSSelector*, UseFeaturesType> extractInvalidationSetFeature s(const CSSSelector&, InvalidationSetFeatures&, PositionType, CSSSelector::Pseud oType = CSSSelector::PseudoUnknown);
170 162
171 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&); 163 void addFeaturesToInvalidationSet(InvalidationSet&, const InvalidationSetFea tures&);
172 void addFeaturesToInvalidationSets(const CSSSelector*, InvalidationSetFeatur es* siblingFeatures, InvalidationSetFeatures& descendantFeatures); 164 void addFeaturesToInvalidationSets(const CSSSelector*, InvalidationSetFeatur es* siblingFeatures, InvalidationSetFeatures& descendantFeatures);
173 165
174 void addClassToInvalidationSet(const AtomicString& className, Element&); 166 void addClassToInvalidationSet(const AtomicString& className, Element&);
175 167
176 FeatureMetadata m_metadata; 168 FeatureMetadata m_metadata;
177 InvalidationSetMap m_classInvalidationSets; 169 InvalidationSetMap m_classInvalidationSets;
178 InvalidationSetMap m_attributeInvalidationSets; 170 InvalidationSetMap m_attributeInvalidationSets;
179 InvalidationSetMap m_idInvalidationSets; 171 InvalidationSetMap m_idInvalidationSets;
180 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; 172 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
181 173
182 friend class RuleFeatureSetTest; 174 friend class RuleFeatureSetTest;
183 }; 175 };
184 176
185 } // namespace blink 177 } // namespace blink
186 178
187 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); 179 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature);
188 180
189 #endif // RuleFeature_h 181 #endif // RuleFeature_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698