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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 struct InvalidationLists; | 35 struct InvalidationLists; |
36 class QualifiedName; | 36 class QualifiedName; |
37 class RuleData; | 37 class RuleData; |
38 class SpaceSplitString; | 38 class SpaceSplitString; |
39 class StyleRule; | 39 class StyleRule; |
40 | 40 |
41 struct RuleFeature { | 41 struct RuleFeature { |
42 ALLOW_ONLY_INLINE_ALLOCATION(); | 42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
43 public: | 43 public: |
44 RuleFeature(StyleRule*, unsigned selectorIndex, bool hasDocumentSecurityOrig
in); | 44 RuleFeature(StyleRule*, unsigned selectorIndex, bool hasDocumentSecurityOrig
in); |
45 | 45 |
46 DECLARE_TRACE(); | 46 DECLARE_TRACE(); |
47 | 47 |
48 RawPtrWillBeMember<StyleRule> rule; | 48 RawPtrWillBeMember<StyleRule> rule; |
49 unsigned selectorIndex; | 49 unsigned selectorIndex; |
50 bool hasDocumentSecurityOrigin; | 50 bool hasDocumentSecurityOrigin; |
51 }; | 51 }; |
52 | 52 |
53 class CORE_EXPORT RuleFeatureSet { | 53 class CORE_EXPORT RuleFeatureSet { |
54 DISALLOW_ALLOCATION(); | 54 DISALLOW_NEW(); |
55 public: | 55 public: |
56 RuleFeatureSet(); | 56 RuleFeatureSet(); |
57 ~RuleFeatureSet(); | 57 ~RuleFeatureSet(); |
58 | 58 |
59 void add(const RuleFeatureSet&); | 59 void add(const RuleFeatureSet&); |
60 void clear(); | 60 void clear(); |
61 | 61 |
62 void collectFeaturesFromRuleData(const RuleData&); | 62 void collectFeaturesFromRuleData(const RuleData&); |
63 | 63 |
64 bool usesSiblingRules() const { return !siblingRules.isEmpty(); } | 64 bool usesSiblingRules() const { return !siblingRules.isEmpty(); } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 WillBeHeapVector<RuleFeature> uncommonAttributeRules; | 98 WillBeHeapVector<RuleFeature> uncommonAttributeRules; |
99 | 99 |
100 protected: | 100 protected: |
101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation
Type); | 101 InvalidationSet* invalidationSetForSelector(const CSSSelector&, Invalidation
Type); |
102 | 102 |
103 private: | 103 private: |
104 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationData>>; | 104 using InvalidationSetMap = HashMap<AtomicString, RefPtr<InvalidationData>>; |
105 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr
<InvalidationData>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<u
nsigned>>; | 105 using PseudoTypeInvalidationSetMap = HashMap<CSSSelector::PseudoType, RefPtr
<InvalidationData>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<u
nsigned>>; |
106 | 106 |
107 struct FeatureMetadata { | 107 struct FeatureMetadata { |
108 DISALLOW_ALLOCATION(); | 108 DISALLOW_NEW(); |
109 FeatureMetadata() | 109 FeatureMetadata() |
110 : usesFirstLineRules(false) | 110 : usesFirstLineRules(false) |
111 , usesWindowInactiveSelector(false) | 111 , usesWindowInactiveSelector(false) |
112 , foundSiblingSelector(false) | 112 , foundSiblingSelector(false) |
113 , maxDirectAdjacentSelectors(0) | 113 , maxDirectAdjacentSelectors(0) |
114 { } | 114 { } |
115 void add(const FeatureMetadata& other); | 115 void add(const FeatureMetadata& other); |
116 void clear(); | 116 void clear(); |
117 | 117 |
118 bool usesFirstLineRules; | 118 bool usesFirstLineRules; |
(...skipping 11 matching lines...) Expand all Loading... |
130 | 130 |
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_ALLOCATION(); | 140 DISALLOW_NEW(); |
141 InvalidationSetFeatures() | 141 InvalidationSetFeatures() |
142 : maxDirectAdjacentSelectors(UINT_MAX) | 142 : maxDirectAdjacentSelectors(UINT_MAX) |
143 , customPseudoElement(false) | 143 , customPseudoElement(false) |
144 , hasBeforeOrAfter(false) | 144 , hasBeforeOrAfter(false) |
145 , treeBoundaryCrossing(false) | 145 , treeBoundaryCrossing(false) |
146 , adjacent(false) | 146 , adjacent(false) |
147 , insertionPointCrossing(false) | 147 , insertionPointCrossing(false) |
148 , forceSubtree(false) | 148 , forceSubtree(false) |
149 { } | 149 { } |
150 | 150 |
(...skipping 29 matching lines...) Expand all Loading... |
180 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; | 180 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; |
181 | 181 |
182 friend class RuleFeatureSetTest; | 182 friend class RuleFeatureSetTest; |
183 }; | 183 }; |
184 | 184 |
185 } // namespace blink | 185 } // namespace blink |
186 | 186 |
187 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); | 187 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleFeature); |
188 | 188 |
189 #endif // RuleFeature_h | 189 #endif // RuleFeature_h |
OLD | NEW |