Commit Graph

203 Commits

Author SHA1 Message Date
Boris Chiou
43960e1a63 Bug 1067769 - Part 11: Implement animation mutation observer while setting the target. r=birtles
MozReview-Commit-ID: EjgbslUwPKw

--HG--
extra : rebase_source : a93b08d48769c1e73fccb420553b41d06fbc8e16
2016-04-28 23:22:43 +08:00
Boris Chiou
6b5b1483f8 Bug 1067769 - Part 10: Implement SetTarget(). r=birtles
MozReview-Commit-ID: GW3Ujn5cbY3

--HG--
extra : rebase_source : ffc006c67d5b0dd712c4d7d3f938c37b8167ad58
2016-04-28 23:22:43 +08:00
Boris Chiou
cba7a5b73d Bug 1067769 - Part 9: Wrap RequestRestyle and UnregisterTarget. r=birtles
We will need to request a restyle and unregister the current target in
SetTarget(), and there are many duplicate code segments for them now, so wrap
them for reusing the code.

MozReview-Commit-ID: 33XoNspZme3

--HG--
extra : rebase_source : 881aa13d79ccc75872a6cc48d0a1da71cfdff2ae
2016-04-28 23:22:43 +08:00
Boris Chiou
0937d3158e Bug 1067769 - Part 8: Add ConvertTarget function. r=birtles
Use ConvertTarget() to convert Nullabe<ElementOrCSSPseudoElement> into
Maybe<OwningAnimationTarget>, so SetTarget() can use it as well. The return type
of ConvertTarget is not Maybe<NonOwningAnimationTarget> because we need to
compare the return type with KeyframeEffectReadOnly::mTarget, so using the same
type would be easier to implement.

MozReview-Commit-ID: GskbydOMoo0

--HG--
extra : rebase_source : d1a8fe2d8fe89e4ffdb79844ab5581a9af3b2ce5
2016-04-28 23:22:43 +08:00
Boris Chiou
d423a8f2b2 Bug 1067769 - Part 7: Define OwningAnimationTarget and use it. r=birtles
1. Define OwningAnimationTarget.
2. Replace the KeyframeEffectReadOnly::mTarget/mPseudoType members with
   a Maybe<OwningAnimationTarget> mTarget member.

MozReview-Commit-ID: 65qOoNyDRSy

--HG--
extra : rebase_source : b938dbc00c918861d4141128fad8e30f61668e40
2016-04-28 23:22:43 +08:00
Boris Chiou
57a8894260 Bug 1067769 - Part 5: Support setting KeyframeEffect.target webidl interface. r=smaug
MozReview-Commit-ID: 9494jdI97MT

--HG--
extra : rebase_source : 4c8fa7bfb6502c78a96e1af1e2a6d98d7708d7dd
2016-04-28 23:22:43 +08:00
Boris Chiou
ea72ffdf23 Bug 1067769 - Part 2: Support nullable target in KeyframeEffect(ReadOnly) constructor. r=birtles
We set a null target only from Web Animations API, so make sure
KeyframeEffectReadOnly::ConstructKeyframeEffect() can handle null target
properly.

MozReview-Commit-ID: D6PoV7PGFj3

--HG--
extra : rebase_source : 4ba2d616d6b2cdfe7985ced29e4454e818d076b8
2016-04-28 23:22:42 +08:00
Boris Chiou
ce16585e39 Bug 1067769 - Part 1: Avoid doing RequestRestyle and mutation batch for null target. r=birtles
We don't need to restyle if mTarget is nullptr, so skip it. For
nsAutoAnimationMutationBatch, we also skip it if mTarget is nullptr.

AnimationColletion, nsAnimationManager and nsTransitionManger are for
CSS Animations and CSS Transtions, so the effect should have an effective
target. Therefore, I think we don't have to revise them for
nsAutoAnimationMutationBatch.

MozReview-Commit-ID: Egzr1QVEa0v

--HG--
extra : rebase_source : 2f9125f71f67a3d50f2126fed4d1b459d938de22
2016-04-28 23:22:42 +08:00
Ryo Kato
ed3e9e9db3 Bug 1244591 - Part 1: Implement KeyframeEffect.setFrames r=birtles,smaug
WebIDL referes to KeyframeEffect::SetFrames(), which is derived from
KeyframeEffectReadOnly::SetFrames() in terms of implementation.

In addition, make KeyframeEffectReadOnly::ConstructKeyframeEffect call
KeyframeEffectReadOnly::SetFrames() to simplify the code.

