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

259 Коммитов

Автор SHA1 Сообщение Дата
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