Граф коммитов

446 Коммитов

Автор SHA1 Сообщение Дата
Brian Birtles e293c228f5 Bug 1166164 part 6 - Make pausing from idle set the current time; r=jwatt, r=smaug
As proposed:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0013.html (item g)

And agreed upon here:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0031.html

--HG--
extra : rebase_source : baca2fa6b9ba94afb1bb3e072e33729774a34f19
extra : histedit_source : 8348f3e8029017dbe380e30dbfc2f66b201beaf0
2015-05-19 14:55:26 +09:00
Brian Birtles f73f30be29 Bug 1166164 part 5 - Make play() throw when it should seek to the end of an infinite effect; r=jwatt, r=smaug
--HG--
extra : rebase_source : dade110e0d071727ed5bfdb694415ae7980f4467
extra : histedit_source : 1d87ee7db7fd0ec9670fff546e4654fa07bf4f31
2015-05-19 14:00:48 +09:00
Brian Birtles 6198ebeea8 Bug 1166164 part 4 - Make finished promise not resolve when paused; r=jwatt
As resolved, https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0038.html
item 2.

--HG--
extra : rebase_source : 9f321446c9cd9ac4dcdefa4ca441ac8f3e76fc8f
2015-05-19 08:51:13 +09:00
Brian Birtles 152d424f77 Bug 1166164 part 3 - Resolve start time on finish(); r=jwatt
We have already resolved to make calling Finish() clear the pause state (see
https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0038.html, item 2).
Doing that involves resolving the start time when the animation is paused.

Furthermore, as a separate change, we resolved to make the finished promise not
resolve when the animation is paused. That suggests making UpdateFinishedState()
only resolve the finished promise when PlayState() == Finished rather than using
IsFinished() which returns true even if the animation is paused.

However, if we compare PlayState() == Finished in UpdateFinishedState() then we
will *not* resolve the finished promise when the animation is play-pending since
PlayState() == Pending in that case (pause-pending is ok since the call to
SetCurrentTime will cause a transition to the Paused state). Furthermore, the
existing call to cancel the pending play task will effectively leave this
animation forever pending. Hence, in this patch we unconditionally fill in the
start time.

--HG--
extra : rebase_source : 499ad0530eac0ee62c8ed2df41360c45abc34816
2015-05-19 10:08:46 +09:00
Brian Birtles f28d7941d9 Bug 1166164 part 2 - Make UpdateFinishedState take a non-defaulted enum; r=jwatt
This is much easier to read at call sites and prevents accidentally using the
default value when another value might be more suitable.

--HG--
extra : rebase_source : b1c05d8bf7b97744e53f2ecc676561f3a4a80888
2015-05-11 17:17:06 +09:00
Brian Birtles cd4f9730c1 Bug 1166164 part 1 - Make setting the current time complete a pending pause, not abort it; r=jwatt
The point of making pausing async is to allow time to sync up the current time
with the compositor. Setting the current time manually should simply force it to
the specified time and complete the pause action, not abort it. (We do a similar
thing for a pending play. For a pending play we're waiting to establish
a suitable start time. Manually setting the start time in that case simply
forces the start time to the specified time and completes the play operation.)

--HG--
extra : rebase_source : 614ed9ef01204e4137783c0d48e975eb8febbe2a
2015-05-18 11:41:19 +09:00
Brian Birtles 87aaa8fc5f Bug 1164330 - Rename time fraction to (iteration) progress; r=jwatt
--HG--
extra : rebase_source : ca36d4d5dab2d08d42c7daa1e6778cda1408f465
2015-05-13 13:57:35 +09:00
Brian Birtles 3947001236 Bug 1161320 - Fix conflict between finishing and aborting a pause; r=jwatt
Animation::ResumeAt contains an assertion that, when we exit the play-pending
state, checks we either have a resolved start time or a resolved hold time.

That's normally true but if we are aborting a pause on animation that is
finished we can end up with a resolved start time (since we don't clear the
start time when we're aborting a pause) and a resolved hold time (either
because the regular finishing behavior set one, or, because play() applied
auto-rewinding behavior and set it).

In that case we should actually respect the hold time and update the start time
when resuming the animation. However, ResumeAt won't update the start time if it
is already set.

This patch fixes that by clearing the start time in DoPlay in the case where we
are aborting a pause and have a hold time.

--HG--
extra : rebase_source : 83f980d6cbc34375274f30f6527992b4fec7f639
2015-05-08 16:17:13 +09:00
Andrew McCreight 023db96fd8 Bug 1152551, part 3 - Fix more mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Boris Zbarsky ca0723ea4a Bug 1159743. Stop forcing the dom.animations-api.core.enabled preference on in the test harness. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-cancel.html => dom/animation/test/css-animations/file_animation-cancel.html
rename : dom/animation/test/css-animations/test_animation-currenttime.html => dom/animation/test/css-animations/file_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-finish.html => dom/animation/test/css-animations/file_animation-finish.html
rename : dom/animation/test/css-animations/test_animation-finished.html => dom/animation/test/css-animations/file_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-pausing.html => dom/animation/test/css-animations/file_animation-pausing.html
rename : dom/animation/test/css-animations/test_animation-playstate.html => dom/animation/test/css-animations/file_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-ready.html => dom/animation/test/css-animations/file_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-starttime.html => dom/animation/test/css-animations/file_animation-starttime.html
rename : dom/animation/test/css-animations/test_animations-dynamic-changes.html => dom/animation/test/css-animations/file_animations-dynamic-changes.html
rename : dom/animation/test/css-animations/test_effect-name.html => dom/animation/test/css-animations/file_effect-name.html
rename : dom/animation/test/css-animations/test_effect-target.html => dom/animation/test/css-animations/file_effect-target.html
rename : dom/animation/test/css-animations/test_element-get-animations.html => dom/animation/test/css-animations/file_element-get-animations.html
rename : dom/animation/test/css-transitions/test_animation-cancel.html => dom/animation/test/css-transitions/file_animation-cancel.html
rename : dom/animation/test/css-transitions/test_animation-currenttime.html => dom/animation/test/css-transitions/file_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-finished.html => dom/animation/test/css-transitions/file_animation-finished.html
rename : dom/animation/test/css-transitions/test_animation-pausing.html => dom/animation/test/css-transitions/file_animation-pausing.html
rename : dom/animation/test/css-transitions/test_animation-ready.html => dom/animation/test/css-transitions/file_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-starttime.html => dom/animation/test/css-transitions/file_animation-starttime.html
rename : dom/animation/test/css-transitions/test_effect-name.html => dom/animation/test/css-transitions/file_effect-name.html
rename : dom/animation/test/css-transitions/test_effect-target.html => dom/animation/test/css-transitions/file_effect-target.html
rename : dom/animation/test/css-transitions/test_element-get-animations.html => dom/animation/test/css-transitions/file_element-get-animations.html
rename : dom/animation/test/document-timeline/test_document-timeline.html => dom/animation/test/document-timeline/file_document-timeline.html
rename : dom/animation/test/mozilla/test_deferred_start.html => dom/animation/test/mozilla/file_deferred_start.html
rename : layout/style/test/test_animations_pausing.html => layout/style/test/file_animations_pausing.html
2015-04-30 14:25:03 -04:00
Wes Kocher fa3603804d Backed out changeset 4d85a02e9c28 (bug 1159743) under suspicion of breaking animation tests CLOSED TREE 2015-04-30 15:25:58 -07:00
Boris Zbarsky 5844aafa2d Bug 1159743. Stop forcing the dom.animations-api.core.enabled preference on in the test harness. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-cancel.html => dom/animation/test/css-animations/file_animation-cancel.html
rename : dom/animation/test/css-animations/test_animation-currenttime.html => dom/animation/test/css-animations/file_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-finish.html => dom/animation/test/css-animations/file_animation-finish.html
rename : dom/animation/test/css-animations/test_animation-finished.html => dom/animation/test/css-animations/file_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-pausing.html => dom/animation/test/css-animations/file_animation-pausing.html
rename : dom/animation/test/css-animations/test_animation-playstate.html => dom/animation/test/css-animations/file_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-ready.html => dom/animation/test/css-animations/file_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-starttime.html => dom/animation/test/css-animations/file_animation-starttime.html
rename : dom/animation/test/css-animations/test_animations-dynamic-changes.html => dom/animation/test/css-animations/file_animations-dynamic-changes.html
rename : dom/animation/test/css-animations/test_effect-name.html => dom/animation/test/css-animations/file_effect-name.html
rename : dom/animation/test/css-animations/test_effect-target.html => dom/animation/test/css-animations/file_effect-target.html
rename : dom/animation/test/css-animations/test_element-get-animations.html => dom/animation/test/css-animations/file_element-get-animations.html
rename : dom/animation/test/css-transitions/test_animation-cancel.html => dom/animation/test/css-transitions/file_animation-cancel.html
rename : dom/animation/test/css-transitions/test_animation-currenttime.html => dom/animation/test/css-transitions/file_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-finished.html => dom/animation/test/css-transitions/file_animation-finished.html
rename : dom/animation/test/css-transitions/test_animation-pausing.html => dom/animation/test/css-transitions/file_animation-pausing.html
rename : dom/animation/test/css-transitions/test_animation-ready.html => dom/animation/test/css-transitions/file_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-starttime.html => dom/animation/test/css-transitions/file_animation-starttime.html
rename : dom/animation/test/css-transitions/test_effect-name.html => dom/animation/test/css-transitions/file_effect-name.html
rename : dom/animation/test/css-transitions/test_effect-target.html => dom/animation/test/css-transitions/file_effect-target.html
rename : dom/animation/test/css-transitions/test_element-get-animations.html => dom/animation/test/css-transitions/file_element-get-animations.html
rename : dom/animation/test/document-timeline/test_document-timeline.html => dom/animation/test/document-timeline/file_document-timeline.html
rename : dom/animation/test/mozilla/test_deferred_start.html => dom/animation/test/mozilla/file_deferred_start.html
rename : layout/style/test/test_animations_pausing.html => layout/style/test/file_animations_pausing.html
2015-04-30 14:25:03 -04:00
Brian Birtles a606228cd8 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly. r=smaug 2015-04-30 09:06:43 -04:00
Carsten "Tomcat" Book b05d97c166 Backed out changeset 1b5fc672f0d4 (bug 1159082) for B2G ICS Emulator opt R6 test failures on a CLOSED TREE
--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffectReadonly.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffectReadonly.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffectReadonly.webidl
2015-04-30 13:15:04 +02:00
Brian Birtles 4fb166f6b2 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly; r=smaug
--HG--
rename : dom/animation/AnimationEffectReadonly.cpp => dom/animation/AnimationEffectReadOnly.cpp
rename : dom/animation/AnimationEffectReadonly.h => dom/animation/AnimationEffectReadOnly.h
rename : dom/webidl/AnimationEffectReadonly.webidl => dom/webidl/AnimationEffectReadOnly.webidl
extra : rebase_source : 5fb31684bf494a57e208d0cfbbc76f65b502fc0e
2015-04-28 10:16:45 +09:00
Brian Birtles 063783952d Bug 1157989 part 4 - Make method comment style consistent; r=jwatt 2015-04-27 10:05:47 +09:00
Brian Birtles 8625e1337a Bug 1157989 part 3 - Make LimitBehavior enum a scoped enum; r=jwatt 2015-04-27 10:05:47 +09:00
Brian Birtles fb3e1108d4 Bug 1157989 part 2 - Make Silently* methods protected; r=jwatt
These methods aren't part of the public API.
2015-04-27 10:05:46 +09:00
Brian Birtles 9104378d5d Bug 1157989 part 1 - Line up methods in dom/animation/Animation with the API; r=jwatt 2015-04-27 10:05:46 +09:00
Brian Birtles 219be8ace6 Bug 1157111 - Remove comment from SilentlySetCurrentTime; r=jwatt
The commented-out step has now been removed from the spec:

  34c2bc9272