MozReview-Commit-ID: 7ASbtoN7Tnp

--HG--
extra : rebase_source : c398ff7154c4533255f56c7ca13314e440eb6258
2016-04-09 15:33:34 +09:00
Brian Birtles
1e1f683439 Bug 1266257 - Revise timing model calculations to use fraction-based approach; r=hiro
As per updates to Web Animations spec:

  https://github.com/w3c/web-animations/compare/10fc97366041%5E...b9a721e6536ae27c37df1e3948b013c6a52d5f4c

MozReview-Commit-ID: 5NHnF56aETJ
2016-04-21 14:51:36 +09:00
Hiroyuki Ikezoe
1b7f619907 Bug 1263063 - Part 5: Introduce TimingParams::EndTime(). r=dholbert
MozReview-Commit-ID: 6dpnb65vndl

--HG--
extra : rebase_source : b4c0046b893bf78ebec91d3308fcbfccf48a79d1
2016-04-14 19:39:42 +09:00
Hiroyuki Ikezoe
ffc5ef3515 Bug 1263063 - Part 4: Move ActiveDuration() into TimingParams. r=dholbert
MozReview-Commit-ID: 4HS8vTJYtDe

--HG--
extra : rebase_source : 5ccdc1aa1ffe0c33a0d334cf2a4736877481cd28
2016-04-14 19:39:39 +09:00
Hiroyuki Ikezoe
6846fc920e Bug 1263063 - Part 3: Change logic in KeyFrameEffect to assume that TimingParams' iteration-count has already been validated as nonnegative & finite. r=dholbert
MozReview-Commit-ID: 9mbBHvyjNZg

--HG--
extra : rebase_source : 8e371d2349095ab924ca0be241eccf28e092bdb7
2016-04-14 19:36:03 +09:00
Hiroyuki Ikezoe
99b87b0281 Bug 1263063 - Part 1: Remove unnecessary clamping of TimingParams::mIterationStart, since it's guaranteed to be nonnegative. r=dholbert
MozReview-Commit-ID: ApQVt39jasa

--HG--
extra : rebase_source : e247683aa727f7e331fc4a559032f7c636ea834c
2016-04-14 19:35:59 +09:00
Boris Chiou
1decf4e780 Bug 1249564 - Part 2: Cycle collect AnimationEffectTimingReadOnly. r=birtles
Add KeyframeEffectReadOnly::mTiming into the list of cycle collection to
avoid any possible memory leak.

MozReview-Commit-ID: C5mFQ7TsqC7

--HG--
extra : rebase_source : 8ee1e58d69a3becb0b8566fa3529154bb66d3064
2016-04-13 18:20:46 +08:00
Boris Chiou
c5c62dc083 Bug 1249564 - Part 1: Assign the parent object of AnimationEffectTiming(ReadOnly). r=birtles,bz
Use the current document as the parent object of
AnimationEffectTiming(ReadOnly).

MozReview-Commit-ID: JfPLk95hsJ1

--HG--
extra : rebase_source : ee068d0eb8e26f4c1e83b87049be8060fcd27813
2016-04-10 13:51:32 +08:00
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
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
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
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
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
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
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
Daisuke Akatsuka
f479d03a6b Bug 1253470 - Part 4: Produce console warnings for invalid easing. r=birtles 2016-03-18 16:28:22 +09:00
Boris Chiou
956b429475 Bug 1249219 - Part 6: Support pseudo elements in Animation Mutation Observer. r=heycam
We use the parent element of a pseudo element as the subject to be notified.

Usage:
We record animations targeting to pseudo elements by setting subtree attribute
to true.

MutationObserver(Node, { subtree: ture });

So all the animations targeting to the pseudo elements whose parentElement is
the first argument will be recorded.

--HG--
extra : rebase_source : 3dc87802b65c74c3e5f2ed4504652ba14465fc02
2016-03-21 16:49:50 +08:00
Brian Birtles
d13c3ccf41 Bug 1254419 - Throw if we fail to allocate memory for a values array in getProperties(); r=bz
MozReview-Commit-ID: BmDC51qWXcu

--HG--
extra : rebase_source : 77e7656dc92c834980a83eaeb18c3fc87de16e80
extra : histedit_source : 900c1c301e1fed8a8744244c6d8a14ee1b27e9b9
2016-03-17 12:47:14 +08:00
Brian Birtles
936358e5da Bug 1254419 - Make always-set members of AnimationProperty(Value)Details required; r=bz
At the same time we also make the 'warning' member of AnimationPropertyDetails
no longer nullable and simply use the absence of the member to indicate "no
warning" (which is what we were already doing -- we were never actually setting
it to null).

