OLD | NEW |
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation
Type); | 101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation
Type); |
102 | 102 |
103 private: | 103 private: |
104 // Each map entry is either a DescendantInvalidationSet or SiblingInvalidati
onSet. | 104 // Each map entry is either a DescendantInvalidationSet or SiblingInvalidati
onSet. |
105 // When both are needed, we store the SiblingInvalidationSet, and use it to
hold the DescendantInvalidationSet. | 105 // When both are needed, we store the SiblingInvalidationSet, and use it to
hold the DescendantInvalidationSet. |
106 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationSet>>; | 106 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationSet>>; |
107 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr
<InvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<un
signed>>; | 107 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr
<InvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<un
signed>>; |
108 | 108 |
109 struct FeatureMetadata { | 109 struct FeatureMetadata { |
110 DISALLOW_NEW(); | 110 DISALLOW_NEW(); |
111 FeatureMetadata() | |
112 : usesFirstLineRules(false) | |
113 , usesWindowInactiveSelector(false) | |
114 , foundSiblingSelector(false) | |
115 , maxDirectAdjacentSelectors(0) | |
116 { } | |
117 void add(const FeatureMetadata& other); | 111 void add(const FeatureMetadata& other); |
118 void clear(); | 112 void clear(); |
119 | 113 |
120 bool usesFirstLineRules; | 114 bool usesFirstLineRules = false; |
121 bool usesWindowInactiveSelector; | 115 bool usesWindowInactiveSelector = false; |
122 bool foundSiblingSelector; | 116 bool foundSiblingSelector = false; |
123 unsigned maxDirectAdjacentSelectors; | 117 bool foundInsertionPointCrossing = false; |
| 118 unsigned maxDirectAdjacentSelectors = 0; |
124 }; | 119 }; |
125 | 120 |
126 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&); | 121 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&); |
127 | 122 |
128 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I
nvalidationType); | 123 InvalidationSet& ensureClassInvalidationSet(const AtomicString& className, I
nvalidationType); |
129 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut
eName, InvalidationType); | 124 InvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attribut
eName, InvalidationType); |
130 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio
nType); | 125 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, Invalidatio
nType); |
131 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali
dationType); | 126 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, Invali
dationType); |
132 | 127 |
133 void updateInvalidationSets(const RuleData&); | 128 void updateInvalidationSets(const RuleData&); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; | 164 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; |
170 | 165 |
171 friend class RuleFeatureSetTest; | 166 friend class RuleFeatureSetTest; |
172 }; | 167 }; |
173 | 168 |
174 } // namespace blink | 169 } // namespace blink |
175 | 170 |
176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); | 171 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); |
177 | 172 |
178 #endif // RuleFeature_h | 173 #endif // RuleFeature_h |
OLD | NEW |