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. | 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 27 matching lines...) Expand all Loading... |
38 #include "wtf/HashMap.h" | 38 #include "wtf/HashMap.h" |
39 #include "wtf/HashSet.h" | 39 #include "wtf/HashSet.h" |
40 #include "wtf/ListHashSet.h" | 40 #include "wtf/ListHashSet.h" |
41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
42 #include "wtf/Vector.h" | 42 #include "wtf/Vector.h" |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class AnimatableValue; | 46 class AnimatableValue; |
47 class CSSRuleList; | 47 class CSSRuleList; |
48 class CSSStyleSheet; | |
49 class CSSValue; | 48 class CSSValue; |
50 class Document; | 49 class Document; |
51 class Element; | 50 class Element; |
52 class Interpolation; | 51 class Interpolation; |
53 class MatchResult; | 52 class MatchResult; |
54 class MediaQueryEvaluator; | 53 class MediaQueryEvaluator; |
55 class RuleSet; | 54 class RuleSet; |
56 class StylePropertySet; | 55 class StylePropertySet; |
57 class StyleRule; | 56 class StyleRule; |
58 class StyleRuleUsageTracker; | 57 class StyleRuleUsageTracker; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 PassRefPtr<ComputedStyle> pseudoStyleForElement( | 98 PassRefPtr<ComputedStyle> pseudoStyleForElement( |
100 Element*, | 99 Element*, |
101 const PseudoStyleRequest&, | 100 const PseudoStyleRequest&, |
102 const ComputedStyle* parentStyle); | 101 const ComputedStyle* parentStyle); |
103 | 102 |
104 PassRefPtr<ComputedStyle> styleForPage(int pageIndex); | 103 PassRefPtr<ComputedStyle> styleForPage(int pageIndex); |
105 PassRefPtr<ComputedStyle> styleForText(Text*); | 104 PassRefPtr<ComputedStyle> styleForText(Text*); |
106 | 105 |
107 static PassRefPtr<ComputedStyle> styleForDocument(Document&); | 106 static PassRefPtr<ComputedStyle> styleForDocument(Document&); |
108 | 107 |
109 // FIXME: It could be better to call appendAuthorStyleSheets() directly after | |
110 // we factor StyleResolver further. | |
111 // https://bugs.webkit.org/show_bug.cgi?id=108890 | |
112 void appendAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); | |
113 void lazyAppendAuthorStyleSheets(unsigned firstNew, | |
114 const HeapVector<Member<CSSStyleSheet>>&); | |
115 void removePendingAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); | |
116 void appendPendingAuthorStyleSheets(); | |
117 bool hasPendingAuthorStyleSheets() const { | |
118 return m_pendingStyleSheets.size() > 0; | |
119 } | |
120 | |
121 // TODO(esprehn): StyleResolver should probably not contain tree walking | 108 // TODO(esprehn): StyleResolver should probably not contain tree walking |
122 // state, instead we should pass a context object during recalcStyle. | 109 // state, instead we should pass a context object during recalcStyle. |
123 SelectorFilter& selectorFilter() { return m_selectorFilter; } | 110 SelectorFilter& selectorFilter() { return m_selectorFilter; } |
124 | 111 |
125 StyleRuleKeyframes* findKeyframesRule(const Element*, | 112 StyleRuleKeyframes* findKeyframesRule(const Element*, |
126 const AtomicString& animationName); | 113 const AtomicString& animationName); |
127 | 114 |
128 // These methods will give back the set of rules that matched for a given | 115 // These methods will give back the set of rules that matched for a given |
129 // element (or a pseudo-element). | 116 // element (or a pseudo-element). |
130 enum CSSRuleFilter { | 117 enum CSSRuleFilter { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 PassRefPtr<ComputedStyle> initialStyleForElement(); | 165 PassRefPtr<ComputedStyle> initialStyleForElement(); |
179 | 166 |
180 // FIXME: This should probably go away, folded into FontBuilder. | 167 // FIXME: This should probably go away, folded into FontBuilder. |
181 void updateFont(StyleResolverState&); | 168 void updateFont(StyleResolverState&); |
182 | 169 |
183 void addMatchedRulesToTracker(const ElementRuleCollector&); | 170 void addMatchedRulesToTracker(const ElementRuleCollector&); |
184 | 171 |
185 void loadPendingResources(StyleResolverState&); | 172 void loadPendingResources(StyleResolverState&); |
186 void adjustComputedStyle(StyleResolverState&, Element*); | 173 void adjustComputedStyle(StyleResolverState&, Element*); |
187 | 174 |
188 void appendCSSStyleSheet(CSSStyleSheet&); | |
189 | |
190 void collectPseudoRulesForElement(const Element&, | 175 void collectPseudoRulesForElement(const Element&, |
191 ElementRuleCollector&, | 176 ElementRuleCollector&, |
192 PseudoId, | 177 PseudoId, |
193 unsigned rulesToInclude); | 178 unsigned rulesToInclude); |
194 void matchRuleSet(ElementRuleCollector&, RuleSet*); | 179 void matchRuleSet(ElementRuleCollector&, RuleSet*); |
195 void matchUARules(ElementRuleCollector&); | 180 void matchUARules(ElementRuleCollector&); |
196 void matchScopedRules(const Element&, ElementRuleCollector&); | 181 void matchScopedRules(const Element&, ElementRuleCollector&); |
197 void matchAuthorRules(const Element&, ElementRuleCollector&); | 182 void matchAuthorRules(const Element&, ElementRuleCollector&); |
198 void matchAuthorRulesV0(const Element&, ElementRuleCollector&); | 183 void matchAuthorRulesV0(const Element&, ElementRuleCollector&); |
199 void matchAllRules(StyleResolverState&, | 184 void matchAllRules(StyleResolverState&, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 PseudoElement* createPseudoElement(Element* parent, PseudoId); | 254 PseudoElement* createPseudoElement(Element* parent, PseudoId); |
270 | 255 |
271 Document& document() const { return *m_document; } | 256 Document& document() const { return *m_document; } |
272 | 257 |
273 static ComputedStyle* s_styleNotYetAvailable; | 258 static ComputedStyle* s_styleNotYetAvailable; |
274 | 259 |
275 MatchedPropertiesCache m_matchedPropertiesCache; | 260 MatchedPropertiesCache m_matchedPropertiesCache; |
276 Member<Document> m_document; | 261 Member<Document> m_document; |
277 SelectorFilter m_selectorFilter; | 262 SelectorFilter m_selectorFilter; |
278 | 263 |
279 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; | |
280 | |
281 Member<StyleRuleUsageTracker> m_tracker; | 264 Member<StyleRuleUsageTracker> m_tracker; |
282 | 265 |
283 bool m_printMediaType = false; | 266 bool m_printMediaType = false; |
284 | 267 |
285 unsigned m_styleSharingDepth = 0; | 268 unsigned m_styleSharingDepth = 0; |
286 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> | 269 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> |
287 m_styleSharingLists; | 270 m_styleSharingLists; |
288 }; | 271 }; |
289 | 272 |
290 } // namespace blink | 273 } // namespace blink |
291 | 274 |
292 #endif // StyleResolver_h | 275 #endif // StyleResolver_h |
OLD | NEW |