2015-04-27 08:53:19 +09:00
Brian Birtles e2c7d46cdc Bug 1150807 part 5 - Tests for Animation.cancel(); r=jwatt 2015-04-27 08:53:19 +09:00
Brian Birtles 012ebba32c Bug 1150807 part 3 - Call PostUpdate from Cancel; r=jwatt
This patch makes Cancel() call PostUpdate which clobbers certain state in style
so that animated style is correctly flushed when an animation is cancelled.

The main difficulty with this is that we *don't* want to call this when we're
cancelling an animation as a result of a style update or else we'll trigger
needless work. The pattern elsewhere has been to define a *FromStyle() method
for this case (e.g. CSSAnimation::PlayFromStyle, PauseFromStyle). This isn't
ideal because there's always the danger we will forget to call the appropriate
*FromStyle method. It is, however, consistent. Hopefully in bug 1151731 we'll
find a better way of expressing this.
2015-04-27 08:53:19 +09:00
Brian Birtles b34276b816 Bug 1150807 part 2 - Expose Animation::Cancel in WebIDL; r=smaug 2015-04-27 08:53:18 +09:00
Brian Birtles a4696386d6 Bug 1150807 part 1 - Fix SilentlySetCurrentTime to not set the start time when it is unresolved; r=jwatt
The reasoning for this change is described here:

  https://lists.w3.org/Archives/Public/public-fx/2015AprJun/0027.html

Furthermore, subsequent tests introduced in this bug for the animation playState
depend on this change.
2015-04-27 08:53:18 +09:00
Jonathan Watt 9b67d4237d Bug 1157074 - Fix Web Animations' Web Platform tests to make them use step_func when they should. r=birtles 2015-04-20 14:22:29 +01:00
Jonathan Watt 71628632b1 Bug 1157053 - Test restarting of finished transitions. r=birtles 2015-04-17 13:45:20 +01:00
Jonathan Watt b50aebf2a7 Bug 1150064, part 2 - Add Web Platform tests for the Animation.finish() method. r=birtles 2015-04-16 17:16:01 +01:00
Jonathan Watt 7646a6a26c Bug 1150064, part 1 - Implement the Animation.finish() method. r=birtles, r=smaug 2015-04-16 17:15:20 +01:00
Jonathan Watt 31e4e5bba1 Bug 1157086 - Fix order of test listing in dom/animation/test/mochitest.ini. r=birtles 2015-04-15 11:17:57 +01:00
Jonathan Watt 70590b52f4 Bug 1150054, part 2 - Convert the Web Animations tests to use the new EventWatcher constructor from upstream. r=Ms2ger
--HG--
extra : rebase_source : 2ba088b32444753ebf1e34b7ccd9c6b22b13b780
2015-04-14 20:54:10 +01:00
Brian Birtles 974f89ccdd Bug 1154615 part 9 - Rename test files; r=jwatt
--HG--
rename : dom/animation/test/css-animations/test_animation-player-currenttime.html => dom/animation/test/css-animations/test_animation-currenttime.html
rename : dom/animation/test/css-animations/test_animation-player-finished.html => dom/animation/test/css-animations/test_animation-finished.html
rename : dom/animation/test/css-animations/test_animation-player-playstate.html => dom/animation/test/css-animations/test_animation-playstate.html
rename : dom/animation/test/css-animations/test_animation-player-ready.html => dom/animation/test/css-animations/test_animation-ready.html
rename : dom/animation/test/css-animations/test_animation-player-starttime.html => dom/animation/test/css-animations/test_animation-starttime.html
rename : dom/animation/test/css-animations/test_element-get-animation-players.html => dom/animation/test/css-animations/test_element-get-animations.html
rename : dom/animation/test/css-transitions/test_animation-player-currenttime.html => dom/animation/test/css-transitions/test_animation-currenttime.html
rename : dom/animation/test/css-transitions/test_animation-player-ready.html => dom/animation/test/css-transitions/test_animation-ready.html
rename : dom/animation/test/css-transitions/test_animation-player-starttime.html => dom/animation/test/css-transitions/test_animation-starttime.html
rename : dom/animation/test/css-transitions/test_element-get-animation-players.html => dom/animation/test/css-transitions/test_element-get-animations.html
2015-04-21 10:22:10 +09:00
Brian Birtles 2cfdd7ac06 Bug 1154615 part 7 - Rename CSSAnimationPlayer and CSSTransitionPlayer; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles 13834006d7 Bug 1154615 part 6 - Rename references to players within layout/; r=jwatt
We will rename CSSAnimationPlayer/CSSTransitionPlayer in a separate patch
2015-04-21 10:22:10 +09:00
Brian Birtles 8f5fbac8a9 Bug 1154615 part 5 - Rename AnimationPlayerCollection to AnimationCollection; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles bd4c87f07a Bug 1154615 part 4 - Rename references to players in dom/animation; r=jwatt
This patch does not, however,  update references to
AnimationPlayerCollection/CSSTransitionPlayer etc. which we will fix when we get
to layout/style.
2015-04-21 10:22:09 +09:00
Brian Birtles a691fc0c34 Bug 1154615 part 3 - Rename internal members of PendingAnimationTracker; r=jwatt 2015-04-21 10:22:09 +09:00
Brian Birtles 4f7bf25c27 Bug 1154615 part 2 - Rename PendingPlayerTracker to PendingAnimationTracker; r=jwatt
This patch also updates the method names on PendingAnimationTracker but leaves
a number of local variables which will be fixed in a subsequent patch.