MozReview-Commit-ID: HdRDbqhCdmw

--HG--
extra : rebase_source : 0282bd9f0e213aa0e1ed1f5b25d58b10fb3dbc0b
extra : histedit_source : 7d1f81dc57e2a55ab0ed6c4919a25b87819d9d58
2016-03-17 10:13:50 +08:00
Brian Birtles
85fb62f571 Bug 1254419 - Fill in values sequence in getProperties(); r=heycam
MozReview-Commit-ID: 1qMmy14R4DG

--HG--
extra : rebase_source : 258cb800de10b29250efd9daa77c8ac95864a640
2016-03-15 21:42:14 +08:00
Brian Birtles
eeca04ee3b Bug 1254419 - Return animation property information from getProperties() even if the property is overridden; r=hiro
I think the reason we originally didn't do this is that the
"isRunningOnCompositor" status might be misleading for animations that are
being overridden. That is, there are some animations we don't send to the
compositor because they are being overridden by another animation (e.g. a
CSS animation touching the 'transform' animation will cause a CSS transition
on the same property not to run, despite the fact that transitions apply
higher in the cascade). This is not merely a performance optimization but means
we don't have to do the cascade on the compositor.

In the future, once we introduce additive animation, we won't be able to handle
this so simply since it an animation will be able to be partially overridden.
Instead, consumers of this API will need to look at the 'composite' member of
the various animation values to see if an animation is being fully or partially
overridden.

As a result, this API really should return all running animations, even if they
are currently being overridden.

MozReview-Commit-ID: DwmbXdCqF32

--HG--
extra : rebase_source : 14e5412015b6c2c7ec6b7e105d414a89fc746c77
2016-03-13 19:22:35 +08:00
Brian Birtles
6dcebb234a Bug 1254419 - Rename getPropertyState() to getProperties(); r=heycam, r=bz
We are now extending this API to include more than just metadata about each
animated property but also the property values themselves.

Note that we can't use the name AnimationProperty for the dictionary since
we already use that name internally and [BinaryName] doesn't seem to apply to
dictionaries.

MozReview-Commit-ID: AcXeN4fsgTz

--HG--
extra : rebase_source : 714fdf85484775244daad6aaa288b1ec73ad6793
2016-03-13 19:10:10 +08:00
Brian Birtles
55ce436b8a Bug 1254419 - Move GetPropertyState alongside GetFrames; r=hiro
This better matches the order in the WebIDL and, once we rename
GetPropertyState to GetProperties it will make sense for GetFrames and
GetProperties to be side-by-side.

MozReview-Commit-ID: 67s9WGksPFv

--HG--
extra : rebase_source : f38ea60c0fec2f063126a0aa73422230189afbf5
2016-03-15 21:18:50 +08:00
Brian Birtles
9f1ba68aef Bug 1254419 - Fix zero-length segment handling; r=heycam
Later in this patch series when we convert tests from web-platform tests to
mochitest-chrome tests, some of the test cases that use zero-length segments
(overlapping keyframes at certain offsets) would trigger failed assertions
in KeyframeEffectReadOnly::ComposeStyle. This is because this method was
originally written with CSS animations in mind where segments cannot be
zero-length. Furthermore, when these same tests cases are run as
web-platform-tests, the failed assertions are not visible.

This patch adjusts the handling of segments to allow zero-length segments and
adds a test to check that the handling matches that defined in Web Animations
which is summarized in the following informative note,

  "this procedure permits overlapping keyframes. The behavior is that at the
  point of overlap the output value jumps to the value of the last defined
  keyframe at that offset. For overlapping frames at 0 or 1, the output value
  for iteration progress values less than 0 or greater than or equal to 1 is the
  value of the first keyframe or the last keyframe in keyframes
  respectively."[1]

[1] https://w3c.github.io/web-animations/#the-effect-value-of-a-keyframe-animation-effect

MozReview-Commit-ID: JdyYbGZtbot

--HG--
extra : rebase_source : 00502ec8aec423196376e29bf4b70ef0ff178e29
2016-03-15 21:13:46 +08:00
Hiroyuki Ikezoe
45a7f9a679 Bug 1218620 - Allow opacity animation running on compositor even if the frame has any restricted transforms. r=birtles
The type name has been changed and re-ordered.

