Commit Graph

693 Commits

Author SHA1 Message Date
Brian Birtles
1bf99cf79f Bug 1260983 - Allow creating animations with a target element not bound to a document; r=heycam
MozReview-Commit-ID: HHqHWikZ3zp
2016-04-01 09:32:26 +09:00
Brian Birtles
344398e8f8 Bug 1260983 - Update animation properties when the style context changes; r=heycam
MozReview-Commit-ID: L4ugcD7BxNX
2016-04-01 09:31:51 +09:00
Brian Birtles
1a98da1bd9 Bug 1260976 - Remove the old AnimationProperty-based GetFrames; r=heycam
MozReview-Commit-ID: FoEf7DymVDm
2016-04-01 09:29:31 +09:00
Brian Birtles
9552e36446 Bug 1260655 - Drop some no-longer-needed code for setting up CSS animations using AnimationProperty objects; r=heycam
MozReview-Commit-ID: JDzvQIxlsX6
2016-03-30 13:01:20 +09:00
Brian Birtles
8b6a1ba8ad Bug 1260655 - Use CSSAnimationBuilder::BuildAnimationFrames to set up CSS animations using Keyframe objects; r=heycam
MozReview-Commit-ID: BMLvYP8iIIa
2016-03-30 13:01:13 +09:00
Brian Birtles
871add346f Bug 1260655 - Add a copy constructor and copy assignment operator to Keyframe; r=heycam
It turns out that std::stable_sort on Mac and Android use this.

Bug 1263500 tracks doing something more efficient on those platforms.

MozReview-Commit-ID: 3tGbnoW67QP
2016-03-31 16:26:52 +09:00
Brian Birtles
56ab406ea8 Bug 1260655 - Add an assignment operator to Keyframe that takes an rvalue reference; r=heycam
This is needed in order to use std::stable_sort with this type since some
implementations of std::stable_sort require this (as opposed to simply a move
constructor).

MozReview-Commit-ID: 5QmcIxkC4aB
2016-03-29 11:29:20 +09:00
Brian Birtles
87d20ddd2f Bug 1260655 - Return the stored Keyframe objects from GetFrames, when available ; r=heycam
Before switching CSS animations over to using KeyframeEffectReadOnly::SetFrames
we update the getFrames() API to return the set frame objects (when available)
so that we can test that we are setting the correct frames.

MozReview-Commit-ID: 4SpBRM7Ykyv
2016-03-30 08:59:08 +09:00
Brian Birtles
bdacb97d48 Bug 1260655 - Add KeyframeEffectReadOnly::SetFrames; r=heycam
Earlier in this patch series we divided keyframe processing into two stages:

  (1) Turning javascript objects into an array of Keyframe objects
  (2) Calculating AnimationProperty arrays from the Keyframe objects

This patch creates a SetFrames method so that CSS animations and
CSS transitions can skip (1) and pass the frames constructed from CSS syntax
into (2).

It also adds the following additional processing:

a. Notifying animation mutation observers when the set of frames has changed.

   This is currently performed by nsAnimationManager but ultimately we should
   encapsulate this logic inside the effect itself. Furthermore, it will be
   needed when we implement effect.setFrames() (i.e. the Javascript-facing
   wrapper for this method).

b. Preserving the mWinsInCascade and mIsRunningOnCompositor state on properties
   when updating them.

   This is currently performed by:

      bool KeyframeEffectReadOnly::UpdateProperties(
          const InfallibleTArray<AnimationProperty>& aProperties)

   which is what nsAnimationManager currently uses. We will ultimately remove
   the above method and here we are just moving this code to the new version
   of UpdateProperties.

c. Requesting a restyle when the set of AnimationProperty objects has changed.

   Again, this is currently performed by the existing UpdateProperties method
   so we are just moving it here. This behavior will also be required when
   we implement effect.setFrames() and when we call UpdateProperties from
   elsewhere in restyling code.

   This is bug 1235002 but we fix it here and leave that bug to just do further
   cleanup work (e.g. re-instating the check for an empty property set before
   requesting a restyle in NotifyAnimationTimingUpdated).

d. Marking the cascade as needing an update when the set of AnimationProperty
   objects has changed.

   This is in preparation for calling UpdateProperties from elsewhere in
   restyling (e.g. when the nsStyleContext is updated).


MozReview-Commit-ID: 2ll26lsWZTm
2016-03-30 08:59:08 +09:00
Brian Birtles
99a1a632e3 Bug 1260572 - Use 50% switch behavior if StyleAnimationValue::Interpolate fails; r=heycam
In KeyframeEffectReadOnly::ComposeStyle we call StyleAnimationValue::Interpolate
but assume that it always passes. That was true when that code was only used for
CSS animations and CSS transitions since they check that their animation values
can be interpolated before setting up segments.

