| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class AnimatableValue; | 45 class AnimatableValue; |
| 46 class CSSRuleList; | 46 class CSSRuleList; |
| 47 class CSSValue; | 47 class CSSValue; |
| 48 class Document; | 48 class Document; |
| 49 class Element; | 49 class Element; |
| 50 class Interpolation; | 50 class Interpolation; |
| 51 class MatchResult; | 51 class MatchResult; |
| 52 class RuleSet; | 52 class RuleSet; |
| 53 class StylePropertySet; | 53 class StylePropertySet; |
| 54 class StyleRuleUsageTracker; | 54 class StyleRuleUsageTracker; |
| 55 class CSSVariableResolver; |
| 55 | 56 |
| 56 enum StyleSharingBehavior { | 57 enum StyleSharingBehavior { |
| 57 kAllowStyleSharing, | 58 kAllowStyleSharing, |
| 58 kDisallowStyleSharing, | 59 kDisallowStyleSharing, |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 enum RuleMatchingBehavior { kMatchAllRules, kMatchAllRulesExcludingSMIL }; | 62 enum RuleMatchingBehavior { kMatchAllRules, kMatchAllRulesExcludingSMIL }; |
| 62 | 63 |
| 63 const unsigned kStyleSharingListSize = 15; | 64 const unsigned kStyleSharingListSize = 15; |
| 64 const unsigned kStyleSharingMaxDepth = 32; | 65 const unsigned kStyleSharingMaxDepth = 32; |
| 65 using StyleSharingList = HeapDeque<Member<Element>, kStyleSharingListSize>; | 66 using StyleSharingList = HeapDeque<Member<Element>, kStyleSharingListSize>; |
| 66 using ActiveInterpolationsMap = | 67 using ActiveInterpolations = Vector<RefPtr<Interpolation>, 1>; |
| 67 HashMap<PropertyHandle, Vector<RefPtr<Interpolation>, 1>>; | 68 using ActiveInterpolationsMap = HashMap<PropertyHandle, ActiveInterpolations>; |
| 68 | 69 |
| 69 // This class selects a ComputedStyle for a given element based on a collection | 70 // This class selects a ComputedStyle for a given element based on a collection |
| 70 // of stylesheets. | 71 // of stylesheets. |
| 71 class CORE_EXPORT StyleResolver final | 72 class CORE_EXPORT StyleResolver final |
| 72 : public GarbageCollectedFinalized<StyleResolver> { | 73 : public GarbageCollectedFinalized<StyleResolver> { |
| 73 WTF_MAKE_NONCOPYABLE(StyleResolver); | 74 WTF_MAKE_NONCOPYABLE(StyleResolver); |
| 74 | 75 |
| 75 public: | 76 public: |
| 76 static StyleResolver* Create(Document& document) { | 77 static StyleResolver* Create(Document& document) { |
| 77 return new StyleResolver(document); | 78 return new StyleResolver(document); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void ClearStyleSharingList(); | 151 void ClearStyleSharingList(); |
| 151 | 152 |
| 152 void IncreaseStyleSharingDepth() { ++style_sharing_depth_; } | 153 void IncreaseStyleSharingDepth() { ++style_sharing_depth_; } |
| 153 void DecreaseStyleSharingDepth() { --style_sharing_depth_; } | 154 void DecreaseStyleSharingDepth() { --style_sharing_depth_; } |
| 154 | 155 |
| 155 PseudoElement* CreatePseudoElementIfNeeded(Element& parent, PseudoId); | 156 PseudoElement* CreatePseudoElementIfNeeded(Element& parent, PseudoId); |
| 156 | 157 |
| 157 void SetRuleUsageTracker(StyleRuleUsageTracker*); | 158 void SetRuleUsageTracker(StyleRuleUsageTracker*); |
| 158 void UpdateMediaType(); | 159 void UpdateMediaType(); |
| 159 | 160 |
| 161 static void ApplyAnimatedCustomProperty(StyleResolverState&, |
| 162 CSSVariableResolver&, |
| 163 const PropertyHandle&); |
| 164 |
| 160 DECLARE_TRACE(); | 165 DECLARE_TRACE(); |
| 161 | 166 |
| 162 private: | 167 private: |
| 163 explicit StyleResolver(Document&); | 168 explicit StyleResolver(Document&); |
| 164 | 169 |
| 165 PassRefPtr<ComputedStyle> InitialStyleForElement(); | 170 PassRefPtr<ComputedStyle> InitialStyleForElement(); |
| 166 | 171 |
| 167 // FIXME: This should probably go away, folded into FontBuilder. | 172 // FIXME: This should probably go away, folded into FontBuilder. |
| 168 void UpdateFont(StyleResolverState&); | 173 void UpdateFont(StyleResolverState&); |
| 169 | 174 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 void ApplyMatchedAnimationProperties(StyleResolverState&, | 258 void ApplyMatchedAnimationProperties(StyleResolverState&, |
| 254 const MatchResult&, | 259 const MatchResult&, |
| 255 const CacheSuccess&, | 260 const CacheSuccess&, |
| 256 NeedsApplyPass&); | 261 NeedsApplyPass&); |
| 257 void ApplyMatchedStandardProperties(StyleResolverState&, | 262 void ApplyMatchedStandardProperties(StyleResolverState&, |
| 258 const MatchResult&, | 263 const MatchResult&, |
| 259 const CacheSuccess&, | 264 const CacheSuccess&, |
| 260 NeedsApplyPass&); | 265 NeedsApplyPass&); |
| 261 void CalculateAnimationUpdate(StyleResolverState&, | 266 void CalculateAnimationUpdate(StyleResolverState&, |
| 262 const Element* animating_element); | 267 const Element* animating_element); |
| 268 void ApplyAnimatedCustomProperties(StyleResolverState&); |
| 269 static void ApplyAnimatedCustomProperty(StyleResolverState&, |
| 270 CSSVariableResolver&, |
| 271 const PropertyHandle&, |
| 272 const ActiveInterpolations&); |
| 263 bool ApplyAnimatedStandardProperties(StyleResolverState&, const Element*); | 273 bool ApplyAnimatedStandardProperties(StyleResolverState&, const Element*); |
| 264 | 274 |
| 265 void ApplyCallbackSelectors(StyleResolverState&); | 275 void ApplyCallbackSelectors(StyleResolverState&); |
| 266 | 276 |
| 267 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> | 277 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> |
| 268 void ApplyMatchedProperties(StyleResolverState&, | 278 void ApplyMatchedProperties(StyleResolverState&, |
| 269 const MatchedPropertiesRange&, | 279 const MatchedPropertiesRange&, |
| 270 bool important, | 280 bool important, |
| 271 bool inherited_only, | 281 bool inherited_only, |
| 272 NeedsApplyPass&); | 282 NeedsApplyPass&); |
| 273 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> | 283 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> |
| 274 void ApplyProperties(StyleResolverState&, | 284 void ApplyProperties(StyleResolverState&, |
| 275 const StylePropertySet* properties, | 285 const StylePropertySet* properties, |
| 276 bool is_important, | 286 bool is_important, |
| 277 bool inherited_only, | 287 bool inherited_only, |
| 278 NeedsApplyPass&, | 288 NeedsApplyPass&, |
| 279 PropertyWhitelistType = kPropertyWhitelistNone); | 289 PropertyWhitelistType = kPropertyWhitelistNone); |
| 280 template <CSSPropertyPriority priority> | 290 template <CSSPropertyPriority priority> |
| 281 void ApplyAnimatedProperties(StyleResolverState&, | 291 void ApplyAnimatedStandardProperties(StyleResolverState&, |
| 282 const ActiveInterpolationsMap&); | 292 const ActiveInterpolationsMap&); |
| 283 template <CSSPropertyPriority priority> | 293 template <CSSPropertyPriority priority> |
| 284 void ApplyAllProperty(StyleResolverState&, | 294 void ApplyAllProperty(StyleResolverState&, |
| 285 const CSSValue&, | 295 const CSSValue&, |
| 286 bool inherited_only, | 296 bool inherited_only, |
| 287 PropertyWhitelistType); | 297 PropertyWhitelistType); |
| 288 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> | 298 template <CSSPropertyPriority priority, ShouldUpdateNeedsApplyPass> |
| 289 void ApplyPropertiesForApplyAtRule(StyleResolverState&, | 299 void ApplyPropertiesForApplyAtRule(StyleResolverState&, |
| 290 const CSSValue&, | 300 const CSSValue&, |
| 291 bool is_important, | 301 bool is_important, |
| 292 NeedsApplyPass&, | 302 NeedsApplyPass&, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 317 bool was_viewport_resized_ = false; | 327 bool was_viewport_resized_ = false; |
| 318 | 328 |
| 319 unsigned style_sharing_depth_ = 0; | 329 unsigned style_sharing_depth_ = 0; |
| 320 HeapVector<Member<StyleSharingList>, kStyleSharingMaxDepth> | 330 HeapVector<Member<StyleSharingList>, kStyleSharingMaxDepth> |
| 321 style_sharing_lists_; | 331 style_sharing_lists_; |
| 322 }; | 332 }; |
| 323 | 333 |
| 324 } // namespace blink | 334 } // namespace blink |
| 325 | 335 |
| 326 #endif // StyleResolver_h | 336 #endif // StyleResolver_h |
| OLD | NEW |