--HG--
rename : dom/animation/PendingPlayerTracker.cpp => dom/animation/PendingAnimationTracker.cpp
rename : dom/animation/PendingPlayerTracker.h => dom/animation/PendingAnimationTracker.h
2015-04-21 10:22:09 +09:00
Brian Birtles 5c7929fd2a Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
This patch is a fairly minimal rename of the AnimationPlayer interface. It
leaves a bunch of local variables and helper classes still using the word
"player". These will be addressed in subsequent patches that don't require DOM
peer review.

--HG--
rename : dom/animation/AnimationPlayer.cpp => dom/animation/Animation.cpp
rename : dom/animation/AnimationPlayer.h => dom/animation/Animation.h
rename : dom/webidl/AnimationPlayer.webidl => dom/webidl/Animation.webidl
2015-04-21 10:22:09 +09:00
Jonathan Watt 10b49eebc0 Bug 1149990 - Support replaying of finished CSS transitions by supporting setting of currentTime/startTime. r=birtles 2015-04-06 23:48:55 +01:00
L. David Baron e53c8996ad Bug 1150351 - Reënable test_deferred_start.html on Linux, since the bug for which we disabled it has disappeared. 2015-04-17 09:13:13 -07:00
L. David Baron f6f9831d21 Bug 980770 - Enable off-main-thread animations on Linux (and other X11 based platforms), for nightly/aurora. r=birtles 2015-04-16 18:13:15 -07:00
Brian Birtles 7d31acbd42 Bug 1153734 part 5 - Add AnimationEffectReadonly as a superinterface of KeyframeEffectReadonly; r=smaug
This patch also replaces some tabs with spaces in KeyframeEffect.h because I was
in the area.
2015-04-15 08:48:21 +09:00
Brian Birtles 6120d1a6c4 Bug 1153734 part 4 - Rename other uses of 'source' and 'source content'; r=jwatt
This patch also tightens up a one or two references to 'target effect' replacing
them with just 'effect'. This is because 'target effect' is longer and easily
confused with 'target element'. 'effect' should be sufficient. 'target element'
is a term from the Web Animations specification and in that context, simply
referring to the 'effect' would sound a little odd.
2015-04-15 08:48:21 +09:00
Brian Birtles 2d26fd38cb Bug 1153734 part 3 - Rename AnimationPlayer.source to AnimationPlayer.effect; r=smaug
There are still some other references to "source" in AnimationPlayer such as
HasInPlayerSource and UpdateSourceContent. These are renamed in a subsequent
patch (that doesn't require DOM peer review).
2015-04-15 08:48:21 +09:00
Brian Birtles 63e2382338 Bug 1153734 part 2 - Rename Animation to KeyframeEffectReadonly; r=smaug
We define KeyframeEffectReadonly in KeyframeEffect.cpp since Web Animations also
defines KeyframeEffect and when we come to implement that I expect we'll define
it in the same class, maybe even using the same object.

This patch also adds a few missing includes in places where
KeyframeEffectReadonly is used so that we're not just cargo-culting it in.

--HG--
rename : dom/animation/Animation.cpp => dom/animation/KeyframeEffect.cpp
rename : dom/animation/Animation.h => dom/animation/KeyframeEffect.h
rename : dom/animation/test/css-animations/test_animation-name.html => dom/animation/test/css-animations/test_effect-name.html
rename : dom/animation/test/css-animations/test_animation-target.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-transitions/test_animation-name.html => dom/animation/test/css-transitions/test_effect-name.html
rename : dom/animation/test/css-transitions/test_animation-target.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/webidl/Animation.webidl => dom/webidl/KeyframeEffect.webidl
2015-04-15 08:48:21 +09:00
Brian Birtles d5b5205359 Bug 1153734 part 1 - Remove AnimationEffect; r=smaug
Most of this is fairly obvious. However, the addition of 'override' to
ElementPropertyTransition::Name() is not strictly necessary. It was simply added
because while making these changes I accidentally dropped the 'virtual' keyword
from the method in the superclass and the compiler didn't complain. Adding this
will hopefully make it harder to create the same bug in the future.

--HG--
rename : dom/animation/test/css-animations/test_animation-effect-name.html => dom/animation/test/css-animations/test_animation-name.html
rename : dom/animation/test/css-transitions/test_animation-effect-name.html => dom/animation/test/css-transitions/test_animation-name.html
2015-04-15 08:48:20 +09:00
Brian Birtles 121b831ff7 Bug 1122414 part 2 - Return the transitionProperty from Animation.name for CSS transitions; r=jwatt
This is a bit awkward. We lazily set mName to the transition property and then
return it. The reasons for this approach are:

* We don't really want to eagerly fill in mName for all transitions since in
  99% of cases we'll never use it and this will lead to wasted allocations.

* The signature of Name() returns a const nsString reference. This is because
  Name() is used when building CSS Animations (to compare different copies of
  the same animation when updating). For that case we don't really want to
  generate unnecessary copies of nsString objects so we return a reference.
  However, that means for transitions as well we need to return a reference so
  we can't just generate a temporary string on-demand.

  As a result we also have to const-cast ourselves so we can update the mName
  member. We could make mName mutable but seeing as it's only set once, the
  const_cast seems more appropriate.
2015-04-14 09:13:27 +09:00
Brian Birtles 9838a4dd51 Bug 1134381 - Don't pause an AnimationPlayer if it is already paused; r=jwatt 2015-04-14 09:07:41 +09:00
Brian Birtles 6b5fcefb36 Bug 1152171 part 2 - Rename AnimationTimeline to DocumentTimeline; r=smaug
And then re-add AnimationTimeline as an abstract super-interface of
DocumentTimeline.

--HG--
rename : dom/animation/AnimationTimeline.cpp => dom/animation/DocumentTimeline.cpp
rename : dom/animation/AnimationTimeline.h => dom/animation/DocumentTimeline.h
rename : dom/animation/test/animation-timeline/test_animation-timeline.html => dom/animation/test/document-timeline/test_document-timeline.html
rename : dom/animation/test/animation-timeline/test_request_animation_frame.html => dom/animation/test/document-timeline/test_request_animation_frame.html
2015-04-10 10:34:22 +09:00
Brian Birtles 41ae9d94b3 Bug 1152171 part 1 - Remove AnimationTimeline IDL tests from dom/animation/tests; r=Ms2ger
The tests in dom/animation/tests/ use an old version of idlharness.js that
doesn't support inherited interfaces. As discussed in bug 1152619 we're not
looking at updating these old tests (under dom/imptests) at the moment which
means we won't be able to update the IDL tests in dom/animation/tests/ to
continue passing once we introduce DocumentTimeline as a subinterface of
AnimationTimeline.

As a result, this patch simply the removes the IDL tests for this interface from
dom/animation/tests. However, we have a test for this interface in
web-platform-tests where I've set up a pull request to apply the required
renaming so we should eventually get test coverage for this renaming.

  https://github.com/w3c/web-platform-tests/pull/1748

In the long run, all the tests in dom/animation/tests should end up in
web-platform-tests. The main reason they aren't there yet is that most of them
test the mapping between the Web Animations API and CSS and there's currently no
spec defining that so there's no place to put them in the web-platform-tests
repository.

There are a few tests for animation timeline which could be landed in
web-platform-tests (and then removed from dom/animation/tests) but we need to
discuss with Google if this is the desired behavior or not first. For the time
being I have a branch setup for that and I'm leaving the tests in
dom/animation/tests so we continue to test what *we* think the behavior should
be in the meantime. That branch is here:

  https://github.com/birtles/web-platform-tests/compare/rename-animation-timeline...birtles:add-hidden-iframe-tests
2015-04-10 10:25:51 +09:00
Markus Stange ab28a4f0c8 Bug 1151346 - Make ActiveLayerTracker::IsOffsetOrMarginStyleAnimated respect CSS animations. r=roc
--HG--
extra : rebase_source : a3594dcb2d8733b6f545c6cf713178ea0d953889
2015-04-05 22:53:51 -04:00
L. David Baron 0e99a69e5c Back out changesets 6ea87def95b9 and 288ad0365a5e (bug 980770, enable OMT animations) for frequently-intermittent Mac talos glterrain crashes, on a CLOSED TREE. 2015-04-01 22:35:47 -07:00
L. David Baron 930b93fdd5 Bug 980770 followup - Disable test_deferred_start on Linux mochitest-e10s (probably because bug 1149391 also landed today). 2015-04-01 22:02:15 -07:00
Cameron McCormack 573008d81b Bug 1145912 - Wait for animations to start before continuing in subtests that assume they are running. r=birtles 2015-04-02 14:56:14 +11:00
Brian Birtles f09556d158 Bug 1149906 - Consider play-pending animations to be playing as well r=dbaron 2015-04-01 17:22:02 +09:00
L. David Baron 953d3f8dfc Bug 1150288 - Restore old behavior of mIsPreviousStateFinished into a new variable, since we need it in CanThrottle. r=birtles
(I don't understand the motivation for the changes to how it was set,
but this just switches to having two variables for the two uses.)

This fixes the test failures in test_animations_omta.html with OMT
animations enabled.
2015-04-01 20:30:17 -07:00
Jonathan Watt 3b2af93056 Bug 1149832 - Replace the Web Animations test helper waitForTwoAnimationFrames() with a helper that takes a frame count. r=birtles
--HG--
extra : rebase_source : 53fc4046b34b6cd961b26d0f1c20ede63f5d9d19
2015-03-31 23:27:19 +01:00
Jonathan Watt e5a139e3a8 Bug 1147491, part 1 - Fix playbackRate crash due to integer rounding causing divide-by-zero. r=dholbert 2015-03-30 16:27:05 +01:00
Jonathan Watt 51f8723d56 Bug 1072037, part 3 - Tests for the effect of setting CSS transition's AnimationPlayer.currentTime. r=birtles 2015-03-25 10:21:28 +00:00
Brian Birtles 9e4a6fc06a Bug 1109390 part 28 - Add tests for the AnimationPlayer.startTime when pausing asynchronously; r=jwatt 2015-04-01 12:23:25 +09:00
Brian Birtles 955a3c9adb Bug 1109390 part 27 - Add further test to test_animations-pausing.html for cancelling a pause by setting the current time; r=jwatt 2015-04-01 12:23:25 +09:00
Brian Birtles 51d5cba7a7 Bug 1109390 part 26 - Add further tests for ready promise when pausing; r=jwatt 2015-04-01 12:23:25 +09:00
Brian Birtles 41859f41f2 Bug 1109390 part 25 - Make pausing asynchronous
This patch (finally) puts pausing animations in the pending player map so that
they are resolved asynchronously.

Since this changes the pausing behavior this patch updates a number of tests so
that they continue to pass.
2015-04-01 12:23:25 +09:00
Brian Birtles 7fb9e8ef27 Bug 1109390 part 24 - Use wallclock time when refreshing the style of animations that need to be synchronized with the compositor; r=jwatt 2015-04-01 12:23:25 +09:00
Brian Birtles 1060d42f7b Bug 1109390 part 23 - Add aborted pause behavior; r=jwatt
When a pending pause operation is interrupted by a play operation we should
preserve the original start time of the animation so that it appears to continue
moving uninterrupted. At the same time, however, for consistency with other
calls to play(), the operation should complete asynchronously.
2015-04-01 12:23:25 +09:00
Brian Birtles b5c52f836b Bug 1109390 part 22 - Add AnimationPlayer::PauseAt to complete a pending pause; r=jwatt
This patch adds the method that is called when an asynchronous pause operation
has completed. It is not used yet, however, since we don't yet put
AnimationPlayer objects in the pause-pending map.
2015-04-01 12:23:24 +09:00
Jonathan Watt a51e9dd772 Bug 1145246, part 7 - Add more CSS animation tests to check currentTime clamping. r=birtles 2015-03-23 13:23:19 +00:00
Jonathan Watt 61b57f8fc6 Bug 1145246, part 6 - Remove disabled code from AnimationPlayer::ComposeStyle. r=birtles 2015-03-23 13:23:10 +00:00
Cameron McCormack 3dbfa201e2 Bug 1145912 - Add some logging to help determine why this test intermittently fails; no review. 2015-04-01 10:08:35 +11:00
L. David Baron 1fe6a61ae9 Bug 847287 patch 12 - Check mWinsInCascade for all callers of GetAnimationOfProperty/HasAnimationOfProperty. r=birtles
This patch (after stepping through the call graph) affects the following
places:
 * CommonAnimationManager::GetAnimationsForCompositor, which is used
   only by nsDisplayListBuilder::AddAnimationsAndTransitionsToLayer,
   which already checks the individual animations (so really no change)
 * AnimationPlayerCollection::CanThrottleAnimation
 * ActiveLayerTracker::IsStyleAnimated
 * nsLayoutUtils::HasAnimationsForCompositor
 * nsLayoutUtils::HasAnimations (which is used only to check whether we
   can make the 0-opacity optimization)
I believe it makes sense to change all of these locations (although in
the long term we want to throttle (or similar) more animations).

Without this patch, I believe we're forcing the creation of an opacity
layer because we think we have animations to send to it.
2015-03-31 15:05:55 -07:00
L. David Baron a7bdf3d859 Bug 847287 patch 6 - Set mWinsInCascade for CSS Animations. r=birtles
This is the main patch for the bug; it makes us use the mechanism added
in bug 1125455 to avoid sending animations that aren't currently
applying to the compositor.

Patch 7 is needed to make this code rerun in all the cases where we need
to rerun it, though.
2015-03-31 15:05:54 -07:00
Tom Tromey 62331928fc Bug 1149194 - Don't use uninitialized value in ComputedTimingFunction::operator==. r=bbirtles 2015-03-30 09:44:00 -04:00
Jonathan Watt 2b22106122 Bug 1145246, part 3 - Update layout code for the rename of Animatable.getAnimationPlayers() to Animatable.getAnimations(). r=birtles 2015-03-20 18:20:49 +00:00
Jonathan Watt 708ecfa2bf Bug 1145246, part 2 - Update Web Animations code and tests for the rename of Animatable.getAnimationPlayers() to Animatable.getAnimations(). r=birtles 2015-03-20 18:20:37 +00:00
Jonathan Watt aaa7442c3d Bug 1074630, part 2 - CSS animations tests for Web Animations finishing behavior. r=birtles 2015-03-18 13:21:28 +00:00
Jonathan Watt d9bad51ee9 Bug 1074630, part 1 - Implement Web Animations finishing behavior. r=birtles, r=smaug 2015-03-18 13:22:11 +00:00
Brian Birtles 6fd700984b Bug 1109390 part 18 - Rename AnimationPlayer::IsRunning to IsPlaying and reuse IsInPlay definition; r=jwatt
This patch renames the confusing IsRunning method since IsRunning() is *not*
the same as (PlayState() == AnimationPlayState::Running). It also removes
the old definition to make better re-use of PlayState() and IsInPlay().
2015-03-27 18:01:00 +09:00
Brian Birtles 43d8f02ab6 Bug 1109390 part 17 - Add Animation::IsInPlay(); r=jwatt
This patch adds a method for testing if an animation is "in play" which is
a term defined in the Web Animations spec. This is in preparation for removing
some slightly redundant code in IsRunning and aligning better with the spec.
2015-03-27 17:54:39 +09:00
Brian Birtles a7e4fac5e7 Bug 1109390 part 16 - Update IsCurrent to take a player parameter; r=jwatt
In preparation for introducing IsInPlay (where "in play" is a term in the Web
Animations spec), this patch aligns the existing IsCurrent with the definition
in the spec that says an animation effect is only current if it is attached
to an animation (player in our current naming) that is not finished. In order
to ensure that we need to pass the animation/player into the method.

This actually changes the behavior of IsCurrent since now we will return false
for animations that are finished. As far as I can tell, all the call sites that
are requesting current animations should only be concerned with animations that
are actually running. If not, they need to be adjusted to look for animations
that are either current or in effect.
2015-03-27 17:44:38 +09:00
Brian Birtles f404970a0d Bug 1109390 part 15 - Update AnimationPlayer::SetCurrentTime to cancel any pending pause tasks; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles b6167dda0d Bug 1109390 part 14 - Update AnimationPlayer::DoPlay to re-use the ready promise appropriately; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles 46a68f9a61 Bug 1109390 part 13 - Cancel pending pauses as well as pending plays; r=jwatt
This patch simply updates the method that cancels pending plays to also cancel
pending pauses. As it stands, for some of places where this is called it might
not be appropriate to cancel pending pauses but we will adjust each of these
call sites one-by-one in subsequent patches in this series.
2015-03-27 15:56:45 +09:00
Brian Birtles c66558469d Bug 1109390 part 12 - Update IsPaused to handle pause-pending players as well; r=jwatt
IsPaused is used in nsAnimationManager to detect if a newly created animation
should be paused. It is also used inside AnimationPlayer::IsRunning which is
used to determine what animations to send to the compositor (we don't send
paused animations to the compositor). In all these cases we want to treat paused
animations and pause-pending animations alike.

This patch updates IsPaused to include also pause-pending animations. At the
same time it renames IsPaused to IsPausedOrPausing to reflect the change in
behavior.

This patch also adjusts a few nearby one-line functions to put the opening brace
on a new line since apparently this is what the coding style says to do.
2015-03-27 15:56:45 +09:00
Brian Birtles c8f4410743 Bug 1109390 part 11 - Make IsPossiblyOrphanedPendingPlayer deal with pause-pending players too; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles 7192454753 Bug 1109390 part 10 - Add an enum to AnimationPlayer to represent if we are pause-pending or play-pending; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles 7ca856e0a1 Bug 1109390 part 9 - Call Trigger* on pause-pending players; r=jwatt
This won't actually do anything yet because:
(a) We don't yet add pause-pending players to the PendingPlayerTracker
(b) We never mark pausing players as pending so
    AnimationPlayer::TriggerOnNextTick will just ignore them.
2015-03-27 15:56:45 +09:00
Brian Birtles f666a95c80 Bug 1109390 part 8 - Rename Start* methods in AnimationPlayer to Trigger*; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles f7d9eb1f72 Bug 1109390 part 7 - Rename PendingPlayerTracker's Start* methods to Trigger*; r=jwatt
These methods will soon be used to start animations that are waiting to start
and also to finish pausing animations that are waiting to pause. As a result
we rename them to TriggerXXX since that's a bit more generic.

There are still references to StartXXX within PendingPlayerTracker. These will
be updated in a subsequent patch once we have the appropriate methods available
on AnimationPlayer to call.
2015-03-27 15:56:45 +09:00
Brian Birtles bf038e890e Bug 1109390 part 6 - Generalize PendingPlayerTracker to support pausing as well; r=jwatt
This patch extends the PendingPlayerTracker which is currently used to record
which animations are waiting to play, such that it can also handle animations
which are waiting to complete a pause operation.

It doesn't yet do anything with the pause-pending animations, that will come
in another patch.
2015-03-27 15:56:45 +09:00
Brian Birtles 6b062fb872 Bug 1109390 part 5 - Adjust tests to better handle asynchronous pausing; r=jwatt
A number of animation tests assume that pausing happens instantaneously. This
patch adjust many of those tests so that they will continue to work when
pausing happens asynchronously. In many cases this is possible because we
know the ready promise on AnimationPlayer (soon to be Animation) objects will
be resolved so we can wait on it and it will resolve immediately now, but when
asynchronous pausing is introduced the test the promise won't resolve until
after the pause operation is complete.

There are some tests that can't be so easily adjusted and we will have to fix
these at the same time as we turn on async pausing. However, taking care of
this set of tests now should reduce the size of subsequent patches in this
series.
2015-03-27 15:56:44 +09:00
Mason Chang ae4567cd01 Bug 1145327 Part 2: Add test to ensure requestAnimationFrame callback timestamps always go forward in time. r=birtles,dholbert 2015-03-24 14:28:34 -07:00
Brian Birtles 511c419852 Bug 1109390 part 3 - Clear the start time when playing a player; r=jwatt
This brings us into line with the algorithm in:

  https://w3c.github.io/web-animations/#play-an-animation

which makes the other patches in this series easier to compare with
the specification.
2015-03-24 09:21:08 +09:00
Brian Birtles 988481e564 Bug 1109390 part 2 - Remove some unneeded startTime tests; r=jwatt
Now that we have separate tests for checking the initial state of startTime we
can remove these checks from tests for setting the startTime.

Also, while we're at it, we needn't check the playState and animationPlayState
since these should be covered by other tests.
2015-03-24 09:21:08 +09:00
Brian Birtles f00da8e1e6 Bug 1109390 part 1 - Add tests for getting the startTime; r=jwatt 2015-03-24 09:21:07 +09:00
Cameron McCormack a28a264c22 Bug 1145912 - Make single_transition_reversed and multiple_transitions more robust. r=birtles 2015-03-23 13:07:25 +11:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Jonathan Watt f7d5a879ea Bug 1127380, part 1 - Initial implementation of AnimationPlayer.playbackRate. r=birtles, r=smaug
--HG--
extra : rebase_source : 5b2dbefbcd986d7529d8567b7f068ac30ad6416e
2015-03-13 20:10:45 +00:00
L. David Baron 40bd226b51 Bug 1125455 patch 5 - Add Animation::GetAnimationOfProperty. r=birtles
This is needed for patch 6.
2015-03-19 21:10:00 -07:00
L. David Baron c64617d10d Bug 1125455 patch 4 - For main-thread application of transitions, don't apply transitions when animations are also running. r=birtles
I've verified locally that this patch (not others in this series) fixes
the test failures that match the test changes in this patch.
2015-03-19 21:10:00 -07:00
L. David Baron 43ffda7be5 Bug 1125455 patch 1 - Add boolean for whether an animation of a property wins in the CSS cascade. r=birtles 2015-03-19 21:10:00 -07:00
Boris Zbarsky dc24477d79 Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp.  The
rest of this diff was generated by running the following commands:

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'

  find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 10:13:33 -04:00
Carsten "Tomcat" Book 47fe95d629 Backed out 7 changesets (bug 1125455) for test failures in m1 test_animation-player-ready.html on a CLOSED TREE
Backed out changeset 8a316064caff (bug 1125455)
Backed out changeset ad326dbcbd03 (bug 1125455)
Backed out changeset 83dab9578e23 (bug 1125455)
Backed out changeset 5bd86c20cd02 (bug 1125455)
Backed out changeset 751177025dcb (bug 1125455)
Backed out changeset f60c5b4adf84 (bug 1125455)
Backed out changeset 326ef9a86c85 (bug 1125455)
2015-03-18 16:32:54 +01:00
L. David Baron 82ad97d447 Bug 1125455 patch 5 - Add Animation::GetAnimationOfProperty. r=birtles
This is needed for patch 6.
2015-03-18 07:35:30 -07:00
L. David Baron 8f015c4370 Bug 1125455 patch 4 - For main-thread application of transitions, don't apply transitions when animations are also running. r=birtles
I've verified locally that this patch (not others in this series) fixes
the test failures that match the test changes in this patch.
2015-03-18 07:35:30 -07:00
L. David Baron 065aeaa603 Bug 1125455 patch 1 - Add boolean for whether an animation of a property wins in the CSS cascade. r=birtles 2015-03-18 07:35:29 -07:00
Brian Birtles 807e40e6b9 Bug 1113425 part 4 - Enable test_deferred_start.html on all platforms; r=mattwoodrow 2015-03-17 18:38:12 +09:00
Brian Birtles e3f0c2f97e Bug 1113425 part 3 - Make test_deferred_start.html wait an extra frame; r=mattwoodrow
This is needed to avoid intermittent failures on Mulet and B2G ICS Emulator.
2015-03-17 18:38:12 +09:00
Brian Birtles 80be8bcd01 Bug 1113425 part 1 - Fix some bad CSS comment syntax in animation tests; r=mattwoodrow 2015-03-17 18:38:12 +09:00
Cameron McCormack df118d4a47 Bug 1143314 - Don't use very short transition/animation durations in test_animation_observers.html. r=birtles 2015-03-17 17:13:20 +11:00
L. David Baron a8fa9e2011 Bug 1143314 - Temporary disable two tests that are frequently failing intermittently, added about 12 hours ago in bug 1123523, on a CLOSED TREE. 2015-03-14 10:20:27 -07:00
Cameron McCormack c8f4387af1 Bug 1123523 - Part 10: Tests. r=birtles 2015-03-14 16:34:40 +11:00
Cameron McCormack 9d635d78ad Bug 1123523 - Part 9: Dispatch an nsIAnimationObserver notification when an animation is changed. r=birtles 2015-03-14 16:34:40 +11:00
Cameron McCormack d648fe467f Bug 1123523 - Part 8: Dispatch nsIAnimationObserver notifications when an animation is added or removed. r=birtles 2015-03-14 16:34:40 +11:00
Cameron McCormack 7edb0d374f Bug 1123523 - Part 3: Store a flag on AnimationPlayer for whether it is exposed by Element.getAnimationPlayers(). r=birtles 2015-03-14 16:34:40 +11:00
Jonathan Griffin d1c61bc9b6 Bug 1116187 - Disable failing mochitest-chrome tests for B2G, r=gbrown 2015-02-06 16:30:37 -08:00
Jonathan Watt 0e1b8d416c Bug 1072037, part 2 - Tests for the effect of setting CSS animation's AnimationPlayer.currentTime. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-player-starttime.html => dom/animation/test/css-animations/test_animation-player-currenttime.html
2015-03-09 16:50:39 +00:00
Jonathan Watt 39fe510f93 Bug 1072037, part 1 - Implement web-animations proceedure to 'set the current time' and make AnimationPlayer.startTime writeable. r=birtles, r=smaug 2015-03-09 16:50:39 +00:00
Jonathan Watt d5681f75bf Bug 1070744 - Backout c482c88b0393 and c5d5202c3d72 for being attributed to this bug instead of bug 1072037. r=me, and faking r=smaug since backout 2015-03-11 15:28:07 +00:00
Jonathan Watt 5bffcdb7ca Bug 1070744, part 2 - Tests for the effect of setting CSS animation's AnimationPlayer.currentTime. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-player-starttime.html => dom/animation/test/css-animations/test_animation-player-currenttime.html
2015-03-09 16:50:39 +00:00
Jonathan Watt f6effca850 Bug 1070744, part 1 - Implement web-animations proceedure to 'set the current time' and make AnimationPlayer.startTime writeable. r=birtles, r=smaug 2015-03-09 16:50:39 +00:00
Jonathan Watt 6fce4aa41e Bug 1073379, part 7 - Tests for the effect of setting a CSS transition's AnimationPlayer.startTime. r=birtles
--HG--
rename : dom/animation/test/css-animations/test_animation-player-starttime.html => dom/animation/test/css-transitions/test_animation-player-starttime.html
2015-03-06 15:23:17 +00:00
Jonathan Watt 21f90d17db Bug 1141710, part 14 - Get rid of the checks at 90% through the active duration. r=birtles 2015-03-05 13:07:20 +00:00
Jonathan Watt cf99e48829 Bug 1141710, part 13 - Wrap all lines at the 80 column mark. r=birtles 2015-03-05 13:07:19 +00:00
Jonathan Watt 74ff18bb06 Bug 1141710, part 12 - Check that the hold time is updated when the startTime is set to null. r=birtles 2015-03-11 07:19:44 +00:00
Jonathan Watt 4e2bbb40b0 Bug 1141710, part 11 - Assert that seeking over the before and active phases worked. r=birtles 2015-03-05 13:07:19 +00:00
Jonathan Watt 8b770d6a97 Bug 1141710, part 10 - Update some assertion text and comments. r=birtles 2015-03-05 13:07:19 +00:00
Jonathan Watt 408721a5f1 Bug 1141710, part 9 - Get the timeline from the player instead of from the document. r=dholbert
--HG--
extra : rebase_source : 1d737817af45cdc5a55a9793dea248e70bc66cb3
2015-03-04 02:49:44 +00:00
Jonathan Watt 4ecf9b15a0 Bug 1141710, part 8 - Create helpers to get the startTime corresponding to various points through the active duration. r=dholbert
--HG--
extra : rebase_source : 77ce022fad96c8f9de09ba88e53473674b3b5d11
2015-03-04 02:49:43 +00:00
Jonathan Watt 0b2deb137c Bug 1141710, part 7 - Store the generated 'animation' property string in a global constant and reuse that constant. r=dholbert
--HG--
extra : rebase_source : 539673cc79c80f67043bd94e933fe54f24a25be1
2015-03-04 02:49:43 +00:00
Jonathan Watt d4dc6c2561 Bug 1141710, part 7 - Create helpers to get the startTime corresponding to various points through the active duration. r=dholbert
--HG--
extra : rebase_source : 29ba71854e2f77cbb088dc5e3545c95ca242c6d7
2015-03-04 02:49:43 +00:00
Jonathan Watt 4f75f74035 Bug 1141710, part 5 - Change from assert_true() to the new assert_unreached(). r=dholbert
--HG--
extra : rebase_source : 5b12f7d32ff7f67af4cdc7fe1198153ab2775c8e
2015-03-04 02:49:43 +00:00
Jonathan Watt e1211720f1 Bug 1141710, part 4 - Avoid race condition when taking timestamps by reusing the original timestamp. r=dholbert
--HG--
extra : rebase_source : a3eab56b57d605af01e5dc450b30a8aa7c77a417
2015-03-04 02:49:43 +00:00
Jonathan Watt c8eaf51e66 Bug 1141710, part 3 - Stop using ECMAScript 6 features in test_animation-player-starttime.html, since other browsers don't support them. r=dholbert
--HG--
extra : rebase_source : 7886c2f67f84b2547b2fdd6d08f6db88684bfba4
2015-03-04 02:49:43 +00:00
Jonathan Watt 6d6eb9d3d9 Bug 1141710, part 2 - Update comments to be non-Mozilla specific. r=dholbert
--HG--
extra : rebase_source : f8104546849e7d213b70eac66fc75f51e27749f0
2015-03-04 02:49:43 +00:00
Jonathan Watt f8f1365639 Bug 1141710, part 1 - Update to the new version of addDiv() in testcommon.js. r=dholbert
--HG--
extra : rebase_source : 0366f678e6075d4d929a5cc0a25d217215108ee7
2015-03-04 02:49:43 +00:00
Jonathan Watt 008986f33d Bug 1141498, part 2 - Enable calls to DOM animation test's testcommon.js's addDiv() to set attributes. r=dholbert
--HG--
extra : rebase_source : 807b3f7cd65c7611f8b8c2d0582fa65a9008fbef
2015-03-04 02:49:43 +00:00
Jonathan Watt 5825187ee1 Bug 1141498, part 1 - Stop using Node.remove() in the DOM animation test's testcommon.js. r=dholbert
--HG--
extra : rebase_source : 70fdcc2f1419ae1ea88cc58db909efe11ba620a1
2015-03-04 02:49:43 +00:00
Wes Kocher fa3b470408 Backed out 2 changesets (bug 1141498) for mochitest-1 bustage
Backed out changeset aab01fe57d48 (bug 1141498)
Backed out changeset d366dc0fb693 (bug 1141498)
2015-03-10 18:39:03 -07:00
Wes Kocher 9825e5f35a Backed out 9 changesets (bug 1141710)
Backed out changeset 0e360d3f690b (bug 1141710)
Backed out changeset c67f9c7dfd4e (bug 1141710)
Backed out changeset 9496b1468d9c (bug 1141710)
Backed out changeset e1330135150d (bug 1141710)
Backed out changeset 0bf9f153d5bc (bug 1141710)
Backed out changeset ac29161a0f98 (bug 1141710)
Backed out changeset ee29275a1748 (bug 1141710)
Backed out changeset 255c9236bb37 (bug 1141710)
Backed out changeset fcd5ac448c46 (bug 1141710)
2015-03-10 18:38:28 -07:00
Jonathan Watt dbdd24d84d Bug 1141710, part 9 - Get the timeline from the player instead of from the document. r=dholbert 2015-03-03 17:40:29 +00:00
Jonathan Watt 71b90da2f9 Bug 1141710, part 8 - Create helpers to get the startTime corresponding to various points through the active duration. r=dholbert 2015-03-03 17:40:28 +00:00
Jonathan Watt 674943757e Bug 1141710, part 7 - Store the generated 'animation' property string in a global constant and reuse that constant. r=dholbert 2015-03-03 17:40:26 +00:00
Jonathan Watt 2b69014af7 Bug 1141710, part 7 - Create helpers to get the startTime corresponding to various points through the active duration. r=dholbert 2015-03-03 17:40:25 +00:00
Jonathan Watt 6a59e248b9 Bug 1141710, part 5 - Change from assert_true() to the new assert_unreached(). r=dholbert 2015-03-02 20:05:03 +00:00
Jonathan Watt 9af7cb35a7 Bug 1141710, part 4 - Avoid race condition when taking timestamps by reusing the original timestamp. r=dholbert 2015-03-02 20:05:01 +00:00
Jonathan Watt cc332ee976 Bug 1141710, part 3 - Stop using ECMAScript 6 features in test_animation-player-starttime.html, since other browsers don't support them. r=dholbert 2015-03-02 20:05:00 +00:00
Jonathan Watt 0d47b214d0 Bug 1141710, part 2 - Update comments to be non-Mozilla specific. r=dholbert 2015-03-02 20:04:58 +00:00
Jonathan Watt c8c247664b Bug 1141710, part 1 - Update to the new version of addDiv() in testcommon.js. r=dholbert 2015-03-02 20:04:57 +00:00
Jonathan Watt f8082bd161 Bug 1141498, part 2 - Enable calls to DOM animation test's testcommon.js's addDiv() to set attributes. r=dholbert 2015-02-27 10:23:55 +00:00
Jonathan Watt dd4fe529bd Bug 1141498, part 1 - Stop using Node.remove() in the DOM animation test's testcommon.js. r=dholbert 2015-02-27 10:23:49 +00:00
L. David Baron ba8f91bca8 Bug 1140134 - Don't skip the rest of the properties in an animation after hitting one that we shouldn't apply. r=dholbert
Both sets of new tests pass with the patch, but without the patch the
"top is animating" test fails.
2015-03-06 13:35:45 -08:00
Jonathan Watt 983df62b3a Bug 1073379, part 6b - Re-enable the player.playState check in checkStateAtActiveIntervalEndTime, but disable the first checkStateAtActiveIntervalEndTime call in the 'Skipping backwards through animation' tests. r=orange 2015-02-25 11:08:52 +00:00
Jonathan Watt 07954fa4d6 Bug 1073379, part 6 - Tests for the effect of setting CSS animation's AnimationPlayer.startTime. r=dholbert 2015-02-20 15:14:11 +00:00
Jonathan Watt 602ecbe7be Bug 1073379, part 3 - Make AnimationPlayer::SetStartTime() notify its animation manager (via its player collection) of changes so that computed style is updated correctly. r=dholbert 2015-02-12 17:56:57 +00:00
Jonathan Watt 44832e736c Bug 1073379, part 2 - Implement web-animations proceedure to 'update the player start time' and make AnimationPlayer.startTime writeable. r=birtles, r=smaug 2015-02-09 10:26:27 +00:00
Jonathan Watt 69ac7e7f6d Bug 1073379, part 1 - Add an AnimationUtils::DoubleToTimeDuration helper. r=birtles 2015-02-09 10:25:51 +00:00
L. David Baron 824c76c900 Bug 960465 patch 14 - Retain finished transitions until the next style change or until removed from transition-property. r=birtles
Note that this increases memory use for completed transitions since we
don't throw away the data when the transitions complete.  That said,
this matches what we do for CSS Animations, and it's needed (once we
switch to the new rules for starting transitions) to maintain the
invariant that unrelated style changes don't trigger transitions.

