OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 using AnimationCountedSet = HeapHashCountedSet<WeakMember<Animation>>; | 46 using AnimationCountedSet = HeapHashCountedSet<WeakMember<Animation>>; |
47 | 47 |
48 class ElementAnimations : public GarbageCollectedFinalized<ElementAnimations> { | 48 class ElementAnimations : public GarbageCollectedFinalized<ElementAnimations> { |
49 WTF_MAKE_NONCOPYABLE(ElementAnimations); | 49 WTF_MAKE_NONCOPYABLE(ElementAnimations); |
50 | 50 |
51 public: | 51 public: |
52 ElementAnimations(); | 52 ElementAnimations(); |
53 ~ElementAnimations(); | 53 ~ElementAnimations(); |
54 | 54 |
55 // Animations that are currently active for this element, their effects will b
e applied | 55 // Animations that are currently active for this element, their effects will |
56 // during a style recalc. CSS Transitions are included in this stack. | 56 // be applied during a style recalc. CSS Transitions are included in this |
| 57 // stack. |
57 AnimationStack& animationStack() { return m_animationStack; } | 58 AnimationStack& animationStack() { return m_animationStack; } |
58 const AnimationStack& animationStack() const { return m_animationStack; } | 59 const AnimationStack& animationStack() const { return m_animationStack; } |
59 // Tracks long running animations that are responsible for applying mutations | 60 // Tracks long running animations that are responsible for applying mutations |
60 // from compositor worker. | 61 // from compositor worker. |
61 CustomCompositorAnimations& customCompositorAnimations() { | 62 CustomCompositorAnimations& customCompositorAnimations() { |
62 return m_customCompositorAnimations; | 63 return m_customCompositorAnimations; |
63 } | 64 } |
64 const CustomCompositorAnimations& customCompositorAnimations() const { | 65 const CustomCompositorAnimations& customCompositorAnimations() const { |
65 return m_customCompositorAnimations; | 66 return m_customCompositorAnimations; |
66 } | 67 } |
67 // Tracks the state of active CSS Animations and Transitions. The individual a
nimations | 68 // Tracks the state of active CSS Animations and Transitions. The individual |
68 // will also be part of the animation stack, but the mapping betwen animation
name and | 69 // animations will also be part of the animation stack, but the mapping |
69 // animation is kept here. | 70 // between animation name and animation is kept here. |
70 CSSAnimations& cssAnimations() { return m_cssAnimations; } | 71 CSSAnimations& cssAnimations() { return m_cssAnimations; } |
71 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } | 72 const CSSAnimations& cssAnimations() const { return m_cssAnimations; } |
72 | 73 |
73 // Animations which have effects targeting this element. | 74 // Animations which have effects targeting this element. |
74 AnimationCountedSet& animations() { return m_animations; } | 75 AnimationCountedSet& animations() { return m_animations; } |
75 | 76 |
76 bool isEmpty() const { | 77 bool isEmpty() const { |
77 return m_animationStack.isEmpty() && m_cssAnimations.isEmpty() && | 78 return m_animationStack.isEmpty() && m_cssAnimations.isEmpty() && |
78 m_animations.isEmpty(); | 79 m_animations.isEmpty(); |
79 } | 80 } |
(...skipping 21 matching lines...) Expand all Loading... |
101 bool m_animationStyleChange; | 102 bool m_animationStyleChange; |
102 RefPtr<ComputedStyle> m_baseComputedStyle; | 103 RefPtr<ComputedStyle> m_baseComputedStyle; |
103 | 104 |
104 // CSSAnimations checks if a style change is due to animation. | 105 // CSSAnimations checks if a style change is due to animation. |
105 friend class CSSAnimations; | 106 friend class CSSAnimations; |
106 }; | 107 }; |
107 | 108 |
108 } // namespace blink | 109 } // namespace blink |
109 | 110 |
110 #endif // ElementAnimations_h | 111 #endif // ElementAnimations_h |
OLD | NEW |