| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "core/paint/PaintLayer.h" | 46 #include "core/paint/PaintLayer.h" |
| 47 #include "core/svg/SVGElement.h" | 47 #include "core/svg/SVGElement.h" |
| 48 | 48 |
| 49 namespace blink { | 49 namespace blink { |
| 50 | 50 |
| 51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) | 51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) |
| 52 { | 52 { |
| 53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
| 54 } | 54 } |
| 55 | 55 |
| 56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, dou
ble duration, ExceptionState& exceptionState) | 56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, double duration,
ExceptionState& exceptionState) |
| 57 { | 57 { |
| 58 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 58 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 59 if (element) | 59 if (element) |
| 60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | 60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
| 61 Timing timing; | 61 Timing timing; |
| 62 if (!TimingInput::convert(duration, timing, exceptionState)) | 62 if (!TimingInput::convert(duration, timing, exceptionState)) |
| 63 return nullptr; | 63 return nullptr; |
| 64 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), timing); | 64 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), timing); |
| 65 } | 65 } |
| 66 | 66 |
| 67 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, con
st KeyframeEffectOptions& timingInput, ExceptionState& exceptionState) | 67 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, const KeyframeEf
fectOptions& timingInput, ExceptionState& exceptionState) |
| 68 { | 68 { |
| 69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 70 if (element) | 70 if (element) |
| 71 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | 71 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
| 72 Timing timing; | 72 Timing timing; |
| 73 Document* document = element ? &element->document() : nullptr; | 73 Document* document = element ? &element->document() : nullptr; |
| 74 if (!TimingInput::convert(timingInput, timing, document, exceptionState)) | 74 if (!TimingInput::convert(timingInput, timing, document, exceptionState)) |
| 75 return nullptr; | 75 return nullptr; |
| 76 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), timing); | 76 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), timing); |
| 77 } | 77 } |
| 78 | 78 |
| 79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, Exc
eptionState& exceptionState) | 79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState&
exceptionState) |
| 80 { | 80 { |
| 81 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 81 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 82 if (element) | 82 if (element) |
| 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); |
| 84 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); | 84 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, Priority priority, EventDelegate* eventDelegate) | 87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, Priority priority, EventDelegate* eventDelegate) |
| 88 : AnimationEffect(timing, eventDelegate) | 88 : AnimationEffect(timing, eventDelegate) |
| 89 , m_target(target) | 89 , m_target(target) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 363 |
| 364 DEFINE_TRACE(KeyframeEffect) | 364 DEFINE_TRACE(KeyframeEffect) |
| 365 { | 365 { |
| 366 visitor->trace(m_target); | 366 visitor->trace(m_target); |
| 367 visitor->trace(m_model); | 367 visitor->trace(m_model); |
| 368 visitor->trace(m_sampledEffect); | 368 visitor->trace(m_sampledEffect); |
| 369 AnimationEffect::trace(visitor); | 369 AnimationEffect::trace(visitor); |
| 370 } | 370 } |
| 371 | 371 |
| 372 } // namespace blink | 372 } // namespace blink |
| OLD | NEW |