The storage issues could be optimized in the future if it turns out to
be a problem, but I think that's unlikely, given that we'll never store
more than one for any element+property combination.
2015-02-17 11:15:04 +13:00
Nicholas Nethercote 242708cf72 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 488e401ff87e31a2074c4108c4df0572d9536667
2015-02-09 14:34:50 -08:00
Andrew McCreight d3826daa16 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote d34f0301b8 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 99182e70335d2b5ff95f8c528ae992d37294be3a
2015-02-04 20:05:36 -08:00
Brian Birtles 8162708cc1 Bug 1123196 part 1 - While player is waiting to start, return its pending start time; r=jwatt
After starting layer animations we set the same start time on content
animations but we don't apply it until the next tick (see bug 1112480 for
background). However, in some circumstances, we can end up creating layer
animations again within the same refresh driver tick. In this case, we should
initialize the animations with the same start time as we previously used.

This patch exposes the pending start time set on content animations so that,
if set, we can use it when building layer animations.
2015-02-03 14:08:37 +09:00
Jonathan Watt 393081114a Bug 1105098 - Make AnimationTimeline always return the same parent object (even after document.open()) and replace the document's timeline if the document is reset. r=smaug,birtles 2015-01-26 17:08:51 +00:00
Mason Chang 6c10033ff7 Bug 1119981. Disable test_deferred_start.html on b2g for race condition in test. r=bbirtles 2015-01-16 09:33:49 -08:00
Brian Birtles 483f9be18f Bug 1112480 part 10 - Mark css-animations/test_animation-pausing.html and css-transitions/test_animation-pausing.html as no longer failing; r=jwatt
With this updated approach to starting pending animations, these tests should no
longer fail on Mac 10.8 or Windows.
2015-01-09 07:57:59 +09:00
Brian Birtles 816dbf54ef Bug 1112480 part 9 - Remove call to PostUpdate from AnimationPlayer::ResumeAt; r=jwatt
Since pending animations are no longer started outside of a style update, we no
longer need to call PostUpdate from ResumeAt.
2015-01-09 07:57:58 +09:00
Brian Birtles a31477d9b4 Bug 1112480 part 8 - Remove AnimationTimeline::FastForward; r=jwatt
Now that we don't actually start pending animations until the following refresh
driver tick we no longer need to be able to fast-forward the AnimationTimeline
between ticks.
2015-01-09 07:57:58 +09:00
Brian Birtles 7a9094aa6e Bug 1112480 part 7 - Add checking for orphaned players; r=jwatt
When a player is made pending, we rely on it being added to a pending player
tracker that will eventually start the player. However, there are a few
situations where this might not happen. For example, we can't find a pending
player tracker (e.g. there's no source content or the source content isn't
attached to a document), or the pending player tracker disappeared.