MozReview-Commit-ID: 78jrJ6a9Pro

--HG--
extra : rebase_source : f47e6bf27d8e48d10b3af123308c2ab89e71d8e1
2016-03-14 09:07:48 +09:00
Brian Birtles
107642839f Bug 1246320 part 5 - Simplify KeyframeEffect(ReadOnly) Constructor overloads further; r=hiro
As well as generally simplifying the different KeyframeEffect(ReadOnly)
constructor methods, this patch also means we will use the realm document for
parsing timing functions in all cases. Although this currently doesn't have
any impact (the current set of timing functions are expected to be parsed
identically regardless of the document used) it may become significant if, in
future, it becomes possible to register hooks with certain documents for
parsing CSS properties as part of the houdini efforts.

MozReview-Commit-ID: 4gAZi1G1uAD

--HG--
extra : rebase_source : f619592a02ddcbe56835344ec1fb3023219cd2d3
2016-03-12 22:14:10 +09:00
Brian Birtles
6846d9e23b Bug 1246320 part 4 - Pass a document to TimingParams; r=hiro
MozReview-Commit-ID: 9Sh8eWHdDD6

--HG--
extra : rebase_source : 2dc0da7076b8acaaca257583f3780266ae62b430
2016-03-11 17:27:34 +09:00
Brian Birtles
036f647012 Bug 1246320 part 3 - Rework KeyframeEffect(ReadOnly) constructor helpers; r=hiro
Once we update TimingParams to take a document, we will need to get an
appropriate document within the various constructor methods. This complicates
these methods and suggests they should be pushed into the .cpp file where
we can hide the complexity more easily and templatize the type of the options
argument so that we can share the document-fetching code.

By moving all uses of the declared template methods to the .cpp file we
can drop the explicit instantiations.

(We still need to declare the templated methods in the header file since
these methods need to be protected methods of KeyframeEffectReadOnly in
order to construct a KeyframeEffectReadOnly since its constructor is
protected.)

MozReview-Commit-ID: 8KrCWrWIb7X

--HG--
extra : rebase_source : c5b550b271cc68ceeb60a25243268a17b3ab7f65
2016-03-11 17:27:16 +09:00
Brian Birtles
3edb5638a1 Bug 1246320 part 2 - Pass document to ParseEasing; r=hiro
MozReview-Commit-ID: KWW53htO0Jj

--HG--
extra : rebase_source : 85aaa0a66cae7623fa06ebf31e0b8481ee05bbde
2016-03-11 17:21:03 +09:00
Daisuke Akatsuka
2d2c72ccbf Bug 1237173 - Part3: Throw TypeError if duration is NaN, negative value or not 'auto' string. r=birtles, r=smaug 2016-03-09 14:01:45 +09:00
Daisuke Akatsuka
cb51780a6e Bug 1237173 - Part2: Change type of duration to Maybe<StickyTimeDuration>. r=birtles 2016-03-09 14:14:20 +09:00
Ryo Motozawa
ec7074d1bf Bug 1244635 - Part1 Add enddelay implementation in dom/animation/AnimationEffectTiming.cpp r=bz,hiro
MozReview-Commit-ID: 7t1fm0zB3V

--HG--
extra : rebase_source : 812ea17b0b51142ff88194b0bb0d06435ddc574d
2016-03-08 10:31:10 +09:00
Hiroyuki Ikezoe
9cacbd5b2d Bug 1196114 - Part 5: Store performce warning information as enum type. r=birtles
Each warning message is generated only when getPropertyState() is called.

MozReview-Commit-ID: C03ZSvPv9ff

--HG--
extra : rebase_source : 5932957f8f0b171c7b100b1c22e70513959c819e
2016-03-04 17:54:25 +09:00
Hiroyuki Ikezoe
53fd8ccffb Bug 1196114 - Part 4: Localize messages for animation performance warnings. r=birtles
MozReview-Commit-ID: LPSHU2T3oP4

--HG--
extra : rebase_source : 898e11b02edd3f80452c8c2714b8364288a3fe75
2016-03-04 15:48:50 +09:00
Hiroyuki Ikezoe
d7ac86e556 Bug 1196114 - Part 3: Set AnimationPerformanceWarning messages. r=birtles
Those message will be modified in part 4 (localization).

MozReview-Commit-ID: 6TMUxemVLcu

