Commit Graph

256 Commits

Author SHA1 Message Date
L. David Baron
fd0a6129d2 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
dfe3c0f0c8 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
b318248411 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
0c9201c98b 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
e314f86f64 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
047064af90 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.
2015-04-15 08:48:21 +09:00
Brian Birtles
ba76ba37a1 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.
2015-04-15 08:48:20 +09:00
Brian Birtles
437d98e7be 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
9dd80d2f23 Bug 1134381 - Don't pause an AnimationPlayer if it is already paused; r=jwatt 2015-04-14 09:07:41 +09:00
Brian Birtles
9c95ebb6e0 Bug 1152171 part 2 - Rename AnimationTimeline to DocumentTimeline; r=smaug
And then re-add AnimationTimeline as an abstract super-interface of
DocumentTimeline.
2015-04-10 10:34:22 +09:00
Brian Birtles
25d362599b 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
e0975a9c09 Bug 1151346 - Make ActiveLayerTracker::IsOffsetOrMarginStyleAnimated respect CSS animations. r=roc 2015-04-05 22:53:51 -04:00
L. David Baron
bc3f47d5d5 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
47a284f64a 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
a167077c5f 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
35aef9ee3f Bug 1149906 - Consider play-pending animations to be playing as well r=dbaron 2015-04-01 17:22:02 +09:00
L. David Baron
4747e4ab80 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
9a01a5b026 Bug 1149832 - Replace the Web Animations test helper waitForTwoAnimationFrames() with a helper that takes a frame count. r=birtles 2015-03-31 23:27:19 +01:00
Jonathan Watt
c08220d30e 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
bfa77afe55 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
d1ef9c1342 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
db91febb5c 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
13de968298 Bug 1109390 part 26 - Add further tests for ready promise when pausing; r=jwatt 2015-04-01 12:23:25 +09:00
Brian Birtles
034e2a3685 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
a2ca09cf79 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
a6d9ab66d6 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
e1ab78805c 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
dcccb47adf 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
233630dea2 Bug 1145246, part 6 - Remove disabled code from AnimationPlayer::ComposeStyle. r=birtles 2015-03-23 13:23:10 +00:00
Cameron McCormack
444301e033 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
6f05bcb599 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
6144ef5a6a 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
f6b5fef8a8 Bug 1149194 - Don't use uninitialized value in ComputedTimingFunction::operator==. r=bbirtles 2015-03-30 09:44:00 -04:00
Jonathan Watt
0aa30fe55c 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
fe226713f5 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
a71fdfc5b9 Bug 1074630, part 2 - CSS animations tests for Web Animations finishing behavior. r=birtles 2015-03-18 13:21:28 +00:00
Jonathan Watt
78696876a2 Bug 1074630, part 1 - Implement Web Animations finishing behavior. r=birtles, r=smaug 2015-03-18 13:22:11 +00:00
Brian Birtles
cff8fc4f2b 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
0c22048a6a 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
dea70a395d 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
07785c2a56 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
86ab74ffe8 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
f565425737 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
fa14993c70 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
8932320375 Bug 1109390 part 11 - Make IsPossiblyOrphanedPendingPlayer deal with pause-pending players too; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles
ca87c7e87f 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
419faab492 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
7e48f4d74f Bug 1109390 part 8 - Rename Start* methods in AnimationPlayer to Trigger*; r=jwatt 2015-03-27 15:56:45 +09:00
Brian Birtles
0883416822 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
9dd91d8731 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