In these cases we still want to ensure that such a player does actually get
started. This patch attempts to detect such situations and start players
accordingly.

There are, unfortunately, currently no tests for this. I have been unsuccessful
in recreating any of the situations these tests are supposed to cover.
2015-01-09 07:57:58 +09:00
Brian Birtles ac47cd0a02 Bug 1112480 part 6 - Make PendingPlayerTracker call StartOnNextTick; r=jwatt
This patch switches on the new, "actually start the player in the next refresh
driver tick" behavior. It updates PendingPlayerTracker, adding
a StartPendingPlayersOnNextTick method which calls the appropriate method on
AnimationPlayer. The existing StartPendingPlayers is renamed to
StartPendingPlayersNow and is used for testing only.

Furthermore, since we now expect AnimationPlayer::StartOnNextTick to be
functional, AnimationPlayer::DoPlay is updated to use it when there is no
document available. This should make playing an animation player always
asynchronous, that is, always transition to the pending state temporarily
(unless we are already playing).
2015-01-09 07:57:58 +09:00
Brian Birtles 9eb65d26c7 Bug 1112480 part 5 - Add AnimationTimeline::IsUnderTestControl; r=jwatt
Earlier in this patch series we added AnimationPlayer::StartOnNextTick which
takes a ready time parameter expressed in timeline time. In order to call this
method when painting finishes we need to convert the TimeStamp recorded when
painting finished to a timeline time. However, when the timeline is driven by
a refresh driver under test control we can no longer meaningfully do this
conversion since there is no correspondence between the notion of time used to
record the time when painting finished (wallclock time) and the notion of time
used by the timeline (which has been arbitrarily adjusted by test code).

