| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "bindings/core/v8/UnionTypesCore.h" | 34 #include "bindings/core/v8/UnionTypesCore.h" |
| 35 #include "core/animation/AnimationTimeline.h" | 35 #include "core/animation/AnimationTimeline.h" |
| 36 #include "core/animation/EffectInput.h" | 36 #include "core/animation/EffectInput.h" |
| 37 #include "core/animation/ElementAnimations.h" | 37 #include "core/animation/ElementAnimations.h" |
| 38 #include "core/animation/KeyframeEffect.h" | 38 #include "core/animation/KeyframeEffect.h" |
| 39 #include "core/animation/TimingInput.h" | 39 #include "core/animation/TimingInput.h" |
| 40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
| 41 #include "core/dom/Element.h" | 41 #include "core/dom/Element.h" |
| 42 #include "platform/RuntimeEnabledFeatures.h" | 42 #include "platform/RuntimeEnabledFeatures.h" |
| 43 #include "wtf/Allocator.h" |
| 43 | 44 |
| 44 | 45 |
| 45 namespace blink { | 46 namespace blink { |
| 46 | 47 |
| 47 class Dictionary; | 48 class Dictionary; |
| 48 | 49 |
| 49 class ElementAnimation { | 50 class ElementAnimation { |
| 51 STATIC_ONLY(ElementAnimation); |
| 50 public: | 52 public: |
| 51 static Animation* animate(Element& element, const EffectModelOrDictionarySeq
uence& effectInput, double duration, ExceptionState& exceptionState) | 53 static Animation* animate(Element& element, const EffectModelOrDictionarySeq
uence& effectInput, double duration, ExceptionState& exceptionState) |
| 52 { | 54 { |
| 53 RefPtrWillBeRawPtr<EffectModel> effect = EffectInput::convert(&element,
effectInput, exceptionState); | 55 RefPtrWillBeRawPtr<EffectModel> effect = EffectInput::convert(&element,
effectInput, exceptionState); |
| 54 if (exceptionState.hadException()) | 56 if (exceptionState.hadException()) |
| 55 return 0; | 57 return 0; |
| 56 return animateInternal(element, effect, TimingInput::convert(duration)); | 58 return animateInternal(element, effect, TimingInput::convert(duration)); |
| 57 } | 59 } |
| 58 | 60 |
| 59 static Animation* animate(Element& element, const EffectModelOrDictionarySeq
uence& effectInput, const KeyframeEffectOptions& timingInput, ExceptionState& ex
ceptionState) | 61 static Animation* animate(Element& element, const EffectModelOrDictionarySeq
uence& effectInput, const KeyframeEffectOptions& timingInput, ExceptionState& ex
ceptionState) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 static Animation* animateInternal(Element& element, PassRefPtrWillBeRawPtr<E
ffectModel> effect, const Timing& timing) | 93 static Animation* animateInternal(Element& element, PassRefPtrWillBeRawPtr<E
ffectModel> effect, const Timing& timing) |
| 92 { | 94 { |
| 93 RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::crea
te(&element, effect, timing); | 95 RefPtrWillBeRawPtr<KeyframeEffect> keyframeEffect = KeyframeEffect::crea
te(&element, effect, timing); |
| 94 return element.document().timeline().play(keyframeEffect.get()); | 96 return element.document().timeline().play(keyframeEffect.get()); |
| 95 } | 97 } |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace blink | 100 } // namespace blink |
| 99 | 101 |
| 100 #endif // ElementAnimation_h | 102 #endif // ElementAnimation_h |
| OLD | NEW |