--HG--
extra : rebase_source : 65ef1879b3e606ae6dc279981b1e995c7b2cd40b
2016-03-04 15:07:04 +09:00
Hiroyuki Ikezoe
e3df4388fc Bug 1196114 - Part 2: Add AnimationPropertyStatus interface and KeyframeEffectReadOnly.runningStatus(). r=birtles,smaug
MozReview-Commit-ID: CPz3DtWxKll

--HG--
extra : rebase_source : 5a210456997789ace942e60c3688f9600df3281c
2016-03-04 06:36:41 +09:00
Hiroyuki Ikezoe
3534158709 Bug 1196114 - Part 1: Add SetPerformanceWarning. r=birtles
MozReview-Commit-ID: 8NqvuOjKfZM

--HG--
extra : rebase_source : 07c0a1500171569de0471b96f22bd79c38165e02
2016-03-04 06:36:36 +09:00
Daisuke Akatsuka
0b1a2c1ae5 Bug 1248338 - Implement iterationStart; r=birtles 2016-03-02 16:23:34 +09:00
Ryo Motozawa
961d6c8802 Bug 1244641 - Part 3: Notify animation mutation observers from AnimationEffectTiming::SetDuration. r=hiro
MozReview-Commit-ID: LxssvTBRbRF

--HG--
extra : transplant_source : %F3i%CC%DB%04%FB%08%7C%E9%D3%A1%B39%DD%B34%14%F9%91%D7
2016-02-27 06:39:49 +09:00
Ryo Motozawa
ec3f99ba71 Bug 1244641 - Part 1: Let AnimationEffectTiming have an effect. r=hiro
MozReview-Commit-ID: REfKyGs4HK

--HG--
extra : transplant_source : %1D%BF%B3%7EU%C1%AEp%FC%E7%97%9Ds%1C%C1.%DAS%12%EF
2016-02-27 06:39:30 +09:00
Hiroyuki Ikezoe
606ae12164 Bug 1242872 - Part 6: Trigger a layer update explicitly when copying animation properties. r=birtles
MozReview-Commit-ID: AWL43ypqLPT
2016-02-19 09:16:15 +09:00
Hiroyuki Ikezoe
e80b4bb7b2 Bug 1242872 - Part 5: Change CopyPropertiesFrom to UpdateProperties. r=birtles
Once we don't create any temporary effect, we do not need to pass
the effect to CopyPropertiesFrom.

MozReview-Commit-ID: HczU5IU6Ggp
2016-02-19 09:16:15 +09:00
Hiroyuki Ikezoe
bff8c71b2a Bug 1216842 - Part 10: Remove the limit of the computed timing progress. r=birtles
Now we produce computed timing progress outside [0,1] range.
We use the last segment to calculate animation values if the value is greater than 1.
We use the first segment to calculate animation values if the value is lesser than 0.
2016-02-18 14:20:00 +01:00
Brian Birtles
1a43924a8a Bug 1249212 part 7 - Calculate the endTime in GetComputedTimingAt; r=boris
Currently endTime is calculated when getComputedTiming() is called. As a
result, the value returned there doesn't necessarily reflect what we are using
in the model. It would be more simple, consistent and useful if we simply
calculate this as part of GetComputedTimingAt and use it both internally and in
the result to getComputedTiming().
2016-02-19 08:37:32 +09:00
Brian Birtles
54a06996e5 Bug 1249212 part 5 - Remove max() clamping from endTime calculation; r=boris
Based on discussion at: https://github.com/w3c/web-animations/issues/86
2016-02-19 08:37:32 +09:00
Brian Birtles
7f5b1d41f0 Bug 1249212 part 3 - Fix active duration calculation when iteration duration is infinity; r=boris
With the added tests in part 4 we crash without this change because we end up
trying to multiply an infinite iteration duration by a zero iteration count
which trips an assertion in StickyTimeDuration. Hence we fix this behavior
before adding the tests.
2016-02-19 08:37:31 +09:00
Boris Chiou
e436478f26 Bug 1244049 - Part 2: Replace nsCSSPseudoElements::Type with CSSPseudoElementType. r=dbaron
Also, try to use forward declaraions for CSSPseudoElementType;