We need a way to detect this situation so that we know not to call
ToTimelineTime in that case.

Alternatively, we could make ToTimelineTime automatically return a null value
when its refresh driver is under test control. However, in this situation
ToTimelineTime can still actually be used to convert a TimeStamp to a timeline
time as long as the TimeStamp is from the same refresh driver. Indeed,
GetCurrentTime does exactly that. So if we were to go down that route we would
have to provide a way for GetCurrentTime to work around that restriction.

For now, this patch puts the onus on the caller of ToTimelineTime to check if
the timeline is under test control first (unless they are passing a TimeStamp
from the same refresh driver, in which case there is no need to check).
2015-01-09 07:57:58 +09:00
Brian Birtles f13b2102bb Bug 1112480 part 4 - Use mPendingReadyTime in AnimationPlayer::Tick; r=jwatt
This patch makes AnimationPlayer act on requests to StartOnNextTick by checking
for mPendingReadyTime on each tick.

We also check that the ready time is not in the future since currently it might
be possible that we get multiple calls to AnimationPlayer::Tick within a single
refresh driver tick.

Note that this patch shouldn't actually produce any observable change yet,
however, since we don't call StartOnNextTick anywhere.
2015-01-09 07:57:58 +09:00
Brian Birtles 8fbf68a16a Bug 1112480 part 3 - Add AnimationPlayer::StartOnNextTick; r=jwatt
Adds a method that schedules an animation player to begin on the next tick using
the supplied time as the start time.

