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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 static AnimationPlayer* animate(Element& element, const AnimationEffectOrDic
tionarySequence& effectInput, ExceptionState& exceptionState) | 67 static AnimationPlayer* animate(Element& element, const AnimationEffectOrDic
tionarySequence& effectInput, ExceptionState& exceptionState) |
68 { | 68 { |
69 RefPtrWillBeRawPtr<AnimationEffect> effect = EffectInput::convert(&eleme
nt, effectInput, exceptionState); | 69 RefPtrWillBeRawPtr<AnimationEffect> effect = EffectInput::convert(&eleme
nt, effectInput, exceptionState); |
70 if (exceptionState.hadException()) | 70 if (exceptionState.hadException()) |
71 return 0; | 71 return 0; |
72 return animateInternal(element, effect, Timing()); | 72 return animateInternal(element, effect, Timing()); |
73 } | 73 } |
74 | 74 |
75 static WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > getAnimationPl
ayers(Element& element) | 75 static WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> getAnimationPla
yers(Element& element) |
76 { | 76 { |
77 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > animationPlayers; | 77 WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer>> animationPlayers; |
78 | 78 |
79 if (!element.hasAnimations()) | 79 if (!element.hasAnimations()) |
80 return animationPlayers; | 80 return animationPlayers; |
81 | 81 |
82 for (const auto& player : element.document().timeline().getAnimationPlay
ers()) { | 82 for (const auto& player : element.document().timeline().getAnimationPlay
ers()) { |
83 ASSERT(player->source()); | 83 ASSERT(player->source()); |
84 if (toAnimation(player->source())->target() == element && (player->s
ource()->isCurrent() || player->source()->isInEffect())) | 84 if (toAnimation(player->source())->target() == element && (player->s
ource()->isCurrent() || player->source()->isInEffect())) |
85 animationPlayers.append(player); | 85 animationPlayers.append(player); |
86 } | 86 } |
87 return animationPlayers; | 87 return animationPlayers; |
88 } | 88 } |
89 | 89 |
90 private: | 90 private: |
91 static AnimationPlayer* animateInternal(Element& element, PassRefPtrWillBeRa
wPtr<AnimationEffect> effect, const Timing& timing) | 91 static AnimationPlayer* animateInternal(Element& element, PassRefPtrWillBeRa
wPtr<AnimationEffect> effect, const Timing& timing) |
92 { | 92 { |
93 RefPtrWillBeRawPtr<Animation> animation = Animation::create(&element, ef
fect, timing); | 93 RefPtrWillBeRawPtr<Animation> animation = Animation::create(&element, ef
fect, timing); |
94 return element.document().timeline().play(animation.get()); | 94 return element.document().timeline().play(animation.get()); |
95 } | 95 } |
96 }; | 96 }; |
97 | 97 |
98 } // namespace blink | 98 } // namespace blink |
99 | 99 |
100 #endif // ElementAnimation_h | 100 #endif // ElementAnimation_h |
OLD | NEW |