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

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

Issue 2405143003: Separate @viewport from other RuleSet construction. (Closed)
Patch Set: Missing resolve() Created 4 years, 2 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. 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 class CSSValue; 52 class CSSValue;
53 class ContainerNode; 53 class ContainerNode;
54 class Document; 54 class Document;
55 class Element; 55 class Element;
56 class Interpolation; 56 class Interpolation;
57 class MatchResult; 57 class MatchResult;
58 class MediaQueryEvaluator; 58 class MediaQueryEvaluator;
59 class ScopedStyleResolver; 59 class ScopedStyleResolver;
60 class StylePropertySet; 60 class StylePropertySet;
61 class StyleRule; 61 class StyleRule;
62 class ViewportStyleResolver;
63 62
64 enum StyleSharingBehavior { 63 enum StyleSharingBehavior {
65 AllowStyleSharing, 64 AllowStyleSharing,
66 DisallowStyleSharing, 65 DisallowStyleSharing,
67 }; 66 };
68 67
69 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL }; 68 enum RuleMatchingBehavior { MatchAllRules, MatchAllRulesExcludingSMIL };
70 69
71 const unsigned styleSharingListSize = 15; 70 const unsigned styleSharingListSize = 15;
72 const unsigned styleSharingMaxDepth = 32; 71 const unsigned styleSharingMaxDepth = 32;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 Element*, 147 Element*,
149 unsigned rulesToInclude = AllButEmptyCSSRules); 148 unsigned rulesToInclude = AllButEmptyCSSRules);
150 CSSRuleList* pseudoCSSRulesForElement( 149 CSSRuleList* pseudoCSSRulesForElement(
151 Element*, 150 Element*,
152 PseudoId, 151 PseudoId,
153 unsigned rulesToInclude = AllButEmptyCSSRules); 152 unsigned rulesToInclude = AllButEmptyCSSRules);
154 StyleRuleList* styleRulesForElement(Element*, unsigned rulesToInclude); 153 StyleRuleList* styleRulesForElement(Element*, unsigned rulesToInclude);
155 154
156 void computeFont(ComputedStyle*, const StylePropertySet&); 155 void computeFont(ComputedStyle*, const StylePropertySet&);
157 156
158 ViewportStyleResolver* viewportStyleResolver() {
159 return m_viewportStyleResolver.get();
160 }
161
162 void addViewportDependentMediaQueries(const MediaQueryResultList&); 157 void addViewportDependentMediaQueries(const MediaQueryResultList&);
163 bool hasViewportDependentMediaQueries() const { 158 bool hasViewportDependentMediaQueries() const {
164 return !m_viewportDependentMediaQueryResults.isEmpty(); 159 return !m_viewportDependentMediaQueryResults.isEmpty();
165 } 160 }
166 bool mediaQueryAffectedByViewportChange() const; 161 bool mediaQueryAffectedByViewportChange() const;
167 void addDeviceDependentMediaQueries(const MediaQueryResultList&); 162 void addDeviceDependentMediaQueries(const MediaQueryResultList&);
168 bool mediaQueryAffectedByDeviceChange() const; 163 bool mediaQueryAffectedByDeviceChange() const;
169 164
170 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something. 165 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something.
171 void invalidateMatchedPropertiesCache(); 166 void invalidateMatchedPropertiesCache();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 270
276 MatchedPropertiesCache m_matchedPropertiesCache; 271 MatchedPropertiesCache m_matchedPropertiesCache;
277 272
278 Member<MediaQueryEvaluator> m_medium; 273 Member<MediaQueryEvaluator> m_medium;
279 MediaQueryResultList m_viewportDependentMediaQueryResults; 274 MediaQueryResultList m_viewportDependentMediaQueryResults;
280 MediaQueryResultList m_deviceDependentMediaQueryResults; 275 MediaQueryResultList m_deviceDependentMediaQueryResults;
281 276
282 Member<Document> m_document; 277 Member<Document> m_document;
283 SelectorFilter m_selectorFilter; 278 SelectorFilter m_selectorFilter;
284 279
285 Member<ViewportStyleResolver> m_viewportStyleResolver;
286
287 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; 280 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets;
288 281
289 // FIXME: The entire logic of collecting features on StyleResolver, as well as 282 // FIXME: The entire logic of collecting features on StyleResolver, as well as
290 // transferring them between various parts of machinery smells wrong. This 283 // transferring them between various parts of machinery smells wrong. This
291 // needs to be better somehow. 284 // needs to be better somehow.
292 RuleFeatureSet m_features; 285 RuleFeatureSet m_features;
293 Member<RuleSet> m_siblingRuleSet; 286 Member<RuleSet> m_siblingRuleSet;
294 Member<RuleSet> m_uncommonAttributeRuleSet; 287 Member<RuleSet> m_uncommonAttributeRuleSet;
295 Member<RuleSet> m_watchedSelectorsRules; 288 Member<RuleSet> m_watchedSelectorsRules;
296 289
297 DocumentOrderedList m_treeBoundaryCrossingScopes; 290 DocumentOrderedList m_treeBoundaryCrossingScopes;
298 291
299 bool m_needCollectFeatures; 292 bool m_needCollectFeatures;
300 bool m_printMediaType; 293 bool m_printMediaType;
301 bool m_hasFullscreenUAStyle = false; 294 bool m_hasFullscreenUAStyle = false;
302 295
303 unsigned m_styleSharingDepth; 296 unsigned m_styleSharingDepth;
304 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> 297 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth>
305 m_styleSharingLists; 298 m_styleSharingLists;
306 }; 299 };
307 300
308 } // namespace blink 301 } // namespace blink
309 302
310 #endif // StyleResolver_h 303 #endif // StyleResolver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698