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

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

Issue 204873003: Factor the style invalidation tree walk out of RuleFeatureSet, and make it generic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move code around. Created 6 years, 9 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 inline bool hasSelectorForAttribute(const AtomicString& attributeName) const 69 inline bool hasSelectorForAttribute(const AtomicString& attributeName) const
70 { 70 {
71 ASSERT(!attributeName.isEmpty()); 71 ASSERT(!attributeName.isEmpty());
72 return m_metadata.attrsInRules.contains(attributeName); 72 return m_metadata.attrsInRules.contains(attributeName);
73 } 73 }
74 74
75 inline bool hasSelectorForClass(const AtomicString& classValue) const 75 inline bool hasSelectorForClass(const AtomicString& classValue) const
76 { 76 {
77 ASSERT(!classValue.isEmpty()); 77 ASSERT(!classValue.isEmpty());
78 return m_classInvalidationSets.get(classValue); 78 return m_classInvalidationSets.get(classValue);
79
80 } 79 }
81 80
82 inline bool hasSelectorForId(const AtomicString& idValue) const 81 inline bool hasSelectorForId(const AtomicString& idValue) const
83 { 82 {
84 return m_metadata.idsInRules.contains(idValue); 83 return m_metadata.idsInRules.contains(idValue);
85 } 84 }
86 85
87 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed Classes, Element*); 86 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changed Classes, Element*);
88 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas ses, const SpaceSplitString& newClasses, Element*); 87 void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClas ses, const SpaceSplitString& newClasses, Element*);
89 88
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 static InvalidationSetMode supportsClassDescendantInvalidation(const CSSSele ctor&); 132 static InvalidationSetMode supportsClassDescendantInvalidation(const CSSSele ctor&);
134 133
135 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Inval idationSetMode); 134 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Inval idationSetMode);
136 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata &, InvalidationSetMode); 135 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata &, InvalidationSetMode);
137 136
138 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName); 137 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName);
139 InvalidationSetMode updateClassInvalidationSets(const CSSSelector&); 138 InvalidationSetMode updateClassInvalidationSets(const CSSSelector&);
140 139
141 void addClassToInvalidationSet(const AtomicString& className, Element*); 140 void addClassToInvalidationSet(const AtomicString& className, Element*);
142 141
143 bool invalidateStyleForClassChange(Element*, Vector<AtomicString>&, bool fou ndInvalidationSet);
144 bool invalidateStyleForClassChangeOnChildren(Element*, Vector<AtomicString>& invalidationClasses, bool foundInvalidationSet);
145
146 InvalidationList& ensurePendingInvalidationList(Element*); 142 InvalidationList& ensurePendingInvalidationList(Element*);
147 143
148 FeatureMetadata m_metadata; 144 FeatureMetadata m_metadata;
149 InvalidationSetMap m_classInvalidationSets; 145 InvalidationSetMap m_classInvalidationSets;
150 PendingInvalidationMap m_pendingInvalidationMap; 146 PendingInvalidationMap m_pendingInvalidationMap;
151 147
152 bool m_targetedStyleRecalcEnabled; 148 bool m_targetedStyleRecalcEnabled;
149
150 friend class StyleInvalidationTreeWalk;
153 }; 151 };
154 152
153
155 } // namespace WebCore 154 } // namespace WebCore
156 155
157 #endif // RuleFeature_h 156 #endif // RuleFeature_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698