gecko/dom/animation
Brian Birtles 145bc92aff Bug 927349 part 8 - Fast-forward the timeline before resolving start times; r=jwatt
Normally animation players get times from their timeline which is based on the
refresh driver for their associated document. However, for animations that
we time from when their first frame has been rendered, we want to record the
actual time when painting finished as their start time. If we wait until the
next refresh driver tick then the delay between playing an animation and its
actual start will be too great.

In this patch, we introduce a mechanism for fast-forwarding a timeline to a
time between the current refresh driver time and the next refresh driver tick.
By adjusting the timeline rather than the player we maintain a consistent state
(in fact, if we just naively set the animation player start time to the
timestamp value we recorded when painting finished it will appear to start in
the future and the animation will temporarily jump from playing, to waiting to
start, then back to playing again on the next refresh driver tick).

To be completely consistent, however, when we fast-forward the timeline we
should tell all animation players listening to the timeline to mark their
target element as needing a style flush. Otherwise we may be able to observe an
inconsistency between some animation players' current time and the computed
style of their targets.

We don't, however, currently know which players are observing a given timeline.
We will likely introduce that in the near future (in order to implement
AnimationTimeline.getAnimationPlayers) and fix the inconsistency in timing then.
A test later in the patch series verifies this inconsistency so it is easy to
fix in future.

An alternative approach would be to simply record the time when animation should
start, send that time to the compositor but don't actually update the animation
start time on the main thread until the subsequent refresh driver tick. Such
an approach is complex as it introduces an additional state--"finished pending
but not yet started". We will attempt to switch to that approach in bug 1112480.
2014-12-22 09:35:41 +09:00
..
test Bug 1104435 part 9 - Make getting AnimationPlayer.ready flush for CSS Animation players; r=heycam 2014-12-18 08:42:41 +09:00
Animation.cpp Bug 1078122 part 3 - Move animation value building down to the Animation objects; r=dholbert 2014-10-20 13:55:46 +09:00
Animation.h Bug 1078122 part 9 - Move queuing of CSS animation events to CSSAnimationPlayer; r=dholbert 2014-10-20 13:55:47 +09:00
AnimationEffect.cpp Bug 1045993 part 1 - Add AnimationEffect interface and Animation.effect member; r=dbaron, r=bz 2014-08-22 13:42:47 +01:00
AnimationEffect.h Bug 1078744 - Replace SetIsDOMBinding with SetIsNonDOMBinding, remove nsWrapperCache::SetIsDOMBinding. r=bz. 2014-10-07 11:44:49 +02:00
AnimationPlayer.cpp Bug 927349 part 6 - Rename AnimationPlayer::ResolveStartTime to AnimationPlayer::StartNow; r=jwatt 2014-12-18 08:42:41 +09:00
AnimationPlayer.h Bug 927349 part 6 - Rename AnimationPlayer::ResolveStartTime to AnimationPlayer::StartNow; r=jwatt 2014-12-18 08:42:41 +09:00
AnimationTimeline.cpp Bug 927349 part 8 - Fast-forward the timeline before resolving start times; r=jwatt 2014-12-22 09:35:41 +09:00
AnimationTimeline.h Bug 927349 part 8 - Fast-forward the timeline before resolving start times; r=jwatt 2014-12-22 09:35:41 +09:00
AnimationUtils.h Bug 1072299 - Build dom/animation in unified mode; r=baku 2014-09-25 10:11:43 -04:00
moz.build Bug 927349 part 1 - Add PendingPlayerTracker; r=jwatt 2014-12-18 08:42:41 +09:00
PendingPlayerTracker.cpp Bug 927349 part 1 - Add PendingPlayerTracker; r=jwatt 2014-12-18 08:42:41 +09:00
PendingPlayerTracker.h Bug 927349 part 1 - Add PendingPlayerTracker; r=jwatt 2014-12-18 08:42:41 +09:00