| 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 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende
rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); | 121 PassRefPtr<RenderStyle> styleForKeyframe(Element*, const RenderStyle&, Rende
rStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); |
| 123 static PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(Element&, c
onst Vector<RefPtr<MutableStylePropertySet> >&, KeyframeEffectModel::KeyframeVec
tor&); | 122 static PassRefPtr<KeyframeEffectModel> createKeyframeEffectModel(Element&, c
onst Vector<RefPtr<MutableStylePropertySet> >&, KeyframeEffectModel::KeyframeVec
tor&); |
| 124 | 123 |
| 125 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, RenderStyle* parentStyle); | 124 PassRefPtr<RenderStyle> pseudoStyleForElement(Element*, const PseudoStyleReq
uest&, RenderStyle* parentStyle); |
| 126 | 125 |
| 127 PassRefPtr<RenderStyle> styleForPage(int pageIndex); | 126 PassRefPtr<RenderStyle> styleForPage(int pageIndex); |
| 128 PassRefPtr<RenderStyle> defaultStyleForElement(); | 127 PassRefPtr<RenderStyle> defaultStyleForElement(); |
| 129 PassRefPtr<RenderStyle> styleForText(Text*); | 128 PassRefPtr<RenderStyle> styleForText(Text*); |
| 130 | 129 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // |properties| is an array with |count| elements. | 181 // |properties| is an array with |count| elements. |
| 183 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); | 182 void applyPropertiesToStyle(const CSSPropertyValue* properties, size_t count
, RenderStyle*); |
| 184 | 183 |
| 185 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol
ver.get(); } | 184 ViewportStyleResolver* viewportStyleResolver() { return m_viewportStyleResol
ver.get(); } |
| 186 | 185 |
| 187 void addMediaQueryResults(const MediaQueryResultList&); | 186 void addMediaQueryResults(const MediaQueryResultList&); |
| 188 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp
ortDependentMediaQueryResults; } | 187 MediaQueryResultList* viewportDependentMediaQueryResults() { return &m_viewp
ortDependentMediaQueryResults; } |
| 189 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM
ediaQueryResults.isEmpty(); } | 188 bool hasViewportDependentMediaQueries() const { return !m_viewportDependentM
ediaQueryResults.isEmpty(); } |
| 190 bool mediaQueryAffectedByViewportChange() const; | 189 bool mediaQueryAffectedByViewportChange() const; |
| 191 | 190 |
| 192 // FIXME: Regions should not require special logic in StyleResolver. | |
| 193 bool checkRegionStyle(Element* regionElement); | |
| 194 | |
| 195 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. | 191 // FIXME: Rename to reflect the purpose, like didChangeFontSize or something
. |
| 196 void invalidateMatchedPropertiesCache(); | 192 void invalidateMatchedPropertiesCache(); |
| 197 | 193 |
| 198 void notifyResizeForViewportUnits(); | 194 void notifyResizeForViewportUnits(); |
| 199 | 195 |
| 200 // Exposed for RenderStyle::isStyleAvilable(). | 196 // Exposed for RenderStyle::isStyleAvilable(). |
| 201 static RenderStyle* styleNotYetAvailable() { return s_styleNotYetAvailable;
} | 197 static RenderStyle* styleNotYetAvailable() { return s_styleNotYetAvailable;
} |
| 202 | 198 |
| 203 RuleFeatureSet& ensureRuleFeatureSet() | 199 RuleFeatureSet& ensureRuleFeatureSet() |
| 204 { | 200 { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 StyleSharingList m_styleSharingList; | 319 StyleSharingList m_styleSharingList; |
| 324 | 320 |
| 325 OwnPtr<StyleResolverStats> m_styleResolverStats; | 321 OwnPtr<StyleResolverStats> m_styleResolverStats; |
| 326 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; | 322 OwnPtr<StyleResolverStats> m_styleResolverStatsTotals; |
| 327 unsigned m_styleResolverStatsSequence; | 323 unsigned m_styleResolverStatsSequence; |
| 328 | 324 |
| 329 // Use only for Internals::updateStyleAndReturnAffectedElementCount. | 325 // Use only for Internals::updateStyleAndReturnAffectedElementCount. |
| 330 unsigned m_accessCount; | 326 unsigned m_accessCount; |
| 331 }; | 327 }; |
| 332 | 328 |
| 333 inline bool checkRegionSelector(const CSSSelector* regionSelector, Element* regi
onElement) | |
| 334 { | |
| 335 if (!regionSelector || !regionElement) | |
| 336 return false; | |
| 337 | |
| 338 SelectorChecker selectorChecker(regionElement->document(), SelectorChecker::
QueryingRules); | |
| 339 for (const CSSSelector* s = regionSelector; s; s = CSSSelectorList::next(*s)
) { | |
| 340 SelectorChecker::SelectorCheckingContext selectorCheckingContext(*s, reg
ionElement, SelectorChecker::VisitedMatchDisabled); | |
| 341 if (selectorChecker.match(selectorCheckingContext, DOMSiblingTraversalSt
rategy()) == SelectorChecker::SelectorMatches) | |
| 342 return true; | |
| 343 } | |
| 344 return false; | |
| 345 } | |
| 346 | |
| 347 } // namespace WebCore | 329 } // namespace WebCore |
| 348 | 330 |
| 349 #endif // StyleResolver_h | 331 #endif // StyleResolver_h |
| OLD | NEW |