| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return m_classInvalidationSets.contains(classValue); | 80 return m_classInvalidationSets.contains(classValue); |
| 81 } | 81 } |
| 82 | 82 |
| 83 inline bool hasSelectorForId(const AtomicString& idValue) const | 83 inline bool hasSelectorForId(const AtomicString& idValue) const |
| 84 { | 84 { |
| 85 return m_idInvalidationSets.contains(idValue); | 85 return m_idInvalidationSets.contains(idValue); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed
Classes, Element&); | 88 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed
Classes, Element&); |
| 89 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas
ses, const SpaceSplitString& newClasses, Element&); | 89 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas
ses, const SpaceSplitString& newClasses, Element&); |
| 90 void scheduleStyleInvalidationForHoverChange(Element&); |
| 91 void scheduleStyleInvalidationForActiveChange(Element&); |
| 92 void scheduleStyleInvalidationForFocusChange(Element&); |
| 90 | 93 |
| 91 void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attrib
uteName, Element&); | 94 void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attrib
uteName, Element&); |
| 92 | 95 |
| 93 void scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const A
tomicString& newId, Element&); | 96 void scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const A
tomicString& newId, Element&); |
| 94 | 97 |
| 95 bool hasIdsInSelectors() const | 98 bool hasIdsInSelectors() const |
| 96 { | 99 { |
| 97 return m_idInvalidationSets.size() > 0; | 100 return m_idInvalidationSets.size() > 0; |
| 98 } | 101 } |
| 99 | 102 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 125 }; | 128 }; |
| 126 | 129 |
| 127 enum InvalidationSetMode { | 130 enum InvalidationSetMode { |
| 128 AddFeatures, | 131 AddFeatures, |
| 129 UseLocalStyleChange, | 132 UseLocalStyleChange, |
| 130 UseSubtreeStyleChange | 133 UseSubtreeStyleChange |
| 131 }; | 134 }; |
| 132 | 135 |
| 133 static InvalidationSetMode invalidationSetModeForSelector(const CSSSelector&
); | 136 static InvalidationSetMode invalidationSetModeForSelector(const CSSSelector&
); |
| 134 | 137 |
| 135 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Inval
idationSetMode); | 138 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Inval
idationSetMode, bool seenCombinator); |
| 136 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata
&, InvalidationSetMode); | 139 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata
&, InvalidationSetMode, bool seenCombinator); |
| 137 | 140 |
| 138 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl
assName); | 141 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl
assName); |
| 139 DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString
& attributeName); | 142 DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString
& attributeName); |
| 140 DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attri
buteName); | 143 DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attri
buteName); |
| 141 DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&); | 144 DescendantInvalidationSet& ensureHoverInvalidationSet(); |
| 145 DescendantInvalidationSet& ensureActiveInvalidationSet(); |
| 146 DescendantInvalidationSet& ensureFocusInvalidationSet(); |
| 147 DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&, bo
ol seenCombinator); |
| 142 | 148 |
| 143 InvalidationSetMode updateInvalidationSets(const CSSSelector&); | 149 InvalidationSetMode updateInvalidationSets(const CSSSelector&); |
| 144 | 150 |
| 145 struct InvalidationSetFeatures { | 151 struct InvalidationSetFeatures { |
| 146 InvalidationSetFeatures() : customPseudoElement(false) { } | 152 InvalidationSetFeatures() : customPseudoElement(false) { } |
| 147 Vector<AtomicString> classes; | 153 Vector<AtomicString> classes; |
| 148 Vector<AtomicString> attributes; | 154 Vector<AtomicString> attributes; |
| 149 AtomicString id; | 155 AtomicString id; |
| 150 AtomicString tagName; | 156 AtomicString tagName; |
| 151 bool customPseudoElement; | 157 bool customPseudoElement; |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSe
tFeatures&); | 160 static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSe
tFeatures&); |
| 155 const CSSSelector* extractInvalidationSetFeatures(const CSSSelector&, Invali
dationSetFeatures&); | 161 const CSSSelector* extractInvalidationSetFeatures(const CSSSelector&, Invali
dationSetFeatures&); |
| 156 void addFeaturesToInvalidationSets(const CSSSelector&, const InvalidationSet
Features&, bool wholeSubtree); | 162 void addFeaturesToInvalidationSets(const CSSSelector&, const InvalidationSet
Features&, bool wholeSubtree); |
| 157 | 163 |
| 158 void addClassToInvalidationSet(const AtomicString& className, Element&); | 164 void addClassToInvalidationSet(const AtomicString& className, Element&); |
| 159 | 165 |
| 160 FeatureMetadata m_metadata; | 166 FeatureMetadata m_metadata; |
| 161 InvalidationSetMap m_classInvalidationSets; | 167 InvalidationSetMap m_classInvalidationSets; |
| 162 InvalidationSetMap m_attributeInvalidationSets; | 168 InvalidationSetMap m_attributeInvalidationSets; |
| 163 InvalidationSetMap m_idInvalidationSets; | 169 InvalidationSetMap m_idInvalidationSets; |
| 170 RefPtr<DescendantInvalidationSet> m_hoverInvalidationSet; |
| 171 RefPtr<DescendantInvalidationSet> m_activeInvalidationSet; |
| 172 RefPtr<DescendantInvalidationSet> m_focusInvalidationSet; |
| 164 bool m_targetedStyleRecalcEnabled; | 173 bool m_targetedStyleRecalcEnabled; |
| 165 StyleInvalidator m_styleInvalidator; | 174 StyleInvalidator m_styleInvalidator; |
| 166 }; | 175 }; |
| 167 | 176 |
| 168 | 177 |
| 169 } // namespace WebCore | 178 } // namespace WebCore |
| 170 | 179 |
| 171 #endif // RuleFeature_h | 180 #endif // RuleFeature_h |
| OLD | NEW |