OLD | NEW |
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 PassRefPtr<RenderStyle> defaultStyleForElement(); | 94 PassRefPtr<RenderStyle> defaultStyleForElement(); |
95 PassRefPtr<RenderStyle> styleForText(Text*); | 95 PassRefPtr<RenderStyle> styleForText(Text*); |
96 | 96 |
97 static PassRefPtr<RenderStyle> styleForDocument(Document&); | 97 static PassRefPtr<RenderStyle> styleForDocument(Document&); |
98 | 98 |
99 // FIXME: This only has 5 callers and should be removed. Callers should be e
xplicit about | 99 // FIXME: This only has 5 callers and should be removed. Callers should be e
xplicit about |
100 // their dependency on Document* instead of grabbing one through StyleResolv
er. | 100 // their dependency on Document* instead of grabbing one through StyleResolv
er. |
101 Document& document() { return *m_document; } | 101 Document& document() { return *m_document; } |
102 | 102 |
103 // FIXME: It could be better to call appendAuthorStyleSheets() directly afte
r we factor StyleResolver further. | |
104 // https://bugs.webkit.org/show_bug.cgi?id=108890 | |
105 void appendAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&); | |
106 void finishAppendAuthorStyleSheets(); | |
107 | |
108 void lazyAppendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSS
tyleSheet> >&); | |
109 void removePendingAuthorStyleSheets(const Vector<RefPtr<CSSStyleSheet> >&); | |
110 void appendPendingAuthorStyleSheets(); | |
111 bool hasPendingAuthorStyleSheets() const { return m_pendingStyleSheets.size(
) > 0; } | |
112 | |
113 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop
edStyleResolver>, 8>&); | 103 void styleTreeResolveScopedKeyframesRules(const Element*, Vector<RawPtr<Scop
edStyleResolver>, 8>&); |
114 | 104 |
115 // |properties| is an array with |count| elements. | 105 // |properties| is an array with |count| elements. |
116 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); | 106 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); |
117 | 107 |
118 bool mediaQueryAffectedByViewportChange() const; | 108 bool mediaQueryAffectedByViewportChange() const; |
119 | 109 |
120 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. | 110 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. |
121 void invalidateMatchedPropertiesCache(); | 111 void invalidateMatchedPropertiesCache(); |
122 | 112 |
| 113 void appendCSSStyleSheet(CSSStyleSheet*); |
| 114 |
123 void notifyResizeForViewportUnits(); | 115 void notifyResizeForViewportUnits(); |
124 | 116 |
125 StyleSharingList& styleSharingList() { return m_styleSharingList; } | 117 StyleSharingList& styleSharingList() { return m_styleSharingList; } |
126 | 118 |
127 void addToStyleSharingList(Element&); | 119 void addToStyleSharingList(Element&); |
128 void clearStyleSharingList(); | 120 void clearStyleSharingList(); |
129 | 121 |
130 StyleResolverStats* stats() { return m_styleResolverStats.get(); } | 122 StyleResolverStats* stats() { return m_styleResolverStats.get(); } |
131 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get();
} | 123 StyleResolverStats* statsTotals() { return m_styleResolverStatsTotals.get();
} |
132 enum StatsReportType { ReportDefaultStats, ReportSlowStats }; | 124 enum StatsReportType { ReportDefaultStats, ReportSlowStats }; |
133 void enableStats(StatsReportType = ReportDefaultStats); | 125 void enableStats(StatsReportType = ReportDefaultStats); |
134 void disableStats(); | 126 void disableStats(); |
135 void printStats(); | 127 void printStats(); |
136 | 128 |
137 unsigned accessCount() const { return m_accessCount; } | 129 unsigned accessCount() const { return m_accessCount; } |
138 void didAccess() { ++m_accessCount; } | 130 void didAccess() { ++m_accessCount; } |
139 | 131 |
140 private: | 132 private: |
141 // FIXME: This should probably go away, folded into FontBuilder. | 133 // FIXME: This should probably go away, folded into FontBuilder. |
142 void updateFont(StyleResolverState&); | 134 void updateFont(StyleResolverState&); |
143 | 135 |
144 void loadPendingResources(StyleResolverState&); | 136 void loadPendingResources(StyleResolverState&); |
145 | 137 |
146 void appendCSSStyleSheet(CSSStyleSheet*); | |
147 | |
148 void matchAuthorRules(Element*, ElementRuleCollector&); | 138 void matchAuthorRules(Element*, ElementRuleCollector&); |
149 void matchAllRules(StyleResolverState&, ElementRuleCollector&); | 139 void matchAllRules(StyleResolverState&, ElementRuleCollector&); |
150 void matchUARules(ElementRuleCollector&); | 140 void matchUARules(ElementRuleCollector&); |
151 | 141 |
152 void applyMatchedProperties(StyleResolverState&, const MatchResult&); | 142 void applyMatchedProperties(StyleResolverState&, const MatchResult&); |
153 bool applyAnimatedProperties(StyleResolverState&, Element* animatingElement)
; | 143 bool applyAnimatedProperties(StyleResolverState&, Element* animatingElement)
; |
154 | 144 |
155 enum StyleApplicationPass { | 145 enum StyleApplicationPass { |
156 HighPriorityProperties, | 146 HighPriorityProperties, |
157 LowPriorityProperties | 147 LowPriorityProperties |
(...skipping 13 matching lines...) Expand all Loading... |
171 template <StyleResolver::StyleApplicationPass pass> | 161 template <StyleResolver::StyleApplicationPass pass> |
172 void applyAllProperty(StyleResolverState&, CSSValue*); | 162 void applyAllProperty(StyleResolverState&, CSSValue*); |
173 | 163 |
174 MatchedPropertiesCache m_matchedPropertiesCache; | 164 MatchedPropertiesCache m_matchedPropertiesCache; |
175 | 165 |
176 OwnPtr<MediaQueryEvaluator> m_medium; | 166 OwnPtr<MediaQueryEvaluator> m_medium; |
177 MediaQueryResultList m_viewportDependentMediaQueryResults; | 167 MediaQueryResultList m_viewportDependentMediaQueryResults; |
178 | 168 |
179 RawPtr<Document> m_document; | 169 RawPtr<Document> m_document; |
180 | 170 |
181 ListHashSet<RawPtr<CSSStyleSheet>, 16> m_pendingStyleSheets; | |
182 | |
183 bool m_printMediaType; | 171 bool m_printMediaType; |
184 | 172 |
185 StyleResourceLoader m_styleResourceLoader; | 173 StyleResourceLoader m_styleResourceLoader; |
186 | 174 |
187 StyleSharingList m_styleSharingList; | 175 StyleSharingList m_styleSharingList; |
188 | 176 |
189 OwnPtr<StyleResolverStats> m_styleResolverStats; | 177 OwnPtr<StyleResolverStats> m_styleResolverStats; |
190 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 178 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
191 unsigned m_styleResolverStatsSequence; | 179 unsigned m_styleResolverStatsSequence; |
192 | 180 |
193 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 181 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
194 unsigned m_accessCount; | 182 unsigned m_accessCount; |
195 }; | 183 }; |
196 | 184 |
197 } // namespace blink | 185 } // namespace blink |
198 | 186 |
199 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ | 187 #endif // SKY_ENGINE_CORE_CSS_RESOLVER_STYLERESOLVER_H_ |
OLD | NEW |