We don't call this yet, however, but simply add the method and the
mPendingReadyTime member it sets.
2015-01-09 07:57:58 +09:00
Brian Birtles cc7ea10335 Bug 1112480 part 2 - Factor out ResumeAt; r=jwatt
In addition to AnimationPlayer::StartNow, this patch series also makes
AnimationPlayer::Tick start animations.

Since these methods will share a lot of code we first factor out a common
ResumeAt method to encapsulate the common code.
2015-01-09 07:57:58 +09:00
Brian Birtles c6ebd438ae Bug 1112480 part 1 - Adjust tests to accommodate changed animation start behavior; r=jwatt
In this patch series we adjust the behavior of animation starting so that the
animation does not actually start until the following refresh driver tick. This
requires some tweaks to tests to ensure they continue to pass.
2015-01-09 07:57:58 +09:00
Brian Birtles 63f5d21f88 Bug 1117955 - Disable css-transitions/test_animation-pausing.html on Windows 2015-01-07 15:00:26 +09:00
Brian Birtles 579783f725 Bug 1117955 - Disable css-animations/test_animation-pausing.html on Windows 2015-01-06 14:36:55 +09:00
Brian Birtles fd8aff9c0e Bug 1113413 - Make refresh driver go back immediately when restored from test control; r=vlad 2015-01-06 10:56:02 +09:00
Brian Birtles 62ee098b80 Bug 927349 part 30 - Cancel transitions when we have a change to a non-animatable style; r=heycam 2015-01-06 10:55:59 +09:00
Brian Birtles ddaaa69a98 Bug 927349 part 29 - Temporarily disable failing tests {browser_555547.js on Windows opt, test_animation-pausing.html on 10.8, test_deferred_start.html on mulet}; r=me (as discussed with jwatt) 2014-12-24 15:42:37 +09:00
Brian Birtles 291701ad1b Bug 927349 part 26 - Add a test for compositor animations with a delay; r=nical
This patch adds a test that we correctly incorporate the delay when setting
a layer animation's initialCurrentTime.

