| 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. | 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 16 matching lines...) Expand all Loading... |
| 27 #include "core/css/CSSSelector.h" | 27 #include "core/css/CSSSelector.h" |
| 28 #include "core/css/MediaQueryEvaluator.h" | 28 #include "core/css/MediaQueryEvaluator.h" |
| 29 #include "core/css/invalidation/InvalidationSet.h" | 29 #include "core/css/invalidation/InvalidationSet.h" |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
| 32 #include "wtf/HashSet.h" | 32 #include "wtf/HashSet.h" |
| 33 #include "wtf/text/AtomicStringHash.h" | 33 #include "wtf/text/AtomicStringHash.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class ContainerNode; |
| 37 struct InvalidationLists; | 38 struct InvalidationLists; |
| 38 class QualifiedName; | 39 class QualifiedName; |
| 39 class RuleData; | 40 class RuleData; |
| 40 class StyleRule; | 41 class StyleRule; |
| 41 | 42 |
| 42 struct RuleFeature { | 43 struct RuleFeature { |
| 43 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 44 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 44 | 45 |
| 45 public: | 46 public: |
| 46 RuleFeature(StyleRule*, | 47 RuleFeature(StyleRule*, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 const AtomicString& id, | 146 const AtomicString& id, |
| 146 unsigned minDirectAdjacent) const; | 147 unsigned minDirectAdjacent) const; |
| 147 void collectSiblingInvalidationSetForAttribute( | 148 void collectSiblingInvalidationSetForAttribute( |
| 148 InvalidationLists&, | 149 InvalidationLists&, |
| 149 Element&, | 150 Element&, |
| 150 const QualifiedName& attributeName, | 151 const QualifiedName& attributeName, |
| 151 unsigned minDirectAdjacent) const; | 152 unsigned minDirectAdjacent) const; |
| 152 void collectUniversalSiblingInvalidationSet(InvalidationLists&, | 153 void collectUniversalSiblingInvalidationSet(InvalidationLists&, |
| 153 unsigned minDirectAdjacent) const; | 154 unsigned minDirectAdjacent) const; |
| 154 void collectNthInvalidationSet(InvalidationLists&) const; | 155 void collectNthInvalidationSet(InvalidationLists&) const; |
| 156 void collectTypeRuleInvalidationSet(InvalidationLists&, ContainerNode&) const; |
| 155 | 157 |
| 156 bool hasIdsInSelectors() const { return m_idInvalidationSets.size() > 0; } | 158 bool hasIdsInSelectors() const { return m_idInvalidationSets.size() > 0; } |
| 157 | 159 |
| 158 DECLARE_TRACE(); | 160 DECLARE_TRACE(); |
| 159 | 161 |
| 160 protected: | 162 protected: |
| 161 InvalidationSet* invalidationSetForSimpleSelector(const CSSSelector&, | 163 InvalidationSet* invalidationSetForSimpleSelector(const CSSSelector&, |
| 162 InvalidationType); | 164 InvalidationType); |
| 163 | 165 |
| 164 private: | 166 private: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 193 InvalidationType); | 195 InvalidationType); |
| 194 InvalidationSet& ensureAttributeInvalidationSet( | 196 InvalidationSet& ensureAttributeInvalidationSet( |
| 195 const AtomicString& attributeName, | 197 const AtomicString& attributeName, |
| 196 InvalidationType); | 198 InvalidationType); |
| 197 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, | 199 InvalidationSet& ensureIdInvalidationSet(const AtomicString& id, |
| 198 InvalidationType); | 200 InvalidationType); |
| 199 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, | 201 InvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType, |
| 200 InvalidationType); | 202 InvalidationType); |
| 201 SiblingInvalidationSet& ensureUniversalSiblingInvalidationSet(); | 203 SiblingInvalidationSet& ensureUniversalSiblingInvalidationSet(); |
| 202 DescendantInvalidationSet& ensureNthInvalidationSet(); | 204 DescendantInvalidationSet& ensureNthInvalidationSet(); |
| 205 DescendantInvalidationSet& ensureTypeRuleInvalidationSet(); |
| 203 | 206 |
| 204 void updateInvalidationSets(const RuleData&); | 207 void updateInvalidationSets(const RuleData&); |
| 205 void updateInvalidationSetsForContentAttribute(const RuleData&); | 208 void updateInvalidationSetsForContentAttribute(const RuleData&); |
| 206 | 209 |
| 207 struct InvalidationSetFeatures { | 210 struct InvalidationSetFeatures { |
| 208 DISALLOW_NEW(); | 211 DISALLOW_NEW(); |
| 209 | 212 |
| 210 void add(const InvalidationSetFeatures& other); | 213 void add(const InvalidationSetFeatures& other); |
| 211 bool hasFeatures() const; | 214 bool hasFeatures() const; |
| 212 bool hasTagIdClassOrAttribute() const; | 215 bool hasTagIdClassOrAttribute() const; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 282 |
| 280 void addClassToInvalidationSet(const AtomicString& className, Element&); | 283 void addClassToInvalidationSet(const AtomicString& className, Element&); |
| 281 | 284 |
| 282 FeatureMetadata m_metadata; | 285 FeatureMetadata m_metadata; |
| 283 InvalidationSetMap m_classInvalidationSets; | 286 InvalidationSetMap m_classInvalidationSets; |
| 284 InvalidationSetMap m_attributeInvalidationSets; | 287 InvalidationSetMap m_attributeInvalidationSets; |
| 285 InvalidationSetMap m_idInvalidationSets; | 288 InvalidationSetMap m_idInvalidationSets; |
| 286 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; | 289 PseudoTypeInvalidationSetMap m_pseudoInvalidationSets; |
| 287 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet; | 290 RefPtr<SiblingInvalidationSet> m_universalSiblingInvalidationSet; |
| 288 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet; | 291 RefPtr<DescendantInvalidationSet> m_nthInvalidationSet; |
| 292 RefPtr<DescendantInvalidationSet> m_typeRuleInvalidationSet; |
| 289 HeapVector<RuleFeature> m_siblingRules; | 293 HeapVector<RuleFeature> m_siblingRules; |
| 290 HeapVector<RuleFeature> m_uncommonAttributeRules; | 294 HeapVector<RuleFeature> m_uncommonAttributeRules; |
| 291 MediaQueryResultList m_viewportDependentMediaQueryResults; | 295 MediaQueryResultList m_viewportDependentMediaQueryResults; |
| 292 MediaQueryResultList m_deviceDependentMediaQueryResults; | 296 MediaQueryResultList m_deviceDependentMediaQueryResults; |
| 293 | 297 |
| 294 friend class RuleFeatureSetTest; | 298 friend class RuleFeatureSetTest; |
| 295 }; | 299 }; |
| 296 | 300 |
| 297 } // namespace blink | 301 } // namespace blink |
| 298 | 302 |
| 299 #endif // RuleFeature_h | 303 #endif // RuleFeature_h |
| OLD | NEW |