--HG--
extra : rebase_source : c00eb9753e8f618a33aa711538ac45c0132b353c
2016-02-17 21:37:00 +01:00
Boris Chiou
185a769719 Bug 1244049 - Part 1: Define scoped enum for CSSPseudoElement type. r=dbaron
--HG--
extra : rebase_source : e53dd269e47fa97eb259ebd9295d012eacbdb612
2016-02-16 23:07:00 +01:00
Ryo Motozawa
cc127029f8 Bug 1244586 part 1 - Add KeyframeEffect constructor in dom/webidl/KeyframeEffect.webidl. r=smaug,birtles 2016-02-15 09:34:47 +09:00
Ryo Motozawa
c49b9b29db Bug 1211783 - Add KeyframeEffect interface to dom/webidl/KeyframeEffect.webidl. r=smaug,birtles 2016-02-15 09:34:47 +09:00
Boris Chiou
bce920d78f Bug 1174575 - Part 6: Implement KeyframeEffectReadOnly Constructor for CSSPseudoElement. r=birtles
Let KeyframeEffectReadOnly::Constructor support both Element and
CSSPseudoElement as the target.
2016-02-09 05:05:00 +01:00
Boris Chiou
8627ee5709 Bug 1174575 - Part 5: Support pseudo-element type in StyleAnimation. r=birtles
Add one more argument, nsCSSPseudoElement::Type, for
StyleAnimation::ComputeValue and StyleAnimation::ComputeValues
2016-02-09 05:04:00 +01:00
Boris Chiou
84a4a3fe03 Bug 1174575 - Part 3: Implement KeyframeEffectReadOnly::GetTarget(). r=birtles
Implement GetTarget() and functions of CSSPseudoElement.
We use a strong reference from CSSPseudoElement to Element and a non-owning
reference from Element to CSSPseudoElement.
2016-02-01 23:59:00 +01:00
Boris Chiou
2f694d7e1e Bug 1174575 - Part 2: Replace Element in KeyframeEffectReadOnly WebIDL. r=birtles, r=smaug
Use (Element or CSSPseudoElement)? as the first arguement of constructor and
the type of target.
2016-02-05 19:01:00 +01:00
Matt Woodrow
7cd754d8cf Bug 1229317 - Allow preserve-3d and opacity to be combined on the root element of a preserve-3d chain. r=roc 2016-02-07 23:51:11 +13:00
Cameron McCormack
02cfaf41a1 Bug 1244595 - Don't check whether shorthands are non-animatable when parsing JS keyframe objects. r=birtles 2016-02-05 08:56:11 +11:00
Brian Birtles
73e4706ab3 Bug 1239889 part 1 - Throw if the animation target does not have a current document; r=heycam
This is just a temporary measure to avoid a failed assertion / crash until we
fix bug 1245748.
2016-02-05 14:11:04 +11:00
Birunthan Mohanathas
d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Hiroyuki Ikezoe
1f0f8d7a93 Bug 1216842 - Part 8: Calculate transformed progress using animation effect's timing function. r=cam
http://w3c.github.io/web-animations/#calculating-the-transformed-time
2016-01-29 14:48:00 +01:00
Hiroyuki Ikezoe
15210ae758 Bug 1216842 - Part 6: Make mTimingFunction in OrderedKeyframeValueEntry const Maybe<>*. r=cam 2016-01-29 14:47:00 +01:00
Hiroyuki Ikezoe
03409db313 Bug 1216842 - Part 4: Move ParseEasing into AnimationUtils. r=cam
ParseEasing will be also used in AnimationEffectTimingReadOnly class.
2016-01-27 02:08:00 +01:00
Hiroyuki Ikezoe
ba1bb81b2e Bug 1216842 - Part 3: Change ComputedTimingFunction* to Maybe<ComputedTimingFunction>. r=cam
Nothing() represents linear function, i.e. skip calculation.
ParseEasing is changed to return a Maybe<ComputedTimingFunction>,
if timing function is linear function, ParseEasing returns Nothing().
2016-01-29 14:44:00 +01:00
Phil Ringnalda
d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Brian Birtles
5dbcb5013b Bug 1096773 part 2 - Add a KeyframeEffectReadOnly constructor that takes a TimingParams argument; r=boris
This will allow us to re-use the constructor from Animatable.animate() since the
existing type, UnrestrictedDoubleOrKeyframeEffectOptions, is not compatible with
UnrestrictedDoubleOrKeyframeAnimationOptions (introduced in the next patch in
this series), as used by Animatable.animate()
2016-01-29 12:37:52 +11:00
Brian Birtles
d9fb138530 Bug 1096773 part 1 - Make the frames argument to the KeyframeEffectReadOnly constructor NOT optional; r=bz
This is to line up with the spec as discussed in:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1096773#c6
2016-01-29 12:37:52 +11:00
Brian Birtles
b324d8ff0d Bug 1237467 part 4 - Delete the EffectSet when it becomes empty; r=heycam 2016-01-15 15:15:47 +09:00
Brian Birtles
15169cd872 Bug 1237467 part 2 - Clear mProgressOnLastCompose when the effect is no longer relevant; r=heycam 2016-01-15 15:15:47 +09:00
Boris Chiou
86a80f4228 Bug 1214536 - Part 8: Add an operator=() for TimingParams. r=birtles
Overload TimingParams::operator=() for AnimationEffectTimingProperties objects,
so we can assign an AnimationEffectTimingProperties/KeyframeEffectOption object
to a TimingParams object.

