| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "bindings/core/v8/Dictionary.h" | 33 #include "bindings/core/v8/Dictionary.h" |
| 34 #include "bindings/core/v8/ExceptionState.h" | 34 #include "bindings/core/v8/ExceptionState.h" |
| 35 #include "core/animation/Animation.h" | 35 #include "core/animation/Animation.h" |
| 36 #include "core/animation/AnimationTimeline.h" | 36 #include "core/animation/AnimationTimeline.h" |
| 37 #include "core/animation/CompositorAnimations.h" | 37 #include "core/animation/CompositorAnimations.h" |
| 38 #include "core/animation/ElementAnimations.h" | 38 #include "core/animation/ElementAnimations.h" |
| 39 #include "core/animation/Interpolation.h" | 39 #include "core/animation/Interpolation.h" |
| 40 #include "core/animation/KeyframeEffectModel.h" | 40 #include "core/animation/KeyframeEffectModel.h" |
| 41 #include "core/animation/KeyframeEffectOptions.h" | 41 #include "core/animation/KeyframeEffectOptions.h" |
| 42 #include "core/animation/KeyframeEffectReadOnly.h" |
| 42 #include "core/animation/PropertyHandle.h" | 43 #include "core/animation/PropertyHandle.h" |
| 43 #include "core/dom/Element.h" | 44 #include "core/dom/Element.h" |
| 44 #include "core/dom/NodeComputedStyle.h" | 45 #include "core/dom/NodeComputedStyle.h" |
| 45 #include "core/frame/UseCounter.h" | 46 #include "core/frame/UseCounter.h" |
| 46 #include "core/paint/PaintLayer.h" | 47 #include "core/paint/PaintLayer.h" |
| 47 #include "core/svg/SVGElement.h" | 48 #include "core/svg/SVGElement.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) | 52 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, KeyframeEffectReadOnly::Priority priority, EventDelegate* even
tDelegate) |
| 52 { | 53 { |
| 53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 54 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
| 54 } | 55 } |
| 55 | 56 |
| 56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, double duration,
ExceptionState& exceptionState) | 57 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, double duration,
ExceptionState& exceptionState) |
| 57 { | 58 { |
| 58 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 59 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 59 if (element) | 60 if (element) |
| 60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | 61 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
| 61 Timing timing; | 62 Timing timing; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 77 } | 78 } |
| 78 | 79 |
| 79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState&
exceptionState) | 80 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const DictionarySequenceOrDictionary& effectInput, ExceptionState&
exceptionState) |
| 80 { | 81 { |
| 81 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 82 DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 82 if (element) | 83 if (element) |
| 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | 84 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); |
| 84 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); | 85 return create(element, EffectInput::convert(element, effectInput, executionC
ontext, exceptionState), Timing()); |
| 85 } | 86 } |
| 86 | 87 |
| 87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, Priority priority, EventDelegate* eventDelegate) | 88 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing
& timing, KeyframeEffectReadOnly::Priority priority, EventDelegate* eventDelegat
e) |
| 88 : AnimationEffectReadOnly(timing, eventDelegate) | 89 : KeyframeEffectReadOnly(target, model, timing, priority, eventDelegate) |
| 89 , m_target(target) | |
| 90 , m_model(model) | |
| 91 , m_sampledEffect(nullptr) | |
| 92 , m_priority(priority) | |
| 93 { | 90 { |
| 94 } | 91 } |
| 95 | 92 |
| 96 KeyframeEffect::~KeyframeEffect() | 93 KeyframeEffect::~KeyframeEffect() |
| 97 { | 94 { |
| 98 } | 95 } |
| 99 | 96 |
| 100 void KeyframeEffect::attach(Animation* animation) | 97 void KeyframeEffect::attach(Animation* animation) |
| 101 { | 98 { |
| 102 if (m_target) { | 99 if (m_target) { |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 353 |
| 357 void KeyframeEffect::attachCompositedLayers() | 354 void KeyframeEffect::attachCompositedLayers() |
| 358 { | 355 { |
| 359 DCHECK(m_target); | 356 DCHECK(m_target); |
| 360 DCHECK(animation()); | 357 DCHECK(animation()); |
| 361 CompositorAnimations::attachCompositedLayers(*m_target, *animation()); | 358 CompositorAnimations::attachCompositedLayers(*m_target, *animation()); |
| 362 } | 359 } |
| 363 | 360 |
| 364 DEFINE_TRACE(KeyframeEffect) | 361 DEFINE_TRACE(KeyframeEffect) |
| 365 { | 362 { |
| 366 visitor->trace(m_target); | 363 KeyframeEffectReadOnly::trace(visitor); |
| 367 visitor->trace(m_model); | |
| 368 visitor->trace(m_sampledEffect); | |
| 369 AnimationEffectReadOnly::trace(visitor); | |
| 370 } | 364 } |
| 371 | 365 |
| 372 } // namespace blink | 366 } // namespace blink |
| OLD | NEW |