However, when we set up animations using the Web Animations API we don't perform
that check so it is possible for this call to fail.

In that case, we could just bail, but, according to CSS Transitions we should
apply a 50% switch in this case:

  https://drafts.csswg.org/css-transitions/#step-types

(In Web Animations, specifying this is an open issue. See:
https://w3c.github.io/web-animations/#specific-animation-behaviors).

Bug 1064937 tracks doing this in general (we'll likely need to mark various
properties as being no longer unanimatable but instead as supporting discrete
animation) but we can start to introduce it now.

Later in bug 1245748, CSS animations and transitions will likely start using
the same code path as the Web Animations API for setting up keyframes.
As a result, unless we take care to add checks that the values we set are
interpolable, the 50% switch behavior will begin to apply to CSS animations and
transitions too at that point.

Some concerns have been raised about possible web compatibility issues around
the 50% switch behavior (see [1] and [2]). For CSS animations, Chrome already
supports this behavior so it should be ok at least for CSS animations.
When we switch CSS transitions over to the same code path, however, we will need
to be careful to add checks that the transition endpoints are interpolable
(we can investigate introducing this behavior to transitions as a separate bug
that can be easily backed out / preffed off).

Regarding the naming of the test added here, going forward we would like to
restructure the tests under web-platform-tests to better match the structure of
the Web Animations since that seems to be the convention there.

However, this doesn't *quite* match the structure of the spec since there are
upcoming changes to the spec in this area (e.g. renaming animation behaviors to
animation types). However, it should be close enough that we don't have to move
it around too much in future.

[1] https://drafts.csswg.org/css-transitions/#step-types
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1064937#c0

MozReview-Commit-ID: KcxILrckJg9
2016-03-30 08:59:08 +09:00
Brian Birtles
a9d4b99d8d Bug 1260572 - Replace AnimValuesStyleRule::AddEmptyValue with an overload of AddValue that takes an rvalue reference; r=heycam
In the next patch in this series, we would like to update the error handling of
the call to StyleAnimationValue::Interpolate in
KeyframeEffectReadOnly::ComposeStyle. Using AnimValuesStyleRule::AddEmptyValue
there, however, makes handling the error case difficult because we need a means
of clearing the allocated StyleAnimationValue.

However, simply using AnimationValuesStyleRule::AddValue means we will end up
doing needless allocations for StyleAnimationValue objects (the copy
constructor for which can result in performing potentially expensive heap
allocations, such as when lists are deep-copied).

Instead, we add a Move constructor to StyleAnimationValue and add an overload
of AnimValuesStyleRule::AddValue that takes an rvalue reference. This
provides a more consistent interface to AnimValuesStyleRule and avoids the
unnecessary allocations from copying StyleAnimationValue objects.

MozReview-Commit-ID: CaP1uPAgNnm
2016-03-30 08:59:01 +09:00
Ryo Kato
39e1d58e52 Bug 1255682 - Remove unnecessary t.step_func() from a chrome test r=hiro
In promise chains, we don't have to use t.step_func. However, when there
are callbacks in promise chains, assertions in the callbacks need wrapped
in either t.step or t.step_func.

If we use t.step_func, a variable scope might be divided. This can be a
problem when an assertion uses local-scope variable (e.g. the callback
in MutationObserver uses an assertion which take `changedAnimation`).

Therefore, t.step is helpful in this case.

(There no t.step_func we should remove in web-platform tests.)

MozReview-Commit-ID: IiSizgCQjpG

--HG--
extra : rebase_source : bfe314c20763d0ea26127dd561c64388d6431bf3
2016-04-03 16:20:20 +09:00
Mantaroh Yoshinaga
ce5de9f521 Bug 1259344 - Use promise_test instead of async_test in css-animation mochi tests. r=birtles 2016-04-04 16:39:00 +02:00
Mantaroh Yoshinaga
bbda165351 Bug 1259344 - Move play()/cancel()/playstate tests to web platform tests. r=birtles 2016-04-04 21:57:00 +02:00
Chris Manchester
f7a1b3fb60 Bug 1242051 - Add inter-directory test support file dependencies to ini manifests. r=gps
Previously, every test and support file would be synced to the objdir
when running any test. Now that only those support files and tests requested
are synced, we note support files required beyond those in a test's
directory in ini manifests.

MozReview-Commit-ID: EmlDz9d4lqt
2016-04-04 14:56:52 -07:00
Daisuke Akatsuka
586de6eae6 Bug 1244633 - Part 2: append tests for delay. r=birtles
MozReview-Commit-ID: 7jldzmXrqfj
2016-04-02 18:33:54 +09:00
Daisuke Akatsuka
8493af39ec Bug 1244633 - Part 1: implement AnimationEffectTiming delay. r=birtles
MozReview-Commit-ID: atZbBx3dTd
2016-04-02 18:25:02 +09:00
Daisuke Akatsuka
6c89bdf21b Bug 1248532 - Part 1: steps-start does not produce correct value at the beginning of the interval. r=birtles
MozReview-Commit-ID: F9b1HCfEqU6

--HG--
extra : transplant_source : %22xJ1%EBa%D6%7D%87%03%B84%2A5%CA9%93N%8A%16
2016-04-01 14:00:57 +09:00
Mantaroh Yoshinaga
0c861db219 Bug 1258972 - Move finish and playbackrate mochitest to web platform tests. r=birtles. 2016-03-31 18:30:00 +02:00
Daisuke Akatsuka
fe1ca49a35 Bug 1260933 - Part 2: For invalid duration values, print the invalid value. r=birtles
MozReview-Commit-ID: 1vg3M3yY19Z

--HG--
extra : rebase_source : 6b994da55078bce5f5db788f8fce483da883ac41
2016-03-31 19:20:59 +09:00
Daisuke Akatsuka
7c788ee98a Bug 1260933 - Part 1: For invalid easing values, print the invalid value. r=birtles
MozReview-Commit-ID: HJEjvGyUnCN

--HG--
extra : rebase_source : e640bcf99d1cf05cad9fe937db92ef80794cb6d6
2016-03-31 19:20:42 +09:00
Hiroyuki Ikezoe
c6555da9ca Bug 1256503 - Part 3: Introduce addDivAndAnimate function checking animation duration is longer than 100s to avoid intermittent test failures. r=dholbert
MozReview-Commit-ID: 2zIKFNPBjoK

--HG--
extra : rebase_source : 518f973863484e7f1b2947962b569956b170ced4
2016-04-01 06:03:30 +09:00
Hiroyuki Ikezoe
d15dbe558c Bug 1256503 - Part 2: Increase some test animation durations to be at least 100 seconds. r=dholbert
In some of these cases, this increase isn't strictly necessary, because we only
check state immediately after creating the animation, before it could have
completed (regardless of its duration). Still: we should consistently use long
durations for any animations that aren't expected to complete during the test
run, because short durations might accidentally get copypasted into new tests
where they might cause intermittent failures.

MozReview-Commit-ID: 8wSRqHMI12L

--HG--
extra : rebase_source : 12e6a054dce047351b06e064bcedd9cdec58150f
2016-04-01 06:03:25 +09:00
Hiroyuki Ikezoe
75228bfa24 Bug 1256503 - Part 1: Use MS_PER_SEC instead of human-misreadable digits in animation tests. r=dholbert
MozReview-Commit-ID: CtMF84ExBLa

--HG--
extra : rebase_source : 116e9a14d5fb77c6d24ccb1e3dcdf69a7d4ce2d0
2016-04-01 06:03:21 +09:00
Ryo Kato
b3baf9a794 Bug 1260353 - Remove unnecessary method AnimValuesStyleRule::AddPropertiesToSet() r=hiro
MozReview-Commit-ID: 3rRvYLNCvXE

--HG--
extra : rebase_source : 9997d72733affd869a09a382820d349f5493b732
2016-03-29 16:12:33 +09:00
Hiroyuki Ikezoe
4be774af37 Bug 1255710 - Part 2: Enable tests for 'transform-style: preserve-3d'. r=birtles
MozReview-Commit-ID: HzmFJErruwp

--HG--
extra : rebase_source : 6a821c2060ee63a4d3ccce70fb88f981274bb17d
2016-03-29 12:50:50 +09:00
Hiroyuki Ikezoe
eff0b8badf Bug 1255710 - Part 1: Remove all unnecessary t.step_func. r=birtles
MozReview-Commit-ID: BNBRYLpHjLy

--HG--
extra : rebase_source : 329e448a109052eb450ce17a018c3c27e39d655e
2016-03-29 12:50:35 +09:00
Hiroyuki Ikezoe
156cb0a8ca Bug 1255710 - Part 0: Rename test_animation_property_state.html to test_animation_performance_warning.html. r=birtles
MozReview-Commit-ID: EZxWc2uRVX2

--HG--
rename : dom/animation/test/chrome/test_animation_property_state.html => dom/animation/test/chrome/test_animation_performance_warning.html
extra : rebase_source : 8d0113f359237a7df102f1e3430b8eca28823142
2016-03-29 12:50:23 +09:00
Ryo Kato
7218d5dee1 Bug 1244642 - Implement AnimationEffectTiming.direction r=hiro
MozReview-Commit-ID: I8t011JVGBb

--HG--
extra : rebase_source : 15baf67ea204d55e047405c7cd9c20cfdaa12bce
2016-03-26 16:20:25 +09:00
Rob McAuley
e11d308ed2 Bug 1259898: use range-based for loop in AnimValuesStyleRule.h r=birtles
MozReview-Commit-ID: HlJ291yiVEp

--HG--
extra : rebase_source : b153563ffce9cf94e5196fc33b9f582b03371525
2016-03-26 16:50:05 +09:00
emi suzuki
7655f66912 Bug 1259883 - Enable a test for player finishing behavior in file_animation-starttime.html r=hiro
MozReview-Commit-ID: 1GPW9UsEK5E

--HG--
extra : rebase_source : 75a8ec293c5a8a380403f60efc263b92723dff78
2016-03-26 17:00:51 +09:00
Rob McAuley
4acbe0650b Bug 1244640 - implement AnimationEffectTiming iterations r=hiro
MozReview-Commit-ID: Iwq6vleUERo

--HG--
extra : rebase_source : 8eef9f68a8956db547f98ab253927cf01a3ecf50
2016-03-26 14:41:37 +09:00
Hiroyuki Ikezoe
e3a804fcb1 Bug 1259878 - remove unnecessary isSome(). r=birtles
MozReview-Commit-ID: 3Xh2D5TOTSg

--HG--
extra : rebase_source : 95715a192eb67afc6f02ca4e8895dae705d64462
2016-03-26 10:52:08 +09:00
Eddy Bruel
3e2cb55980 Bug 1229769 - We should be able to use DOM promises in the worker debugger;r=khuey 2016-03-24 16:12:00 +01:00
Brian Birtles
ded9534a6c Bug 1245748 - Add a Move constructor to Keyframe; r=heycam
I have confirmed that by adding this, we end up calling SwapElements() on the
mPropertyValues member when we build up the nsTArray<Keyframe> result in
GetKeyframeListFromPropertyIndexedKeyframe. Without this explicit move
constructor (i.e. with only the default move constructor) the copy-constructor
for mPropertyValues is called.

MozReview-Commit-ID: 6IWkP97RFUr

--HG--
extra : rebase_source : 4ac4b6545337810a3047f2cfb1dac86074116cfb
2016-03-24 10:39:29 +09:00
Brian Birtles
119a18fee3 Bug 1245748 - Remove no-longer-needed code for directly setting up properties in KeyframeEffect(ReadOnly) constructor; r=heycam
MozReview-Commit-ID: 4V3LMByas9Q

--HG--
extra : rebase_source : c2c687cd39b8287e7e9cb2a4edd12c86a056a0de
2016-03-22 16:36:45 +09:00
Brian Birtles
81c73a9b4b Bug 1245748 - Use Keyframe-based utility functions when constructing KeyframeEffect(ReadOnly); r=heycam
MozReview-Commit-ID: 72vLatkFqMq

--HG--
extra : rebase_source : 5b40afe6e12b3bcb3a57ed294fc582bf7e40ba18
2016-03-22 16:35:53 +09:00
Brian Birtles
1cf303b56f Bug 1245748 - Add ApplyDistributeSpacing for Keyframe objects; r=heycam
MozReview-Commit-ID: 8KNERsl8tea

--HG--
extra : rebase_source : e48ca76aea6e93722f285bf59a8696d6a102bf99
2016-03-22 16:35:53 +09:00
Brian Birtles
93bd57b41f Bug 1245748 - Add GetAnimationPropertiesFromKeyframes; r=heycam
MozReview-Commit-ID: GUnogloqViS

--HG--
extra : rebase_source : ba999c9f9bf18683b7942dfefe0c0242124af474
2016-03-22 16:34:14 +09:00
Brian Birtles
56612fa76d Bug 1245748 - Add PropertyPriorityIterator; r=heycam
MozReview-Commit-ID: JjBWcyEG3f6

--HG--
extra : rebase_source : f3f4de1b665078112205883cb1885931b84ff6ee
2016-03-22 16:33:16 +09:00
Brian Birtles
7e9749fed0 Bug 1245748 - Split PropertyPriorityComparator into a separate (reusable) class; r=heycam
MozReview-Commit-ID: Gq5VylZoS2q

--HG--
extra : rebase_source : c47b937ef63df3dbabfe4dded9de42372c5403f6
2016-03-22 16:33:11 +09:00
Brian Birtles
b411ad9926 Bug 1245748 - Add nsStyleContext parameter to StyleAnimationValue::ComputeValue(s); r=heycam
StyleAnimationValue::ComputeValue(s) will automatically look up the style
context of the supplied element. This is mostly fine, but when we start using
this method in scenarios where we are building the initial style context
(as happens later in this patch series) it can easily land us in a situation
where we iterate indefinitely.

It would be better, instead, to just explicitly pass in the style context we
want to use, as we already do for StyleAnimationValue::ExtractComputedValue.

MozReview-Commit-ID: ZoVBlBRRBI

--HG--
extra : rebase_source : 9012cc2e405fc887f070fbfaa2f9853289882862
2016-03-22 16:31:09 +09:00
Brian Birtles
67707b72eb Bug 1245748 - Add KeyframeUtils::GetKeyframesFromObject; r=heycam
MozReview-Commit-ID: 2cl8NIMApSy

--HG--
extra : rebase_source : f0cafad483afcf36efa86f6fa137bbffd068bcb5
2016-03-22 16:25:38 +09:00
Brian Birtles
9ccb67c08b Bug 1245748 - Move keyframe handling code to a separate KeyframeUtils class; r=heycam
MozReview-Commit-ID: 2r27vCLcOhs

--HG--
extra : rebase_source : 6ba24ece944543e250728cf2b18370c277e746d0
2016-03-22 16:20:37 +09:00
Brian Birtles
fa75146d8b Bug 1245748 - Add missing includes to TimingParams.{cpp,h}; r=heycam
Once we tweak moz.build in the next patch, the grouping in the unified build
will change and expose these missing includes so we fix them here, first.

MozReview-Commit-ID: GebEEociwTo

--HG--
extra : rebase_source : 18158fdf8a3c1a1dcf446118371cad1a15fd4daf
2016-03-22 16:20:31 +09:00
Brian Birtles
22923130f6 Bug 1245748 - Define the Keyframe type for storing specified keyframes; r=heycam
MozReview-Commit-ID: rejtrG0U1A

--HG--
extra : rebase_source : 24815326a6dfc8c71eda559703f791a204185ea2
2016-03-22 16:19:43 +09:00
Brian Birtles
84a59825cc Bug 1245748 - Update handling of 'composite' dictionary members to match changes to the spec; r=heycam, r=bz
Specifically, for the 'composite' member on keyframes, we now indicate "use the
composite value specified on the effect" using a missing/undefined 'composite'
member as opposed to a null value.

MozReview-Commit-ID: ZH45GvCTlP

--HG--
extra : rebase_source : 5acf081fb844f81280765a87ec019b7847ca1885
2016-03-22 16:18:22 +09:00
Brian Birtles
e8806251b8 Bug 1245748 - Rename Keyframe-related IDL types to match changes to Web Animations spec; r=heycam, r=bz
In particular, the spec no longer has Keyframe and PropertyIndexedKeyframes
types but rather deals with objects. The algorithms for processing these
objects, however, define various Base* types:

  https://w3c.github.io/web-animations/#dictdef-basepropertyindexedkeyframe
  https://w3c.github.io/web-animations/#dictdef-basekeyframe
  https://w3c.github.io/web-animations/#dictdef-basecomputedkeyframe

MozReview-Commit-ID: 3RqoEO66kJ

--HG--
rename : dom/webidl/Keyframe.webidl => dom/webidl/BaseKeyframeTypes.webidl
extra : rebase_source : 35a586584934170c5427138a85d167258cb34993
2016-03-22 16:16:39 +09:00
Brian Birtles
2459ec4912 Bug 1245748 - Move ComputedTiming to a separate file; r=heycam
Before we begin re-arranging KeyframeEffect.h we move ComputedTiming aside
since putting it in a separate file should make navigating the source
easier.

MozReview-Commit-ID: L5GTFAo00sh

--HG--
extra : rebase_source : e88b6ea092c459afa90831de8469697454e00c5a
2016-03-22 08:11:05 +09:00
Daisuke Akatsuka
07d9c95713 Bug 1254761 - Part 3: Add tests for AnimationFilter. r=birtles
--HG--
extra : rebase_source : 188cd7bc49e9c143540b874945ab6a3bbfbf79bf
2016-03-22 09:33:09 +09:00