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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.h

Issue 848483003: Simplify media query handling for stylesheets. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 * 19 *
20 */ 20 */
21 21
22 #ifndef SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ 22 #ifndef SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_
23 #define SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ 23 #define SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_
24 24
25 #include "sky/engine/core/css/MediaQueryEvaluator.h" 25 #include "sky/engine/core/css/MediaQueryEvaluator.h"
26 #include "sky/engine/core/css/resolver/MatchedPropertiesCache.h" 26 #include "sky/engine/core/css/resolver/MatchedPropertiesCache.h"
27 #include "sky/engine/core/css/resolver/MediaQueryResult.h"
28 #include "sky/engine/core/css/resolver/ScopedStyleResolver.h" 27 #include "sky/engine/core/css/resolver/ScopedStyleResolver.h"
29 #include "sky/engine/core/css/resolver/StyleResourceLoader.h" 28 #include "sky/engine/core/css/resolver/StyleResourceLoader.h"
30 #include "sky/engine/platform/heap/Handle.h" 29 #include "sky/engine/platform/heap/Handle.h"
31 #include "sky/engine/wtf/Deque.h" 30 #include "sky/engine/wtf/Deque.h"
32 #include "sky/engine/wtf/HashMap.h" 31 #include "sky/engine/wtf/HashMap.h"
33 #include "sky/engine/wtf/RefPtr.h" 32 #include "sky/engine/wtf/RefPtr.h"
34 #include "sky/engine/wtf/Vector.h" 33 #include "sky/engine/wtf/Vector.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop edStyleResolver>, 8>&); 84 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop edStyleResolver>, 8>&);
86 85
87 // |properties| is an array with |count| elements. 86 // |properties| is an array with |count| elements.
88 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*); 87 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count , RenderStyle*);
89 88
90 bool mediaQueryAffectedByViewportChange() const; 89 bool mediaQueryAffectedByViewportChange() const;
91 90
92 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something . 91 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something .
93 void invalidateMatchedPropertiesCache(); 92 void invalidateMatchedPropertiesCache();
94 93
95 MediaQueryEvaluator& medium() const { return *m_medium; }
96
97 void resetMediaQueryAffectedByViewportChange();
98 void addMediaQueryAffectedByViewportChange(const MediaQueryResultList&);
99
100 void notifyResizeForViewportUnits(); 94 void notifyResizeForViewportUnits();
101 95
102 StyleSharingList& styleSharingList() { return m_styleSharingList; } 96 StyleSharingList& styleSharingList() { return m_styleSharingList; }
103 97
104 void addToStyleSharingList(Element&); 98 void addToStyleSharingList(Element&);
105 void clearStyleSharingList(); 99 void clearStyleSharingList();
106 100
107 StyleResolverStats* stats() { return m_styleResolverStats.get(); } 101 StyleResolverStats* stats() { return m_styleResolverStats.get(); }
108 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get(); } 102 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get(); }
109 enum StatsReportType { ReportDefaultStats, ReportSlowStats }; 103 enum StatsReportType { ReportDefaultStats, ReportSlowStats };
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 template <StyleApplicationPass pass> 136 template <StyleApplicationPass pass>
143 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly); 137 void applyProperties(StyleResolverState&, const StylePropertySet* properties , bool isImportant, bool inheritedOnly);
144 template <StyleApplicationPass pass> 138 template <StyleApplicationPass pass>
145 void applyAnimatedProperties(StyleResolverState&, const HashMap<CSSPropertyI D, RefPtr<Interpolation> >&); 139 void applyAnimatedProperties(StyleResolverState&, const HashMap<CSSPropertyI D, RefPtr<Interpolation> >&);
146 template <StyleResolver::StyleApplicationPass pass> 140 template <StyleResolver::StyleApplicationPass pass>
147 void applyAllProperty(StyleResolverState&, CSSValue*); 141 void applyAllProperty(StyleResolverState&, CSSValue*);
148 142
149 MatchedPropertiesCache m_matchedPropertiesCache; 143 MatchedPropertiesCache m_matchedPropertiesCache;
150 144
151 OwnPtr<MediaQueryEvaluator> m_medium; 145 OwnPtr<MediaQueryEvaluator> m_medium;
152 MediaQueryResultList m_viewportDependentMediaQueryResults;
153 146
154 RawPtr<Document> m_document; 147 RawPtr<Document> m_document;
155 148
156 bool m_printMediaType;
157
158 StyleResourceLoader m_styleResourceLoader; 149 StyleResourceLoader m_styleResourceLoader;
159 150
160 StyleSharingList m_styleSharingList; 151 StyleSharingList m_styleSharingList;
161 152
162 OwnPtr<StyleResolverStats> m_styleResolverStats; 153 OwnPtr<StyleResolverStats> m_styleResolverStats;
163 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; 154 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals;
164 unsigned m_styleResolverStatsSequence; 155 unsigned m_styleResolverStatsSequence;
165 156
166 // Use only for Internals::updateStyleAndReturnAffectedElementCount. 157 // Use only for Internals::updateStyleAndReturnAffectedElementCount.
167 unsigned m_accessCount; 158 unsigned m_accessCount;
168 }; 159 };
169 160
170 } // namespace blink 161 } // namespace blink
171 162
172 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ 163 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/resolver/ScopedStyleResolver.cpp ('k') | sky/engine/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698