| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "core/animation/KeyframeEffectReadOnly.h" | 43 #include "core/animation/KeyframeEffectReadOnly.h" |
| 44 #include "core/animation/PropertyHandle.h" | 44 #include "core/animation/PropertyHandle.h" |
| 45 #include "core/dom/Element.h" | 45 #include "core/dom/Element.h" |
| 46 #include "core/dom/NodeComputedStyle.h" | 46 #include "core/dom/NodeComputedStyle.h" |
| 47 #include "core/frame/UseCounter.h" | 47 #include "core/frame/UseCounter.h" |
| 48 #include "core/paint/PaintLayer.h" | 48 #include "core/paint/PaintLayer.h" |
| 49 #include "core/svg/SVGElement.h" | 49 #include "core/svg/SVGElement.h" |
| 50 | 50 |
| 51 namespace blink { | 51 namespace blink { |
| 52 | 52 |
| 53 KeyframeEffect* KeyframeEffect::create(Element* target, | 53 KeyframeEffect* KeyframeEffect::create( |
| 54 EffectModel* model, | 54 Element* target, |
| 55 const Timing& timing, | 55 EffectModel* model, |
| 56 KeyframeEffect::Priority priority, | 56 const Timing& timing, |
| 57 EventDelegate* eventDelegate) { | 57 KeyframeEffectReadOnly::Priority priority, |
| 58 EventDelegate* eventDelegate) { |
| 58 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 59 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
| 59 } | 60 } |
| 60 | 61 |
| 61 KeyframeEffect* KeyframeEffect::create( | 62 KeyframeEffect* KeyframeEffect::create( |
| 62 ExecutionContext* executionContext, | 63 ExecutionContext* executionContext, |
| 63 Element* element, | 64 Element* element, |
| 64 const DictionarySequenceOrDictionary& effectInput, | 65 const DictionarySequenceOrDictionary& effectInput, |
| 65 double duration, | 66 double duration, |
| 66 ExceptionState& exceptionState) { | 67 ExceptionState& exceptionState) { |
| 67 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 68 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 element->document(), | 109 element->document(), |
| 109 UseCounter::AnimationConstructorKeyframeListEffectNoTiming); | 110 UseCounter::AnimationConstructorKeyframeListEffectNoTiming); |
| 110 return create(element, EffectInput::convert(element, effectInput, | 111 return create(element, EffectInput::convert(element, effectInput, |
| 111 executionContext, exceptionState), | 112 executionContext, exceptionState), |
| 112 Timing()); | 113 Timing()); |
| 113 } | 114 } |
| 114 | 115 |
| 115 KeyframeEffect::KeyframeEffect(Element* target, | 116 KeyframeEffect::KeyframeEffect(Element* target, |
| 116 EffectModel* model, | 117 EffectModel* model, |
| 117 const Timing& timing, | 118 const Timing& timing, |
| 118 KeyframeEffect::Priority priority, | 119 KeyframeEffectReadOnly::Priority priority, |
| 119 EventDelegate* eventDelegate) | 120 EventDelegate* eventDelegate) |
| 120 : KeyframeEffectReadOnly(target, model, timing, eventDelegate), | 121 : KeyframeEffectReadOnly(target, model, timing, priority, eventDelegate) {} |
| 121 m_priority(priority) {} | |
| 122 | 122 |
| 123 KeyframeEffect::~KeyframeEffect() {} | 123 KeyframeEffect::~KeyframeEffect() {} |
| 124 | 124 |
| 125 void KeyframeEffect::attach(Animation* animation) { | 125 void KeyframeEffect::attach(Animation* animation) { |
| 126 if (m_target) { | 126 if (m_target) { |
| 127 m_target->ensureElementAnimations().animations().add(animation); | 127 m_target->ensureElementAnimations().animations().add(animation); |
| 128 m_target->setNeedsAnimationStyleRecalc(); | 128 m_target->setNeedsAnimationStyleRecalc(); |
| 129 if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() && | 129 if (RuntimeEnabledFeatures::webAnimationsSVGEnabled() && |
| 130 m_target->isSVGElement()) | 130 m_target->isSVGElement()) |
| 131 toSVGElement(m_target)->setWebAnimationsPending(); | 131 toSVGElement(m_target)->setWebAnimationsPending(); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 AnimationEffectTiming* KeyframeEffect::timing() { | 388 AnimationEffectTiming* KeyframeEffect::timing() { |
| 389 return AnimationEffectTiming::create(this); | 389 return AnimationEffectTiming::create(this); |
| 390 } | 390 } |
| 391 | 391 |
| 392 DEFINE_TRACE(KeyframeEffect) { | 392 DEFINE_TRACE(KeyframeEffect) { |
| 393 KeyframeEffectReadOnly::trace(visitor); | 393 KeyframeEffectReadOnly::trace(visitor); |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace blink | 396 } // namespace blink |
| OLD | NEW |