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 26 matching lines...) Expand all Loading... |
37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
38 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
39 #include "wtf/ListHashSet.h" | 39 #include "wtf/ListHashSet.h" |
40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class AnimatableValue; | 45 class AnimatableValue; |
46 class CSSRuleList; | 46 class CSSRuleList; |
47 class CSSStyleSheet; | |
48 class CSSValue; | 47 class CSSValue; |
49 class Document; | 48 class Document; |
50 class Element; | 49 class Element; |
51 class Interpolation; | 50 class Interpolation; |
52 class MatchResult; | 51 class MatchResult; |
53 class RuleSet; | 52 class RuleSet; |
54 class StylePropertySet; | 53 class StylePropertySet; |
55 class StyleRuleUsageTracker; | 54 class StyleRuleUsageTracker; |
56 | 55 |
57 enum StyleSharingBehavior { | 56 enum StyleSharingBehavior { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 PassRefPtr<ComputedStyle> pseudoStyleForElement( | 95 PassRefPtr<ComputedStyle> pseudoStyleForElement( |
97 Element*, | 96 Element*, |
98 const PseudoStyleRequest&, | 97 const PseudoStyleRequest&, |
99 const ComputedStyle* parentStyle); | 98 const ComputedStyle* parentStyle); |
100 | 99 |
101 PassRefPtr<ComputedStyle> styleForPage(int pageIndex); | 100 PassRefPtr<ComputedStyle> styleForPage(int pageIndex); |
102 PassRefPtr<ComputedStyle> styleForText(Text*); | 101 PassRefPtr<ComputedStyle> styleForText(Text*); |
103 | 102 |
104 static PassRefPtr<ComputedStyle> styleForDocument(Document&); | 103 static PassRefPtr<ComputedStyle> styleForDocument(Document&); |
105 | 104 |
106 // FIXME: It could be better to call appendAuthorStyleSheets() directly after | |
107 // we factor StyleResolver further. | |
108 // https://bugs.webkit.org/show_bug.cgi?id=108890 | |
109 void appendAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); | |
110 void lazyAppendAuthorStyleSheets(unsigned firstNew, | |
111 const HeapVector<Member<CSSStyleSheet>>&); | |
112 void removePendingAuthorStyleSheets(const HeapVector<Member<CSSStyleSheet>>&); | |
113 void appendPendingAuthorStyleSheets(); | |
114 bool hasPendingAuthorStyleSheets() const { | |
115 return m_pendingStyleSheets.size() > 0; | |
116 } | |
117 | |
118 // TODO(esprehn): StyleResolver should probably not contain tree walking | 105 // TODO(esprehn): StyleResolver should probably not contain tree walking |
119 // state, instead we should pass a context object during recalcStyle. | 106 // state, instead we should pass a context object during recalcStyle. |
120 SelectorFilter& selectorFilter() { return m_selectorFilter; } | 107 SelectorFilter& selectorFilter() { return m_selectorFilter; } |
121 | 108 |
122 StyleRuleKeyframes* findKeyframesRule(const Element*, | 109 StyleRuleKeyframes* findKeyframesRule(const Element*, |
123 const AtomicString& animationName); | 110 const AtomicString& animationName); |
124 | 111 |
125 // These methods will give back the set of rules that matched for a given | 112 // These methods will give back the set of rules that matched for a given |
126 // element (or a pseudo-element). | 113 // element (or a pseudo-element). |
127 enum CSSRuleFilter { | 114 enum CSSRuleFilter { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 PassRefPtr<ComputedStyle> initialStyleForElement(); | 162 PassRefPtr<ComputedStyle> initialStyleForElement(); |
176 | 163 |
177 // FIXME: This should probably go away, folded into FontBuilder. | 164 // FIXME: This should probably go away, folded into FontBuilder. |
178 void updateFont(StyleResolverState&); | 165 void updateFont(StyleResolverState&); |
179 | 166 |
180 void addMatchedRulesToTracker(const ElementRuleCollector&); | 167 void addMatchedRulesToTracker(const ElementRuleCollector&); |
181 | 168 |
182 void loadPendingResources(StyleResolverState&); | 169 void loadPendingResources(StyleResolverState&); |
183 void adjustComputedStyle(StyleResolverState&, Element*); | 170 void adjustComputedStyle(StyleResolverState&, Element*); |
184 | 171 |
185 void appendCSSStyleSheet(CSSStyleSheet&); | |
186 | |
187 void collectPseudoRulesForElement(const Element&, | 172 void collectPseudoRulesForElement(const Element&, |
188 ElementRuleCollector&, | 173 ElementRuleCollector&, |
189 PseudoId, | 174 PseudoId, |
190 unsigned rulesToInclude); | 175 unsigned rulesToInclude); |
191 void matchRuleSet(ElementRuleCollector&, RuleSet*); | 176 void matchRuleSet(ElementRuleCollector&, RuleSet*); |
192 void matchUARules(ElementRuleCollector&); | 177 void matchUARules(ElementRuleCollector&); |
193 void matchScopedRules(const Element&, ElementRuleCollector&); | 178 void matchScopedRules(const Element&, ElementRuleCollector&); |
194 void matchAuthorRules(const Element&, ElementRuleCollector&); | 179 void matchAuthorRules(const Element&, ElementRuleCollector&); |
195 void matchAuthorRulesV0(const Element&, ElementRuleCollector&); | 180 void matchAuthorRulesV0(const Element&, ElementRuleCollector&); |
196 void matchAllRules(StyleResolverState&, | 181 void matchAllRules(StyleResolverState&, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 PseudoElement* createPseudoElement(Element* parent, PseudoId); | 298 PseudoElement* createPseudoElement(Element* parent, PseudoId); |
314 | 299 |
315 Document& document() const { return *m_document; } | 300 Document& document() const { return *m_document; } |
316 | 301 |
317 static ComputedStyle* s_styleNotYetAvailable; | 302 static ComputedStyle* s_styleNotYetAvailable; |
318 | 303 |
319 MatchedPropertiesCache m_matchedPropertiesCache; | 304 MatchedPropertiesCache m_matchedPropertiesCache; |
320 Member<Document> m_document; | 305 Member<Document> m_document; |
321 SelectorFilter m_selectorFilter; | 306 SelectorFilter m_selectorFilter; |
322 | 307 |
323 HeapListHashSet<Member<CSSStyleSheet>, 16> m_pendingStyleSheets; | |
324 | |
325 Member<StyleRuleUsageTracker> m_tracker; | 308 Member<StyleRuleUsageTracker> m_tracker; |
326 | 309 |
327 bool m_printMediaType = false; | 310 bool m_printMediaType = false; |
328 | 311 |
329 unsigned m_styleSharingDepth = 0; | 312 unsigned m_styleSharingDepth = 0; |
330 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> | 313 HeapVector<Member<StyleSharingList>, styleSharingMaxDepth> |
331 m_styleSharingLists; | 314 m_styleSharingLists; |
332 }; | 315 }; |
333 | 316 |
334 } // namespace blink | 317 } // namespace blink |
335 | 318 |
336 #endif // StyleResolver_h | 319 #endif // StyleResolver_h |
OLD | NEW |