We also keep the uninitialized state of KeyframeEffectOptions::mDuration while
converting a KeyframeEffectOptions object into a TimingParams object.
2016-01-13 18:42:00 +01:00
Boris Chiou
deee95a0d8 Bug 1214536 - Part 7: Rename AnimationTiming as TimingParams. r=birtles, r=smaug
1. struct AnimationTiming -> struct TimingParams
2. AnimationEffectReadOnly::TimingAsObject() -> AnimationEffectReadOnly::Timing()
3. KeyframeEffectReadOnly::Timing() -> KeyframeEffectReadOnly::SpecifiedTiming()
2016-01-13 18:41:00 +01:00
Boris Chiou
fa79443f12 Bug 1214536 - Part 5: Add AnimationEffectTimingReadOnly interface. r=birtles, r=smaug
1. Add AnimationEffectTimingReadOnly.webidl.
2. Add AnimationEffectTimingReadOnly cpp files.
3. Use AnimationEffectTimingReadOnly as KeyframeEffectReadOnly::mTiming.

--HG--
extra : rebase_source : 0e9c112b70ae56f2bcdf162374388857518fc124
extra : amend_source : 0aebf0e9daac77542d913e4ad6a07c75e21a93b5
2016-01-13 18:37:00 +01:00
Boris Chiou
71cff999e0 Bug 1214536 - Part 4: Use OwingUnrestrictedDoubleOrString for duration. r=birtles
We store the original value of duration in AnimationTiming, and add
computed duration in ComputedTiming, so both the Timing model and
AnimationEffectTimingReadOnly can get what they want.

By the way, replace mIterationDuration with mDuration.

--HG--
extra : rebase_source : f8e1fd648572e6d7b1cbecc2ac1888a2f74bbc7e
2016-01-13 18:36:00 +01:00
Boris Chiou
76f7e5a44e Bug 1214536 - Part 3: Store the original value of fill. r=birtles
FillMode could be 'auto', and we should treat it as 'none' in the timing model.
However, AnimationEffectTimingReadOnly should get its original value.

By the way, replace mFillMode with mFill.

--HG--
extra : rebase_source : 5a397dd7fbb22ac76fe96003d82d097e398852c7
2016-01-13 18:36:00 +01:00
Boris Chiou
44cb5bee0a Bug 1214536 - Part 1: Use unrestricted double for iterations. r=birtles
We want to store the original value from KeyframeEffectOptions whose
iterations is unrestricted double. Therefore, we can get the original value
of iterations by AnimationEffectTimingReadOnly.

By the way, replace mIterationCount with mIterations.

--HG--
extra : rebase_source : da2953056031079c41273ed977545dc926e1b83c
2016-01-10 18:41:00 +01:00
Nigel Babu
0ce7a5f39e Backed out 5 changesets (bug 1235112, bug 1237467) for nsRuleNode::Transition crashes
Backed out changeset ac21baf87df2 (bug 1235112)
Backed out changeset c47a6e0a6d95 (bug 1237467)
Backed out changeset 7609ca218902 (bug 1237467)
Backed out changeset d63ca2677bd5 (bug 1237467)
Backed out changeset 5a3d7e16b1e0 (bug 1237467)

--HG--
extra : commitid : LONozKsGtli
2016-01-14 11:35:06 +05:30
Brian Birtles
35e610c8ad Bug 1237467 part 4 - Delete the EffectSet when it becomes empty; r=heycam 2016-01-14 08:02:39 +09:00
Brian Birtles
dcc43d48af Bug 1237467 part 2 - Clear mProgressOnLastCompose when the effect is no longer relevant; r=heycam 2016-01-14 08:02:39 +09:00
Brian Birtles
8cc58f3707 Bug 1238660 part 2 - Preserve "wins in cascade" state when updating animations; r=hiro
When updating animations, we shouldn't unnecessarily clobber the "wins in
cascade" state of their properties since this can lead to unnecessary restyles
when we then decide we need to update the cascade.
2016-01-13 13:38:16 +09:00
Brian Birtles
7f1681beaa Bug 1238660 part 1 - Make mWinsInCascade initially false; r=hiro
As of bug 1228229, the mWinsInCascade member of animation properties is set
consistently for both animations and transitions such that we only set this
to true if an animation is "in effect".

