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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class CSSValue; | 54 class CSSValue; |
55 class ContainerNode; | 55 class ContainerNode; |
56 class Document; | 56 class Document; |
57 class DocumentTimeline; | 57 class DocumentTimeline; |
58 class Element; | 58 class Element; |
59 class ElementRuleCollector; | 59 class ElementRuleCollector; |
60 class KeyframeList; | 60 class KeyframeList; |
61 class KeyframeValue; | 61 class KeyframeValue; |
62 class MediaQueryEvaluator; | 62 class MediaQueryEvaluator; |
63 class MediaQueryResult; | 63 class MediaQueryResult; |
64 class RenderRegion; | |
65 class RuleData; | 64 class RuleData; |
66 class Settings; | 65 class Settings; |
67 class StyleKeyframe; | 66 class StyleKeyframe; |
68 class StylePropertySet; | 67 class StylePropertySet; |
69 class StyleResolverStats; | 68 class StyleResolverStats; |
70 class StyleRule; | 69 class StyleRule; |
71 class StyleRuleKeyframes; | 70 class StyleRuleKeyframes; |
72 class StyleRulePage; | 71 class StyleRulePage; |
73 class ViewportStyleResolver; | 72 class ViewportStyleResolver; |
74 | 73 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // FIXME: StyleResolver should not be keeping tree-walk state. | 109 // FIXME: StyleResolver should not be keeping tree-walk state. |
111 // These should move to some global tree-walk state, or should be contained
in a | 110 // These should move to some global tree-walk state, or should be contained
in a |
112 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. | 111 // TreeWalkContext or similar which is passed in to StyleResolver methods wh
en available. |
113 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. | 112 // Using these during tree walk will allow style selector to optimize child
and descendant selector lookups. |
114 void pushParentElement(Element&); | 113 void pushParentElement(Element&); |
115 void popParentElement(Element&); | 114 void popParentElement(Element&); |
116 void pushParentShadowRoot(const ShadowRoot&); | 115 void pushParentShadowRoot(const ShadowRoot&); |
117 void popParentShadowRoot(const ShadowRoot&); | 116 void popParentShadowRoot(const ShadowRoot&); |
118 | 117 |
119 PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle =
0, StyleSharingBehavior = AllowStyleSharing, | 118 PassRefPtr<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle =
0, StyleSharingBehavior = AllowStyleSharing, |
120 RuleMatchingBehavior = MatchAllRules, RenderRegion* regionForStyling = 0
); | 119 RuleMatchingBehavior = MatchAllRules); |
121 | 120 |
122 // FIXME: keyframeStylesForAnimation is only used in the legacy animations i
mplementation | 121 // FIXME: keyframeStylesForAnimation is only used in the legacy animations i
mplementation |
123 // and should be removed when that is replaced by Web Animations. | 122 // and should be removed when that is replaced by Web Animations. |
124 void keyframeStylesForAnimation(Element*, const RenderStyle&, KeyframeList&)
; | 123 void keyframeStylesForAnimation(Element*, const RenderStyle&, KeyframeList&)
; |
125 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende
rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); | 124 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende
rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); |
126 static PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(Element&, c
onst Vector<RefPtr<MutableStylePropertySet> >&, KeyframeEffectModel::KeyframeVec
tor&); | 125 static PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(Element&, c
onst Vector<RefPtr<MutableStylePropertySet> >&, KeyframeEffectModel::KeyframeVec
tor&); |
127 | 126 |
128 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, RenderStyle* parentStyle); | 127 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, RenderStyle* parentStyle); |
129 | 128 |
130 PassRefPtr<RenderStyle> styleForPage(int pageIndex); | 129 PassRefPtr<RenderStyle> styleForPage(int pageIndex); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // |properties| is an array with |count| elements. | 184 // |properties| is an array with |count| elements. |
186 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); | 185 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); |
187 | 186 |
188 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol
ver.get(); } | 187 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol
ver.get(); } |
189 | 188 |
190 void addMediaQueryResults(const MediaQueryResultList&); | 189 void addMediaQueryResults(const MediaQueryResultList&); |
191 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp
ortDependentMediaQueryResults; } | 190 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp
ortDependentMediaQueryResults; } |
192 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM
ediaQueryResults.isEmpty(); } | 191 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM
ediaQueryResults.isEmpty(); } |
193 bool mediaQueryAffectedByViewportChange() const; | 192 bool mediaQueryAffectedByViewportChange() const; |
194 | 193 |
195 // FIXME: Regions should not require special logic in StyleResolver. | |
196 bool checkRegionStyle(Element* regionElement); | |
197 | |
198 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. | 194 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. |
199 void invalidateMatchedPropertiesCache(); | 195 void invalidateMatchedPropertiesCache(); |
200 | 196 |
201 void notifyResizeForViewportUnits(); | 197 void notifyResizeForViewportUnits(); |
202 | 198 |
203 // Exposed for RenderStyle::isStyleAvilable(). | 199 // Exposed for RenderStyle::isStyleAvilable(). |
204 static RenderStyle* styleNotYetAvailable() { return s_styleNotYetAvailable;
} | 200 static RenderStyle* styleNotYetAvailable() { return s_styleNotYetAvailable;
} |
205 | 201 |
206 const RuleFeatureSet& ensureRuleFeatureSet() | 202 const RuleFeatureSet& ensureRuleFeatureSet() |
207 { | 203 { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 322 |
327 StyleSharingList m_styleSharingList; | 323 StyleSharingList m_styleSharingList; |
328 | 324 |
329 OwnPtr<StyleResolverStats> m_styleResolverStats; | 325 OwnPtr<StyleResolverStats> m_styleResolverStats; |
330 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 326 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
331 unsigned m_styleResolverStatsSequence; | 327 unsigned m_styleResolverStatsSequence; |
332 | 328 |
333 unsigned m_accessCount; | 329 unsigned m_accessCount; |
334 }; | 330 }; |
335 | 331 |
336 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi
onElement) | |
337 { | |
338 if (!regionSelector || !regionElement) | |
339 return false; | |
340 | |
341 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker::
QueryingRules); | |
342 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(s))
{ | |
343 SelectorChecker::SelectorCheckingContext selectorCheckingContext(s, regi
onElement, SelectorChecker::VisitedMatchDisabled); | |
344 if (selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalSt
rategy()) == SelectorChecker::SelectorMatches) | |
345 return true; | |
346 } | |
347 return false; | |
348 } | |
349 | |
350 } // namespace WebCore | 332 } // namespace WebCore |
351 | 333 |
352 #endif // StyleResolver_h | 334 #endif // StyleResolver_h |
OLD | NEW |