gecko-dev/dom/animation
Brian Birtles 8ab108c3be Bug 1188251 part 8 - Remove call to Animation::Tick from CheckAnimationRule; r=dholbert
We want to move the newly-introduced RequestRestyle call from FlushAnimations
to Animation::Tick. However, nsAnimationManager::CheckAnimationRule calls
Animation::Tick so this would cause us to start posting animation restyles
within a restyle.

Typically, Animations have an effect (currently there is only one type of
effect: KeyframeEffectReadOnly) and when there is any change in timing they
pass it down to their effect. However, the Animation is dependent on the
duration of the effect for determining if it is "finished" or not. As a result,
when an effect's timing changes, the owning Animation needs to know.

(The way this *should* work is that effects should tell their animation or
trigger some chain of events that causes animation's to update themselves.
However, the current implementation of effects is fairly primitive and does
not do this or even have a reference to the owning Animation. When we
implement the script API for updating the timing properties of effects we will
have to fix this but for now it is up to code in layout/style to update the
Animation when it touches the corresponding effect's timing.)

nsAnimationManager::CheckAnimationRule currently does this by calling
Animation::Tick() which ensures the Animation's finished state is updated
accordingly.

Ultimately we want to ensure that Animation::Tick is called exactly once per
frame (and at the appropriate point in that frame) so we'd like to remove this
call from CheckAnimationRule.

This patch achieves that by:

* Making Animation::SetEffect update the animation's timing - this is necessary
  for animations that are created by CheckAnimationRule and will be
  necessary when once we make Animation.effect writeable from script anyway.

* Calling Animation::SetEffect even for the case when we are updating the
  existing effect.

Another side-effect of calling Animation::Tick within
nsAnimationManager::CheckAnimationRule is that CSSAnimation::Tick queues
events. There are some tests (e.g. layout/style/test/test_animations.html) that
assume that animationstart events are dispatched immediately when new
animations are created. That will change with bug 1134163 but for now we
should maintain this existing behavior since changing this might introduce
compatibility issues that are best dealt with as a separate bug rather than
blocking this refactoring. To that end, this patch also explicitly queues
animationstart events for newly-created animations.
2015-08-17 13:59:45 +09:00
..
test Bug 1178664 - Part 4 -Implement Animation.oncancel event. r=bbirtles, r=smaug 2015-07-30 23:26:00 +02:00
Animation.cpp Bug 1188251 part 8 - Remove call to Animation::Tick from CheckAnimationRule; r=dholbert 2015-08-17 13:59:45 +09:00
Animation.h Bug 1180125 part 2 - Move AnimationCommon classes out of CSS namespace; r=dbaron 2015-07-29 10:57:39 +09:00
AnimationComparator.h Bug 1171817 part 14 - Add AnimationPtrComparator class; r=dbaron 2015-06-09 11:13:54 +09:00
AnimationEffectReadOnly.cpp Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
AnimationEffectReadOnly.h Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
AnimationTimeline.cpp Bug 1182981 part 2 - Use nsTHashtable::Iterator in AnimationTimeline; r=njn 2015-07-21 10:47:23 +09:00
AnimationTimeline.h Bug 1113086 follow-up: Add a forward declaration to fix build bustage 2015-07-10 20:49:32 -04:00
AnimationUtils.h Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
DocumentTimeline.cpp Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
DocumentTimeline.h Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
KeyframeEffect.cpp Bug 1181392 part 3 - Remove use of IsFinishedTransition in KeyframeEffectReadOnly; r=dbaron 2015-08-07 12:29:35 +09:00
KeyframeEffect.h Bug 1181392 part 10 - Remove KeyframeEffect::IsFinishedTransition; r=dbaron 2015-08-07 12:29:36 +09:00
PendingAnimationTracker.cpp Bug 1182981 part 1 - Use nsTHashtable::Iterator in PendingAnimationTracker; r=njn 2015-07-21 10:47:13 +09:00
PendingAnimationTracker.h Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
moz.build Bug 1171817 part 14 - Add AnimationPtrComparator class; r=dbaron 2015-06-09 11:13:54 +09:00