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

Side by Side Diff: Source/core/css/resolver/StyleResolver.h

Issue 892643002: Split property priority functions out of StyleResolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use template class CSSPropertyPriority. Created 5 years, 10 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 12 matching lines...) Expand all
23 #define StyleResolver_h 23 #define StyleResolver_h
24 24
25 #include "core/css/ElementRuleCollector.h" 25 #include "core/css/ElementRuleCollector.h"
26 #include "core/css/PseudoStyleRequest.h" 26 #include "core/css/PseudoStyleRequest.h"
27 #include "core/css/RuleFeature.h" 27 #include "core/css/RuleFeature.h"
28 #include "core/css/RuleSet.h" 28 #include "core/css/RuleSet.h"
29 #include "core/css/SelectorChecker.h" 29 #include "core/css/SelectorChecker.h"
30 #include "core/css/SelectorFilter.h" 30 #include "core/css/SelectorFilter.h"
31 #include "core/css/SiblingTraversalStrategies.h" 31 #include "core/css/SiblingTraversalStrategies.h"
32 #include "core/css/TreeBoundaryCrossingRules.h" 32 #include "core/css/TreeBoundaryCrossingRules.h"
33 #include "core/css/resolver/CSSPropertyPriority.h"
33 #include "core/css/resolver/MatchedPropertiesCache.h" 34 #include "core/css/resolver/MatchedPropertiesCache.h"
34 #include "core/css/resolver/StyleBuilder.h" 35 #include "core/css/resolver/StyleBuilder.h"
35 #include "core/css/resolver/StyleResourceLoader.h" 36 #include "core/css/resolver/StyleResourceLoader.h"
36 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
37 #include "wtf/Deque.h" 38 #include "wtf/Deque.h"
38 #include "wtf/HashMap.h" 39 #include "wtf/HashMap.h"
39 #include "wtf/HashSet.h" 40 #include "wtf/HashSet.h"
40 #include "wtf/ListHashSet.h" 41 #include "wtf/ListHashSet.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties); 220 void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeS MILProperties);
220 void collectFeatures(); 221 void collectFeatures();
221 void resetRuleFeatures(); 222 void resetRuleFeatures();
222 223
223 bool fastRejectSelector(const RuleData&) const; 224 bool fastRejectSelector(const RuleData&) const;
224 225
225 void applyMatchedProperties(StyleResolverState&, const MatchResult&); 226 void applyMatchedProperties(StyleResolverState&, const MatchResult&);
226 bool applyAnimatedProperties(StyleResolverState&, const Element* animatingEl ement); 227 bool applyAnimatedProperties(StyleResolverState&, const Element* animatingEl ement);
227 void applyCallbackSelectors(StyleResolverState&); 228 void applyCallbackSelectors(StyleResolverState&);
228 229
229 enum StyleApplicationPass { 230 template <CSSPropertyPriority priority>
230 HighPriorityProperties,
231 LowPriorityProperties
232 };
233 template <StyleResolver::StyleApplicationPass pass>
234 static inline CSSPropertyID firstCSSPropertyId();
235 template <StyleResolver::StyleApplicationPass pass>
236 static inline CSSPropertyID lastCSSPropertyId();
237 template <StyleResolver::StyleApplicationPass pass>
238 static inline bool isPropertyForPass(CSSPropertyID);
239 template <StyleApplicationPass pass>
240 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly); 231 void applyMatchedProperties(StyleResolverState&, const MatchResult&, bool im portant, int startIndex, int endIndex, bool inheritedOnly);
241 template <StyleApplicationPass pass> 232 template <CSSPropertyPriority priority>
242 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelis tNone); 233 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly, PropertyWhitelistType = PropertyWhitelis tNone);
243 template <StyleApplicationPass pass> 234 template <CSSPropertyPriority priority>
244 void applyAnimatedProperties(StyleResolverState&, const WillBeHeapHashMap<CS SPropertyID, RefPtrWillBeMember<Interpolation> >&); 235 void applyAnimatedProperties(StyleResolverState&, const WillBeHeapHashMap<CS SPropertyID, RefPtrWillBeMember<Interpolation> >&);
245 template <StyleResolver::StyleApplicationPass pass> 236 template <CSSPropertyPriority priority>
246 void applyAllProperty(StyleResolverState&, CSSValue*, bool inheritedOnly); 237 void applyAllProperty(StyleResolverState&, CSSValue*, bool inheritedOnly);
247 238
248 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName); 239 void matchPageRules(MatchResult&, RuleSet*, bool isLeftPage, bool isFirstPag e, const String& pageName);
249 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName); 240 void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage > >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >&, bool isLeftPage, bool isFirstPage, const String& pageName);
250 void collectViewportRules(); 241 void collectViewportRules();
251 242
252 bool isLeftPage(int pageIndex) const; 243 bool isLeftPage(int pageIndex) const;
253 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); } 244 bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
254 bool isFirstPage(int pageIndex) const; 245 bool isFirstPage(int pageIndex) const;
255 String pageName(int pageIndex) const; 246 String pageName(int pageIndex) const;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 287 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
297 unsigned m_styleResolverStatsSequence; 288 unsigned m_styleResolverStatsSequence;
298 289
299 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 290 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
300 unsigned m_accessCount; 291 unsigned m_accessCount;
301 }; 292 };
302 293
303 } // namespace blink 294 } // namespace blink
304 295
305 #endif // StyleResolver_h 296 #endif // StyleResolver_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/CSSPropertyPriority.h ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698