When an effect is initially created it is not "in effect" until it is attached
to a non-idle animation. We should, therefore, initialize this to false and,
when we become in effect, mark the cascade as needing an update.
2016-01-13 13:38:16 +09:00
Brian Birtles
2a70c0a477 Bug 1232577 part 12 - Move the remainder of RequestRestyle from AnimationCollection to EffectCompositor; r=heycam
This also allows us to remove all references to AnimationCollection and the
animation managers from Animation.
2016-01-13 07:54:54 +09:00
Brian Birtles
464b5fb4b7 Bug 1232577 part 6 - Add animation rule refresh time to EffectSet; r=heycam
AnimationCollection keeps a TimeStamp that records the refresh driver time when
the animation style rule was last updated. This is used for two purposes:

1. To determine when the style rule is out of date.

2. For animations that are partially throttled on the main thread, e.g.
   transform animations that affect the scrollable region which we update every
   200ms on the main thread.

In this bug we are removing all the overlapping bits of state used to track if
animations are up-to-date or not and replacing them with the hashmap stored on
the EffectCompositor which tracks which animations are currently in need of an
update. As a result, we would like to remove this style rule refresh time.
However, we will need something for case (2) from above.

This patch adds an animation rule refresh time to the EffectSet purely for the
purposes of partially-throttled animations so that we can later remove the style
rule refresh time from AnimationCollection.
2016-01-13 07:54:54 +09:00
Brian Birtles
815e0c4b64 Bug 1232577 part 4 - Add and remove (pseudo-)elements needing an animation style rule update to the EffectCompositor; r=heycam
This patch uses the presence/absence of (pseudo-)elements in the "needs
animation rule update" hashmap on EffectCompositor to detect if a style update
is required. The various flags in AnimationCollection that do a similar job
still remain so that we can remove them one-by-one in subsequent patches in
this series.
2016-01-13 07:54:53 +09:00
Brian Birtles
03057136c3 Bug 1232577 part 3 - Move RestyleType to EffectCompositor; r=heycam
This is in preparation for moving RequestRestyle to EffectCompositor (and
because we'll run into compile issues if we don't since AnimationCommon.h
includes too many interdependent definitions).
2016-01-13 07:54:53 +09:00
Brian Birtles
8bfaf66a58 Bug 1232563 part 4 - Don't perform style updates when the effect progress has not changed; r=heycam
Now that restyle requests are handled by the effect, we can more easily detect
cases where we don't need to trigger a style update by looking for when the
output of the effect could actually differ.

Currently, any changes that require updates where the progress does *not* change
(e.g. pausing) are triggered by the Animation. The exception is when we
update timing properties (e.g. animation-iteration-count) from CSS but
current nsAnimationManager takes care to adjust the animation generation in
this case.

--HG--
extra : rebase_source : ecc0b5c80e52ce17214ab8c6ac9681477e3f80ca
2016-01-06 11:04:06 +09:00
Brian Birtles
ba0280fd28 Bug 1232563 part 3 - Drop check for an empty set of properties when requesting restyles from KeyframeEffectReadOnly; r=heycam
This is because rather than simply requesting a throttled restyle when there
were no properties, as of the previous patch, we no longer request a restyle at
all in this case.

We should be able to restore this optimization in bug 1235002 when we properly
encapsulate the properties of a keyframe effect.

--HG--
extra : rebase_source : 1774698e15178cf8f8295160b96adea8ca5a2ed2
2016-01-06 11:04:06 +09:00
Brian Birtles
55c934a957 Bug 1232563 part 2 - Move RequestRestyle calls to the effect; r=heycam
--HG--
extra : rebase_source : 40d014f1ab978534a172545b33d3f9c7d1a56395
2016-01-06 11:04:06 +09:00
Brian Birtles
bf0b758990 Bug 1229280 - Move animation generation from AnimationCollection to EffectSet; r=dbaron
--HG--
extra : rebase_source : 26a942c8c6058e629e7d7ed549eb1fcdf7f6d399
2016-01-06 11:04:05 +09:00