| 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 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/animation/css/CSSAnimations.h" | 32 #include "core/animation/css/CSSAnimations.h" |
| 33 | 33 |
| 34 #include "StylePropertyShorthand.h" | 34 #include "StylePropertyShorthand.h" |
| 35 #include "core/animation/ActiveAnimations.h" | 35 #include "core/animation/ActiveAnimations.h" |
| 36 #include "core/animation/CompositorAnimations.h" | 36 #include "core/animation/CompositorAnimations.h" |
| 37 #include "core/animation/DocumentTimeline.h" | 37 #include "core/animation/DocumentTimeline.h" |
| 38 #include "core/animation/KeyframeEffectModel.h" | 38 #include "core/animation/KeyframeEffectModel.h" |
| 39 #include "core/animation/LegacyStyleInterpolation.h" |
| 39 #include "core/animation/css/CSSAnimatableValueFactory.h" | 40 #include "core/animation/css/CSSAnimatableValueFactory.h" |
| 40 #include "core/animation/css/CSSAnimationDataList.h" | 41 #include "core/animation/css/CSSAnimationDataList.h" |
| 41 #include "core/animation/css/CSSPropertyEquality.h" | 42 #include "core/animation/css/CSSPropertyEquality.h" |
| 42 #include "core/css/CSSKeyframeRule.h" | 43 #include "core/css/CSSKeyframeRule.h" |
| 43 #include "core/css/resolver/StyleResolver.h" | 44 #include "core/css/resolver/StyleResolver.h" |
| 44 #include "core/dom/Element.h" | 45 #include "core/dom/Element.h" |
| 45 #include "core/dom/PseudoElement.h" | 46 #include "core/dom/PseudoElement.h" |
| 46 #include "core/events/TransitionEvent.h" | 47 #include "core/events/TransitionEvent.h" |
| 47 #include "core/events/WebKitAnimationEvent.h" | 48 #include "core/events/WebKitAnimationEvent.h" |
| 48 #include "core/frame/UseCounter.h" | 49 #include "core/frame/UseCounter.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 436 |
| 436 AnimatableValueKeyframeVector newFrames; | 437 AnimatableValueKeyframeVector newFrames; |
| 437 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get())
); | 438 newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get())
); |
| 438 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get())
); | 439 newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get())
); |
| 439 | 440 |
| 440 newFrames[0]->clearPropertyValue(id); | 441 newFrames[0]->clearPropertyValue(id); |
| 441 RefPtr<InertAnimation> inertAnimationForSampling = InertAnimation::c
reate(oldAnimation->effect(), oldAnimation->specifiedTiming(), false); | 442 RefPtr<InertAnimation> inertAnimationForSampling = InertAnimation::c
reate(oldAnimation->effect(), oldAnimation->specifiedTiming(), false); |
| 442 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation
> > > sample = inertAnimationForSampling->sample(inheritedTime); | 443 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation
> > > sample = inertAnimationForSampling->sample(inheritedTime); |
| 443 ASSERT(sample->size() == 1); | 444 ASSERT(sample->size() == 1); |
| 444 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample
->at(0).get())->currentValue()); | 445 newFrames[0]->setPropertyValue(id, toLegacyStyleInterpolation(sample
->at(0).get())->currentValue()); |
| 446 ASSERT(newFrames[0]->propertyValue(id)); |
| 445 | 447 |
| 446 effect = AnimatableValueKeyframeEffectModel::create(newFrames); | 448 effect = AnimatableValueKeyframeEffectModel::create(newFrames); |
| 447 } | 449 } |
| 448 | 450 |
| 449 RefPtr<Animation> transition = Animation::create(element, effect, inertA
nimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.releas
e()); | 451 RefPtr<Animation> transition = Animation::create(element, effect, inertA
nimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.releas
e()); |
| 450 RefPtr<AnimationPlayer> player = element->document().transitionTimeline(
).createAnimationPlayer(transition.get()); | 452 RefPtr<AnimationPlayer> player = element->document().transitionTimeline(
).createAnimationPlayer(transition.get()); |
| 451 element->document().compositorPendingAnimations().add(player.get()); | 453 element->document().compositorPendingAnimations().add(player.get()); |
| 452 player->update(TimingUpdateOnDemand); | 454 player->update(TimingUpdateOnDemand); |
| 453 runningTransition.player = player; | 455 runningTransition.player = player; |
| 454 m_transitions.set(id, runningTransition); | 456 m_transitions.set(id, runningTransition); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 } | 894 } |
| 893 | 895 |
| 894 void CSSAnimationUpdate::trace(Visitor* visitor) | 896 void CSSAnimationUpdate::trace(Visitor* visitor) |
| 895 { | 897 { |
| 896 visitor->trace(m_newTransitions); | 898 visitor->trace(m_newTransitions); |
| 897 visitor->trace(m_activeInterpolationsForAnimations); | 899 visitor->trace(m_activeInterpolationsForAnimations); |
| 898 visitor->trace(m_activeInterpolationsForTransitions); | 900 visitor->trace(m_activeInterpolationsForTransitions); |
| 899 } | 901 } |
| 900 | 902 |
| 901 } // namespace WebCore | 903 } // namespace WebCore |
| OLD | NEW |