The notion of 'current time' on layer animations differs from that on main
thread animations in that it does not incorporate the animation delay.
Instead, we wait until an animation's delay has complete before putting it
on the layer and then it we add without delay.

For animations that are still waiting to start we need to factor this delay into
the initialCurrentTime stored on the layer animation so that when we update
the animation's start time it represents the time *after* the delay has
finished. Previously we failed to do this but no tests failed since all existing
tests for delay rely on DOMWindowUtils.advanceTimeAndRefresh which avoids this
particular code path (since we don't add pending animations to layers while
the refresh driver is under test control).

This patch adds a test for animation delay that does not rely on
DOMWindowUtils.advanceTimeAndRefresh which has been confirmed to fail if we
don't incorporate the delay in our calculation of initialCurrentTime.
2014-12-25 16:28:25 +09:00
Brian Birtles 54a9341689 Bug 927349 part 25 - Test cancelling of players; r=heycam 2014-12-25 16:28:24 +09:00
Brian Birtles 06faed4dae Bug 927349 part 24 - Add a test that empty animations still start; r=heycam 2014-12-25 16:28:24 +09:00
Brian Birtles 01a5445ce7 Bug 927349 part 23 - Wait on player.ready on test_running_on_compositor.html; r=jwatt 2014-12-25 16:28:24 +09:00
Brian Birtles c4aa216c4c Bug 927349 part 22 - Make AnimationPlayer wait for animations to be rendered before starting; r=jwatt
This patch (finally!) introduces the delayed start behavior. It updates
AnimationPlayer::DoPlay to put animations in the PendingPlayerTracker from
where they are triggered.

This patch also updates nsTransitionManager to set the animation's source
before calling Play as otherwise the AnimationPlayer won't be able to access
the pending player tracker (which it locates by navigating AnimationPlayer ->
Animation (source content) -> target element -> composed doc -> pending player
tracker). In future, when we support setting the AnimationPlayer.source property
we will make this more robust so that the order in which these steps are
performed doesn't matter.

This patch also updates a couple of tests to reflect the fact that
AnimationPlayer will now return the pending state.
2014-12-25 16:28:24 +09:00
Brian Birtles e5b88e8ef0 Back out parts 22-29 from bug 927349 for causing intermittent test failure in css-animations/test_animation-pausing.html on 10.8 2014-12-26 11:54:43 +09:00
Brian Birtles 8f3f4c1376 Bug 927349 part 29 - Disable failing browser_555547.js on Windows opt - pushed again without backing out parts 22-29 at the same time; r=me
In https://hg.mozilla.org/integration/mozilla-inbound/rev/3ab2ff9b9f94
I accidentally pushed part 29 along with a backout for parts 22-29. This patch
reverts that change.

If this changset causes problems, the following changesets should be backed out:

https://hg.mozilla.org/integration/mozilla-inbound/rev/477f46897b0b
https://hg.mozilla.org/integration/mozilla-inbound/rev/6c345954bce5
https://hg.mozilla.org/integration/mozilla-inbound/rev/642e400b22a9
https://hg.mozilla.org/integration/mozilla-inbound/rev/9bdf7c2279fa
https://hg.mozilla.org/integration/mozilla-inbound/rev/79cac8c71159
https://hg.mozilla.org/integration/mozilla-inbound/rev/cfe757e478d5
https://hg.mozilla.org/integration/mozilla-inbound/rev/eaf834051cbd
2014-12-26 08:49:20 +09:00
Brian Birtles 414a5c831f Bug 927349 part 29 - Disable failing browser_555547.js on Windows opt; r=me (as discussed with jwatt) 2014-12-25 16:31:55 +09:00
Brian Birtles aa18819813 Bug 927349 part 26 - Add a test for compositor animations with a delay; r=nical
This patch adds a test that we correctly incorporate the delay when setting
a layer animation's initialCurrentTime.

The notion of 'current time' on layer animations differs from that on main
thread animations in that it does not incorporate the animation delay.
Instead, we wait until an animation's delay has complete before putting it
on the layer and then it we add without delay.

For animations that are still waiting to start we need to factor this delay into
the initialCurrentTime stored on the layer animation so that when we update
the animation's start time it represents the time *after* the delay has
finished. Previously we failed to do this but no tests failed since all existing
tests for delay rely on DOMWindowUtils.advanceTimeAndRefresh which avoids this
particular code path (since we don't add pending animations to layers while
the refresh driver is under test control).

This patch adds a test for animation delay that does not rely on
DOMWindowUtils.advanceTimeAndRefresh which has been confirmed to fail if we
don't incorporate the delay in our calculation of initialCurrentTime.
2014-12-25 16:28:25 +09:00
Brian Birtles 6535f8f5a2 Bug 927349 part 25 - Test cancelling of players; r=heycam 2014-12-25 16:28:24 +09:00
Brian Birtles ce6bc54785 Bug 927349 part 24 - Add a test that empty animations still start; r=heycam 2014-12-25 16:28:24 +09:00
Brian Birtles 30b7966bc4 Bug 927349 part 23 - Wait on player.ready on test_running_on_compositor.html; r=jwatt 2014-12-25 16:28:24 +09:00
Brian Birtles 94756a7b6f Bug 927349 part 22 - Make AnimationPlayer wait for animations to be rendered before starting; r=jwatt
This patch (finally!) introduces the delayed start behavior. It updates
AnimationPlayer::DoPlay to put animations in the PendingPlayerTracker from
where they are triggered.

This patch also updates nsTransitionManager to set the animation's source
before calling Play as otherwise the AnimationPlayer won't be able to access
the pending player tracker (which it locates by navigating AnimationPlayer ->
Animation (source content) -> target element -> composed doc -> pending player
tracker). In future, when we support setting the AnimationPlayer.source property
we will make this more robust so that the order in which these steps are
performed doesn't matter.

This patch also updates a couple of tests to reflect the fact that
AnimationPlayer will now return the pending state.
2014-12-25 16:28:24 +09:00
Brian Birtles 1df0d8114c Bug 927349 follow-up to (hopefully) fix breakage from GetCurrentTime on non-unified Windows build on a CLOSED TREE 2014-12-22 13:16:11 +09:00
Brian Birtles 9b70aa8285 Bug 927349 part 21 - Factor out AnimationPlayer::UpdateSourceContent; r=jwatt
In the future we will want to specifically just update source content without
necessarily triggering any other actions that might take place on a tick (like
queuing events).
2014-12-22 09:35:42 +09:00
Brian Birtles 24eaa57ecc Bug 927349 part 19 - Don't add pending animations to layers when their refresh driver is under test control; r=jwatt 2014-12-22 09:35:42 +09:00
Brian Birtles 79e39d6e6a Bug 927349 part 16 - Do a full reflow when we have pending animations; r=jwatt
We want to time animations from when their first frame is painted. However,
interruptible reflow complicates this since, for a given set of pending
animations, some may be painted whilst others are not. To simplify this we
simply force an uninterruptible reflow when we have animations that are
waiting to start.
2014-12-22 09:35:41 +09:00
Brian Birtles 0cea4b72d5 Bug 927349 part 15 - Schedule a paint when a new pending animation is added; r=jwatt
We would like to trigger animations from the point when the first frame of the
animation is painted. However, some animations will never trigger a paint (e.g.
animations with an empty keyframes rule). These animations should start start
however. To ensure this, whenever an animation is newly pending we schedule
a paint.
2014-12-22 09:35:41 +09:00
Brian Birtles 53d761ef44 Bug 927349 part 14 - Store reference to owning document on PendingPlayerTracker; r=jwatt
This patch adds a reference from PendingPlayerTracker back to the document
object that owns it. This is used in the next patch in this series to find the
document's root frame for scheduling a paint.
2014-12-22 09:35:41 +09:00
Brian Birtles 0dcad886e1 Bug 927349 part 9 - Add PendingPlayerTracker::StartPendingPlayers; r=jwatt 2014-12-22 09:35:41 +09:00
Brian Birtles fb0d9d7187 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