| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 { | 54 { |
| 55 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); | 55 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); |
| 56 if (exceptionState.hadException()) | 56 if (exceptionState.hadException()) |
| 57 return 0; | 57 return 0; |
| 58 return animateInternal(element, effect, TimingInput::convert(duration)); | 58 return animateInternal(element, effect, TimingInput::convert(duration)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 static Animation* animate(ExecutionContext* executionContext, Element& eleme
nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const Keyfra
meEffectOptions& options, ExceptionState& exceptionState) | 61 static Animation* animate(ExecutionContext* executionContext, Element& eleme
nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const Keyfra
meEffectOptions& options, ExceptionState& exceptionState) |
| 62 { | 62 { |
| 63 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); | 63 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); |
| 64 if (exceptionState.hadException()) | 64 Timing timing; |
| 65 bool success = TimingInput::convert(options, timing, &element.document()
, exceptionState); |
| 66 if (!success || exceptionState.hadException()) |
| 65 return 0; | 67 return 0; |
| 66 | 68 |
| 67 Animation* animation = animateInternal(element, effect, TimingInput::con
vert(options, &element.document())); | 69 Animation* animation = animateInternal(element, effect, timing); |
| 68 animation->setId(options.id()); | 70 animation->setId(options.id()); |
| 69 return animation; | 71 return animation; |
| 70 } | 72 } |
| 71 | 73 |
| 72 static Animation* animate(ExecutionContext* executionContext, Element& eleme
nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionSta
te& exceptionState) | 74 static Animation* animate(ExecutionContext* executionContext, Element& eleme
nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionSta
te& exceptionState) |
| 73 { | 75 { |
| 74 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); | 76 EffectModel* effect = EffectInput::convert(&element, effectInput, execut
ionContext, exceptionState); |
| 75 if (exceptionState.hadException()) | 77 if (exceptionState.hadException()) |
| 76 return 0; | 78 return 0; |
| 77 return animateInternal(element, effect, Timing()); | 79 return animateInternal(element, effect, Timing()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 96 static Animation* animateInternal(Element& element, EffectModel* effect, con
st Timing& timing) | 98 static Animation* animateInternal(Element& element, EffectModel* effect, con
st Timing& timing) |
| 97 { | 99 { |
| 98 KeyframeEffect* keyframeEffect = KeyframeEffect::create(&element, effect
, timing); | 100 KeyframeEffect* keyframeEffect = KeyframeEffect::create(&element, effect
, timing); |
| 99 return element.document().timeline().play(keyframeEffect); | 101 return element.document().timeline().play(keyframeEffect); |
| 100 } | 102 } |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace blink | 105 } // namespace blink |
| 104 | 106 |
| 105 #endif // ElementAnimation_h | 107 #endif // ElementAnimation_h |
| OLD | NEW |