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

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

Issue 183583002: Use the invalidation tree walk for all class mutations, not just those that support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixl 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void add(const FeatureMetadata& other); 113 void add(const FeatureMetadata& other);
114 void clear(); 114 void clear();
115 115
116 bool usesFirstLineRules; 116 bool usesFirstLineRules;
117 bool foundSiblingSelector; 117 bool foundSiblingSelector;
118 unsigned maxDirectAdjacentSelectors; 118 unsigned maxDirectAdjacentSelectors;
119 HashSet<AtomicString> idsInRules; 119 HashSet<AtomicString> idsInRules;
120 HashSet<AtomicString> attrsInRules; 120 HashSet<AtomicString> attrsInRules;
121 }; 121 };
122 122
123 // These return true if setNeedsStyleRecalc() should be run on the Element, as a fallback.
124 bool computeInvalidationSetsForClassChange(const SpaceSplitString& changedCl asses, Element*);
125 bool computeInvalidationSetsForClassChange(const SpaceSplitString& oldClasse s, const SpaceSplitString& newClasses, Element*);
126
127 enum SelectorFeatureCollectionMode { 123 enum SelectorFeatureCollectionMode {
128 ProcessClasses, 124 ProcessClasses,
129 DontProcessClasses 125 DontProcessClasses
130 }; 126 };
131 127
132 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Selec torFeatureCollectionMode processClasses); 128 void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, Selec torFeatureCollectionMode processClasses);
133 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata &, SelectorFeatureCollectionMode processClasses); 129 void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata &, SelectorFeatureCollectionMode processClasses);
134 130
135 bool classInvalidationRequiresSubtreeRecalc(const AtomicString& className);
136 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName); 131 DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& cl assName);
137 bool updateClassInvalidationSets(const CSSSelector&); 132 bool updateClassInvalidationSets(const CSSSelector&);
138 133
139 void addClassToInvalidationSet(const AtomicString& className, Element*); 134 void addClassToInvalidationSet(const AtomicString& className, Element*);
140 135
141 bool invalidateStyleForClassChange(Element*, Vector<AtomicString>&, bool fou ndInvalidationSet); 136 bool invalidateStyleForClassChange(Element*, Vector<AtomicString>&, bool fou ndInvalidationSet);
142 bool invalidateStyleForClassChangeOnChildren(Element*, Vector<AtomicString>& invalidationClasses, bool foundInvalidationSet); 137 bool invalidateStyleForClassChangeOnChildren(Element*, Vector<AtomicString>& invalidationClasses, bool foundInvalidationSet);
143 138
144 InvalidationList& ensurePendingInvalidationList(Element*); 139 InvalidationList& ensurePendingInvalidationList(Element*);
145 140
146 FeatureMetadata m_metadata; 141 FeatureMetadata m_metadata;
147 InvalidationSetMap m_classInvalidationSets; 142 InvalidationSetMap m_classInvalidationSets;
148 PendingInvalidationMap m_pendingInvalidationMap; 143 PendingInvalidationMap m_pendingInvalidationMap;
149 144
150 bool m_targetedStyleRecalcEnabled; 145 bool m_targetedStyleRecalcEnabled;
151 }; 146 };
152 147
153 } // namespace WebCore 148 } // namespace WebCore
154 149
155 #endif // RuleFeature_h 150 #endif // RuleFeature_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698