Commit Graph

787 Commits

Author SHA1 Message Date
Daisuke Akatsuka
a152d59824 Bug 1253470 - Part 1: Produce console warnings for invalid duration. r=birtles 2016-03-18 10:07:10 +09:00
Boris Chiou
93875ba2dd Bug 1249219 - Part 7: Test. r=birtles
Add tests in test_animation_observers.html, so we can test elements and pseudo
elements together by setting subtree.

--HG--
extra : rebase_source : 1841d5db93657a07772bc73ce99cb6ab2a43a737
2016-03-21 16:49:50 +08: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
Boris Chiou
0fab3e5678 Bug 1249219 - Part 4: Use NonOwningAnimationTarget as the returned value of some animation target getters. r=birtles
Use NonOwningAnimationTarget as the returned type of
1. KeyframeEffectReadOnly::GetTarget()
2. nsNodeUtils::GetTargetForAnimation(...)

--HG--
extra : rebase_source : 3b0e117528035329fdf4bdbee127f095b710805a
2016-03-21 16:49:50 +08:00
Boris Chiou
efe45f15d3 Bug 1249219 - Part 3: Replace Pair<Element*, CSSPseudoElementType> with NonOwningAnimationTarget. r=birtles
--HG--
extra : rebase_source : 35e69a293cdb7a25ce579dbb453289ed3521e7e2
2016-03-21 16:49:50 +08:00
Boris Chiou
4f53d19ab1 Bug 1249219 - Part 2: Remove struct PseudoElementHashKey. r=birtles
We use NonOwningAnimationTarget as the hash key.

--HG--
extra : rebase_source : a31127e1be91fb4c6e9eb4070986ef7423b2f4dd
2016-03-21 16:49:50 +08:00
Boris Chiou
02817311d0 Bug 1249219 - Part 1: Define NonOwningAnimationTarget. r=birtles
NonOwningAnimationTarget is a struct made of two members:
1. mozilla::dom::Element*
2. mozilla::CSSPseudoElementType

--HG--
extra : rebase_source : df7ecf192c14f1973b064ffe8a31618df2e6955d
2016-03-21 16:49:49 +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
d77e2ed28e Bug 1254419 - Add tests for getProperties(); r=heycam
MozReview-Commit-ID: LrQf2t1L5TG

--HG--
extra : rebase_source : 57e31c2bd1bf9684c5bbff12ac89ec7870d1389e
2016-03-15 21:44:52 +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
4e06af5a13 Bug 1218620 - Part 2: Skip all 'preserve-3d' tests which breaks other compositor frames. r=birtles
MozReview-Commit-ID: 85dk5yOYizZ

--HG--
extra : rebase_source : a2cc3fa74b4bc967b58129458ab084e2a56acc74
2016-03-14 13:08:11 +09: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
Brian Birtles
56844c08b6 Bug 1246320 part 1 - Add AnimationUtils::GetCurrentRealmDocument; r=bz
Adds a utility function for getting the document on the global associated with
a JSContext. We will need this in various situations where we want to use
the CSS parser (which requires various bits of state we pull off a document)
to parse a timing function but might not have a target element.

Strictly speaking we currently always have a target element but in future we
expect to support creating KeyframeEffects without an associated target
element. Also, we will need this for some situations in bug 1245748 where we
need to parse CSS properties on keyframe objects when we may not have a
target element.

MozReview-Commit-ID: Klku1LFoRGp

--HG--
extra : rebase_source : f2aa06aafb8fa9b212791a3e602a168f5170fcd9
2016-03-11 17:20:17 +09:00
Brian Birtles
2c723064d6 Bug 1246320 part 0 - Whitespace fixes; r=whitespace-only
MozReview-Commit-ID: CpULkfcd21R

--HG--
extra : rebase_source : 5f14fceea5fbbe64dc4076fd283125a4b51b28e9
2016-03-11 17:15:23 +09:00
Daisuke Akatsuka
07b681672e Bug 1244638 - Part 3: Rename method from NotifyTimingUpdate to PostSpecifiedTimingUpdated. r=birtles
MozReview-Commit-ID: H0fBTwqiZiS

--HG--
extra : rebase_source : 7e26f38006faff26b0f1fbf66a1062b9b12d1ac4
2016-03-11 15:40:32 +09:00
Daisuke Akatsuka
b4e46e7179 Bug 1244638 - Part 2: Throw TypeError if iterationStart is NaN, negative value or Infinity. r=birtles, r=smaug
MozReview-Commit-ID: A8zSm6TgwOP

--HG--
extra : rebase_source : 50e88537430cf6cfc5552350a818128f0ff7756f
2016-03-11 18:04:39 +09:00
Daisuke Akatsuka
46e09dcc48 Bug 1244638 - Part 1:implement AnimationEffectTiming iterationStart. r=birtles, r=smaug
MozReview-Commit-ID: K9UfNViDMHz

--HG--
extra : rebase_source : 6d521503b0c80b285c7a9bfc0226f17e5648c482
2016-03-11 17:22:32 +09:00
Boris Chiou
6f9f86f788 Bug 1254418 - Part 2: Test getAnimations for generated-content elements. r=birtles 2016-03-10 22:16:00 -05:00
Ryo Motozawa
f7a0ff2a51 Bug 1254881 - Fix animation duration in dom/animation/test/chrome/test_running_on_compositor.html. r=hiro
MozReview-Commit-ID: Dd42HicB0Ci

--HG--
extra : rebase_source : 0141baba051fd9a2c39ce18296799d921b518122
2016-03-09 01:08:00 -05:00
Hiroyuki Ikezoe
0e6b05c3b8 Bug 1254840 - Use longer animation duration to avoid intermittent failures on slow platforms. r=dholbert
MozReview-Commit-ID: FXrO0yI7Irt

--HG--
extra : rebase_source : dc9a4b629d9cb34821e0ba2ae2108454a9781805
2016-03-10 09:36:04 +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
Daisuke Akatsuka
642702e0bb Bug 1237173 - Part1: Move TimingParam struct to a new file. r=birtles 2016-03-07 14:11:11 +09:00
Ryo Motozawa
2c887f4afc Bug 1244635 - Part2 Add enddelay tests in dom/animation/test/chrome r=hiro
MozReview-Commit-ID: Kylwd6UJcXH

--HG--
extra : rebase_source : 0da2ed9e152e2e57a42f044be896e39e3f701bd3
2016-03-08 10:31:28 +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
Jonathan Watt
a73bd8c354 Bug 1253094, part 1 - Stop using DebugOnly for class/struct members in dom/. r=baku
MozReview-Commit-ID: ErWZs9oV4WS
2016-02-26 15:52:06 +00:00
Boris Chiou
ce5add21a7 Bug 1241784 - Part 2: Implement CSSPseudoElement.animate(). r=birtles 2016-03-04 00:54:00 +01: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
Jonathan Watt
1c0c9bcf8a Bug 763784 - Make VectorImage::GetAnimated check for CSS animations. r=dholbert 2016-02-22 13:05:20 +00:00
Daisuke Akatsuka
0b1a2c1ae5 Bug 1248338 - Implement iterationStart; r=birtles 2016-03-02 16:23:34 +09:00
Ryo Motozawa
d88bc0fdce Bug 1244641 - Part 4: Add duration tests in dom/animation/test/chrome. r=hiro
MozReview-Commit-ID: H2XbCfrzn8o

--HG--
extra : transplant_source : %CA%3C%A6%87%C7g%27%27z%E2%3D%09%3F4H%F2%21%D4H%1A
2016-02-27 06:39:58 +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
48a1f4e4f0 Bug 1244641 - Part 2: Add duration implementation in dom/animation/AnimationEffectTiming.cpp. r=hiro, r=smaug
MozReview-Commit-ID: K5wmKo1U2JP

--HG--
extra : transplant_source : %FD%F3y%D6%ED%E7%B0%1Cc%A9%CD2%B8%BFcH%A4%B5%D0%8F
2016-02-27 06:39:39 +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
Boris Chiou
f7bc255d47 Bug 1234403 - Part 5: Test for CSSPseudoElement.getAnimations. r=birtles 2016-02-24 19:12:00 +01:00
Boris Chiou
0a915f46c1 Bug 1234403 - Part 4: Test for the animation order returned by document.getAnimations(). r=birtles 2016-02-24 03:13:00 +01:00
Boris Chiou
72df62cbf6 Bug 1234403 - Part 3: Test for the CSSPseudoElement objects returned by effect.target. r=birtles 2016-02-24 03:12:00 +01:00
Boris Chiou
1c9da6a517 Bug 1234403 - Part 1: Implement CSSPseudoElement.getAnimations. r=birtles 2016-02-18 02:21:00 +01:00
Brian Birtles
d06f85599d Bug 1239945 part 1 - Drop a number of animation manager/collection-related methods that are unused (and in some cases undefined); r=dholbert 2016-02-24 13:41:16 +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
Cameron McCormack
89cac5abd1 Bug 1248864 - Part 3: Use RestyleManagerHandle instead of concrete restyle manager class. r=dholbert 2016-02-24 18:01:12 +11:00
Cameron McCormack
736a5f47e7 Bug 1248864 - Part 1: Move RestyleManager.h to EXPORTS.mozilla. r=dholbert 2016-02-24 18:01:12 +11:00
Hiroyuki Ikezoe
4e9c9820e9 Bug 1249431 - Need preferences for crash tests using Web Animation APIs. r=birtles
MozReview-Commit-ID: 5ybJUTgy7bW

--HG--
extra : transplant_source : k%7B%3Cz%7C%C8%AE%A8%C4rsks%15f%16%1C%9E%D6%D1
2016-02-19 07:46:42 +09:00
Boris Chiou
54f794359b Bug 1249230 - Prepend an extra colon to the pseudo type string. r=birtles 2016-02-18 19:35:00 +01:00
Boris Chiou
5c37ed6ba0 Bug 1244049 - Part 4: Define CSSPseudoElementTypeBase. r=dbaron
In order to convert CSSPseudoElementType into its underlying type easier,
we define CSSPseudoElementTypeBase. However, keep using uint8_t directly for
forward declarations.
2016-02-18 19:18:00 +01:00
Hiroyuki Ikezoe
c5b7bd9a33 Bug 1216842 - Part 12: Extrapolate bezier function outside [0,1]. r=birtles
We use the tangent at the each boundary points as same as Chrome does.
2016-02-18 14:22:00 +01:00
Hiroyuki Ikezoe
10fdacf755 Bug 1216842 - Part 11: Clamp values of step functions outside [0, 1]. r=birtles 2016-02-18 14:21:00 +01: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
Juan Gomez
8ea937311f Bug 1248581 - Fix build bustage on WakeLock.h and CSSPseudoElement.h. r=khuey
--HG--
extra : rebase_source : 1f6ac7072abea2a610443caee467e7ba191218ae
2016-02-16 15:08:00 +01:00
Martin Thomson
ebd25ddf94 Bug 1248105 - Move CSSPseudoElement::GetParentObject out of header, r=boris
MozReview-Commit-ID: 5vZQlv8q0df

--HG--
extra : rebase_source : 57a9ab8a5e579b8533e74ab8e6c6ec8d77ef4ea7
2016-02-15 11:51:34 +11: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
e54a74b405 Bug 1226047 - Add AnimationEffectTiming interface in dom/webidl/AnimationEffectTiming.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
Chris Peterson
f6442f17d6 Bug 1247531 - Annotate intentional switch fallthrough to suppress -Wimplicit-fallthrough warning in dom/animations/. r=dholbert
dom/animation/AnimationUtils.cpp:73:9: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
2016-02-10 23:04:28 -08: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
2a5bfa8330 Bug 1174575 - Part 4: Support CSSPseudoElement for TimingParams. r=birtles 2016-02-05 19:11: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
Boris Chiou
8098462872 Bug 1174575 - Part 1: Define CSSPseudoElement interface. r=birtles, r=smaug
Create CSSPseudoElement.webidl, CSSPseudoElement.h, and CSSPseudoElement.cpp.
2016-02-01 23:49:00 +01:00
L. David Baron
4cc8e3dd91 Bug 1245075 patch 2 - Fix EffectSet::GetEffectSet(nsIFrame*) and EffectCompositor::GetAnimationElementAndPseudoForFrame to only return effects when the frame is the style frame for its content. r=birtles
This means that we won't associate animations with additional frames.
In this case, this fixes associating off-main-thread animations with a
table outer frame, when they should have been associated only with the
table frame.

Locally, the test fails without the patch (with opacity in the test
being 0.36 instead of the expected 0.6), and passes with the patch.
(Opacity 0.36 gives a color of rgb(163,163,255), whereas 0.6 gives
rgb(102,102,255).)

--HG--
extra : commitid : 7wtkIDLDHBF
2016-02-07 08:43:49 -08: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
Hiroyuki Ikezoe
8a841d093a Bug 1241692 - Part 2: We should observe stylings only for animations. r=dholbert
We don't need observe restylings other than animations.  If those restylings
happen, it's just noise for this test.  We should drop them.

--HG--
extra : transplant_source : 9%0B%0B%B7O%E5R%86%D4%7F%29%90q%DDQ0%0B%FAuJ
2016-02-06 20:38:24 +09:00
Hiroyuki Ikezoe
f8177694cb Bug 1241692 - Part 1: Ensure that element which is added in each test is removed before subsequent test is processed. r=dholbert
Before this fix, sometimes an element which was removed in a prior test
would still visible when subsequent test starts.
We should wait for paints to complete after the element has been removed.

--HG--
extra : transplant_source : %C7%7F%03%0F%DA%05A%C1%CE%F0m%DA1%C5%1D%FA%06%FA%FE%CA
2016-02-06 20:38:12 +09: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
Hiroyuki Ikezoe
c35622c465 Bug 1239889 part 2 - Test for an animation target without a current document; r=birtles 2016-02-05 14:11:04 +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
f03d398a98 Bug 1244080 - Part 1: Test that setting duration in the middle of the animation causes only once a restyling. r=bbirtles 2016-02-01 00:46:00 +01:00
Hiroyuki Ikezoe
05a9e1b0ad Bug 1244080 - Part 0: Remove unnecessary argument for remove(). r=bbirtles 2016-02-01 00:46:00 +01: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
c3619f4a48 Bug 1216842 - Part 5: Store ComputedTimingFunction in TimingParams. r=cam
The reason why we use Maybe<> to store the function is that CSS
animations/transitions do not have the function property.
2016-01-29 14:45: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
Hiroyuki Ikezoe
409715935c Bug 1216842 - Part 2: Add LayerAnimationUtils. r=cam
This is also for compositor side.
we need a new class to share the function which converts TimingFunction
to ComputedTimingFunction for either keyframe's timing function or keyframe
effect's timing function.
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
ef5aaf9e4c Bug 1096773 part 4 - Add tests for Animatable.animate(); r=bz 2016-01-29 12:37:52 +11:00
Brian Birtles
5358a5c81e Bug 1096773 part 3 - Implement Animatable.animate(); r=bz 2016-01-29 12:37:52 +11: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
Hiroyuki Ikezoe
2e4a107162 Bug 1235286 - Part 3: Comment out some compositor animations tests. r=birtles
In current our implemantation, animations which can run on compositor
in invisible element can not run on compositor on all desktop platforms.
*BUT* both on Android and B2G the animations still run on compositor somehow.

And one more thing.  Animations can run on compositor in elements which are
scrolled out in the parent element *RUN* on compositor as well.

mochitest does not allow us to disable each test on specific platforms respectively.
One we have mozinfo in mochitest (bug 1150818), we can skip the tests on specific platforms.
2016-01-20 02:31:00 +01:00
Hiroyuki Ikezoe
7d7693b812 Bug 1235286 - Part 2: Tests for animation optimizations. r=birtles
--HG--
extra : transplant_source : %05%087%F1%8En%C5V%F5%D9ds%7D%C8%5CsB%02%87%EC
2015-12-25 19:37:34 +09:00
Hiroyuki Ikezoe
cf03d3bfaf Bug 1235286 - Part 1: Add an argument to waitForAnimationFrames to run a task in each requestAnimationFrame callback. r=birtles
--HG--
extra : transplant_source : %AF%A0%20%B8%D7%3A%7F%C2_y%0A%82%88w%5E%95%8D%17%EA%EF
2016-01-08 09:49:04 +09:00
Hiroyuki Ikezoe
33ce2fba3e Bug 1240646 - Do not unthrottle animations if RestyleType::Throttled is specified. r=bbirtles 2016-01-18 20:54:00 +01:00
Brian Birtles
b47411b097 Bug 1240228 - Don't update an effect's timing when tweaking its animation's hold time; r=heycam
In some circumstances when composing style, we tweak the time of the animation
before telling the effect to compose style. This is to avoid visual flicker in
certain situations where the main thread progress is being synchronized with an
animation running on the compositor.

In the past, effects would store their latest sample time locally so when
tweaking the animation time, we would need to call UpdateEffect() after tweaking
the time, and then again after restoring it as otherwise the style composed by
the effect would not reflect the adjusted time.

Now, however, effect's always query their animation for the time so this is no
longer necessary. Furthermore, the actions triggered by UpdateEffect are not
desirable in this case because they can, amongst other things, cause the
associated EffectSet to be destroyed and recreated.

Specifically, Animation::UpdateEffect() calls
KeyframeEffectReadOnly::NotifyAnimationTimingUpdated() which:

  * Calls UpdateTargetRegistration which can trigger EffectSet
    destruction/creation which is undesirable in this case because we intend to
    restore whatever changes we make to the Animation's state and deleting and
    recreating the EffectSet will cause any pointers to it to dangle.

  * Cause us to possibly reset the "is running on compositor" status.
    This too is undesirable since we intend to restore the state of the
    Animation immediately after tweaking the hold time so we don't want to
    act as if any state has changed.

  * Similarly for marking the cascade as possibly needing an update or
    requesting a restyle.

In summary, all the actions performed by NotifyAnimationTimingUpdated are
unnecessary and undesirable in this situation where we are temporarily tweaking
an Animation's current time only to restore it immediately afterwards since the
actions are all involved with recognizing actual changes in state.
2016-01-19 08:05:08 +09:00
Brian Birtles
54283ba569 Bug 1226091 - Use MayHaveAnimations flag for animations on pseudo elements too; r=smaug 2016-01-18 13:40:12 +09:00
Hiroyuki Ikezoe
54e83307e3 Bug 1096774 - Part 2: Fix crash if animation has no timeline. r=birtles 2016-01-14 19:27:00 -05:00
Hiroyuki Ikezoe
4c0263a3ed Bug 1096774 - Part 1: Implement Animation Constructor. r=birtles, r=smaug 2016-01-16 19:02:00 -05:00
Brian Birtles
6fb8992111 Bug 1235112 - Move animation style rule processors to EffectCompositor; r=heycam 2016-01-15 15:15:47 +09: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
a44af735dd Bug 1237467 part 3 - Add debug methods to determine if an EffectSet is currently being enumerated; 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
Brian Birtles
a22e719c48 Bug 1237467 part 1 - No longer mark element as needing an animation restyle if we go to restyle it and it no longer has an effect set; 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
d03ac9c993 Bug 1214536 - Part 6: Revise AnimationTiming::operator==. r=birtles 2016-01-13 18:38: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
02e4c93ce9 Bug 1234095 - Rework sorting to handle to script-generated animations; r=heycam 2016-01-14 10:24:24 +09:00
Brian Birtles
32bf08d255 Bug 1235112 - Move animation style rule processors to EffectCompositor; r=heycam 2016-01-14 08:02:39 +09:00
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
0653a5b314 Bug 1237467 part 3 - Add debug methods to determine if an EffectSet is currently being enumerated; 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
cf3c7d444e Bug 1237467 part 1 - No longer mark element as needing an animation restyle if we go to restyle it and it no longer has an effect set; 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
d549991eb2 Bug 1232577 part 19 - Move ClearIsRunningOnCompositor to EffectCompositor; r=heycam 2016-01-13 07:54:56 +09:00
Brian Birtles
7236a7fdbd Bug 1232577 part 18 - Drop RestyleManager::mLastUpdateForThrottledAnimations; r=heycam
RestyleManager currently has a piece of state for tracking if throttled
animations are up-to-date or not. Actually, it's not so much about throttled
animations but really about outstanding changes to animation styles (which
is typically expected to be due to throttling animations but there are
other cases that invalidate the animation style rule that we should be
considering here).

We now have that same information stored in the EffectCompositor so we can
remove the redundant state from RestyleManager. Furthermore, the state stored
in EffectCompositor is more accurate since it captures the case when animation
style needs to be updated twice within a tick, or when nothing needs to be
updated within a tick.

This patch, therefore, introduces EffectCompositor::HasPendingStyleUpdates in
place of setting RestyleManager::mLastUpdateForThrottledAnimations.

nsTransitionManager also uses mLastUpdateForThrottledAnimations to warn if we
have not processed throttled animations. We can't use HasPendingStyleUpdates
here however, since it will return true in the case where we have triggered new
transitions in the process of restyling. However, any new transitions will
trigger "standard" (i.e. not throttled) restyles so we introduce another
method, HasThrottledStyleUpdates, that returns true only if we have outstanding
throttled updates and use this for the warning inside nsTransitionManager.
2016-01-13 07:54:55 +09:00
Brian Birtles
dab2f9c064 Bug 1232577 part 17 - Move AddStyleUpdatesTo to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles
309027bbe9 Bug 1232577 part 16 - Move GetAnimationRule to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles
7a8bb45336 Bug 1232577 part 15 - Drop LastStyleUpdateForAllAnimations flag from pres context; r=heycam
nsPresContext contains a mLastStyleUpdateForAllAnimations flag which is simply
used to prevent unnecessarily posting restyles when throttled animations are
already up to date. Since part 13 we now accurately record whether we have
posted a restyle for each throttled animation and only post a restyle if we
have not done so already. As a result, this flag is no longer needed since
calling PostRestyleForThrottledAnimations is effectively a noop when throttled
animations are up-to-date.
2016-01-13 07:54:55 +09:00
Brian Birtles
b65c8d2610 Bug 1232577 part 14 - Move FlushAnimations to EffectCompositor; r=heycam 2016-01-13 07:54:55 +09:00
Brian Birtles
c54edbe389 Bug 1232577 part 13 - Move EnsureStyleRuleFor from AnimationCollection to EffectCompositor 2016-01-13 07:54:55 +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
b29e0fc6c2 Bug 1232577 part 10 - Remove AnimationCollection::mStyleChanging; r=heycam
This flag is no longer needed because in bug 1232563 we introduced a more
thorough optimization that detects when the animation is not changing by
comparing the progress value between samples and avoids requesting restyles
when it does not change.
2016-01-13 07:54:54 +09:00
Brian Birtles
71a9cf43cb Bug 1232577 part 9 - Remove AnimationCollection::mStyleRuleRefreshTime; r=heycam
Now that we track whether or not animations are up to date using the hashset in
EffectCompositor, we can remove the mStyleRuleRefreshTime flag that is, as of
part 5 of this patch series, now only used for detecting whether or not
animations are up to date.

In order to preserve the existing behavior of FlushAnimations, however, this
patch temporarily introduces a method to indicate if there are throttled
animations or not.

It might not be obvious that FlushAnimations is only concerned with throttled
animations due to its name. FlushAnimations is simply intended to post
animation restyles for out-of-date animations. Any animations that are *not*
throttled will either be up to date, or we will have already posted an
animation restyle so we only need to consider throttled animations in this case.
2016-01-13 07:54:54 +09:00
Brian Birtles
cf26e7b69b Bug 1232577 part 8 - Move call to PostRestyleForAnimation to EffectCompositor; r=heycam
This patch continues to migrate functionality from
AnimationCollection::RequestRestyle to EffectCompositor::RequestRestyle.

In order to post the animation restyle from the EffectCompositor, this patch
also moves the PostRestyleForAnimation method to EffectCompositor.
The GetElementToRestyle method is temporarily duplicated in both
EffectCompositor and AnimationCollection however we will remove the version in
AnimationCollection later in this patch series.
2016-01-13 07:54:54 +09:00
Brian Birtles
21108e5e2e Bug 1232577 part 7 - Move call to SetNeedStyleFlush() to EffectCompositor::RequestRestyle; r=heycam
In this patch series we are gradually migrating style rule updating
functionality from AnimationCollection to EffectCompositor. This patch moves
part of the RequestRestyle method from one class to the other.

Note that in both cases we only call SetNeedsStyleFlush if we haven't already
posted an animation restyle. (In the case of AnimationCollection we check this
using the mHasPendingAnimationRestyle flag, and in EffectCompositor case we
simply check if the element is already in the "needs restyle" hashmap. If it is,
either we already have a throttled restyle and have called SetNeedsStyleFlush or
we have a standard restyle and have posted an animation restyle.)

The added check for a null pres context matches the behavior of
AnimationCollection::RequestRestyle which has an equivalent early return at the
beginning of the function.
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
a0f05d7d7e Bug 1232577 part 2 - Add a hashmap to ElementCompositor to track which (pseudo-) elements need to have their animation style rule updated; r=heycam
We will eventually use this in place of the various state flags stored on
AnimationCollection (e.g. mStyleRuleRefreshTime, mStyleChanging,
mHasPendingAnimationRestyle) as well as to do a more targetted update in
FlushAnimations and AddStyleUpdatesTo.
2016-01-13 07:54:53 +09:00
Brian Birtles
641025e212 Bug 1232577 part 1 - Add EffectCompositor as a member of nsPresContext; r=heycam
Since we want to track elements needing a restyle on EffectCompositor we need
to scope it to an nsPresContext rather than just making if a collection of
static methods.
2016-01-13 07:54:53 +09:00
Shirotaka_Pro
f271c4587b Bug 1179627 - Part 2: Add animation.id for CSS animations test files. r=bbirtles, r=hiikezoe 2015-12-21 11:02:21 +09:00
N.Shimizu
9c1354440b Bug 1179627 - Part 1: Implement Animation.id. r=smaug, r=birtles 2016-01-08 03:17:00 -05:00
Hiroyuki Ikezoe
4d993b1ed3 Bug 1212720 - Part 4: Remove all cancelAllAnimationsOnEnd. It is not needed any more. r=bbirtles
--HG--
extra : histedit_source : 1470ef2dfe10559b5761c6eb6a384a610d883718
2015-12-22 00:50:00 -05:00
Hiroyuki Ikezoe
c1f10eb765 Bug 1212720 - Part 3: Remove AnimationTimeline.getAnimations. r=heycam, r=smaug
--HG--
extra : histedit_source : 3b036799886ebcc8498d495346eae963a5b5863d
2015-12-21 20:39:00 -05:00
Hiroyuki Ikezoe
cd2f747a36 Bug 1212720 - Part 2: Tests for document.getAnimations. r=heycam
--HG--
rename : dom/animation/test/css-animations/file_timeline-get-animations.html => dom/animation/test/css-animations/file_document-get-animations.html
rename : dom/animation/test/css-animations/test_timeline-get-animations.html => dom/animation/test/css-animations/test_document-get-animations.html
rename : dom/animation/test/css-transitions/file_timeline-get-animations.html => dom/animation/test/css-transitions/file_document-get-animations.html
rename : dom/animation/test/css-transitions/test_timeline-get-animations.html => dom/animation/test/css-transitions/test_document-get-animations.html
2016-01-06 14:22:00 -05: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
d0ad270eef Bug 1232563 part 1 - Request a layer update if an animation is newly finished; r=heycam
When requesting restyles we take special care to detect when an animation has
newly finished so we perform the necessary restyle to represent the fill state.
However, we should really explicitly pull the animation off the layer at this
point by requesting a layer update. (That is, when an animation is
newly-finished we should use RestyleType::Layer instead of
RestyleType::Standard. Currently we just use RestyleType::Standard.)

In this bug we plan to move restyle requests down to the effect (since it is
the *effect* that is restyled). However, only the Animation has the notion of
"finished" or not so we detect this particular case in the Animation and
request the layer update there. We already request layer updates in the
Animation for other situations such as pausing so doing *layer* updates in the
Animation and regular restyles in the effect is not inconsistent.

This patch also tweaks test_animations_omta.html since it was previously
erroneously testing that a finished animation was still running on the
compositor.

--HG--
extra : rebase_source : 3cd1abe2a10370e90cde64b4b42b27326082f6f0
2016-01-06 11:04:06 +09:00
Brian Birtles
0d628b2a55 Bug 1232561 part 4 - Add EffectCompositor::ComposeAnimationRule; r=heycam
This patch just moves a piece of functionality from
AnimationCollection::EnsureStyleRuleFor to the EffectCompositor. In subsequent
bugs we will move more and more of this functionality across until this
logic is fully contained in the EffectCompositor.

--HG--
extra : rebase_source : 7ffe91adb4ca3d57fc8f6ae3f7e5f7bec91f350b
2016-01-06 11:04:06 +09:00
Brian Birtles
f4eeb573d0 Bug 1232561 part 3 - Move AnimValuesStyleRule to a separate file; r=heycam
As we gradually move logic from layout/style/AnimationCommon.cpp to
dom/animation/EffectSet and EffectCompositor it makes sense to let this class
live in its own file inside dom/animation where it is used.

--HG--
extra : rebase_source : aed0632a19800e0ef9d8fe1d03d0364bf1ccc4dc
2016-01-06 11:04:06 +09:00
Brian Birtles
a736eafacc Bug 1232561 part 2 - Move the animation style rules from AnimationCollection to EffectSet; r=heycam
This is needed in order to support script-generated animations since they do not
belong to any AnimationCollection.

This patch adopts the naming "animation rule" over "style rule". Currently we
are inconsistent about this (e.g. GetAnimationRule vs EnsureStyleRuleFor).
We don't do a mass rename here but just a few places near where we're touching.
Many of the other references to "style rule" will be revised in this bug or
related bugs so we can fix those references when we come to them.

--HG--
extra : rebase_source : e1f824029b39960915e056328447de256b6c1c6d
2016-01-06 11:04:06 +09:00
Brian Birtles
cb3f0f2256 Bug 1232561 part 1 - Replace AppliesToTransitionsLevel() with a cascade level enumeration; r=heycam
Introducing an enum will simplify further patches in this series by providing
a common vocabulary for this distinction.

--HG--
extra : rebase_source : 4afbd358a401853df3ad401f2b1c3454ccff26cd
2016-01-06 11:04:05 +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
Brian Birtles
bf9f389bda Bug 1228229 part 11 - Avoid calling nsRuleNode::ComputePropertiesOverridingAnimation when there are no compositor-animatable properties; r=dbaron
This restores the code removed in part 3 but adjusts it to iterate over
an effect set instead of an AnimationCollection. It also adds an early return
for the case where no compositor-animatable properties are found.

--HG--
extra : rebase_source : 5e73374c8fb7df4e946f73512337a55f5dae94f2
2016-01-06 11:04:05 +09:00
Brian Birtles
741d976ea1 Bug 1228229 part 10 - Remove no-longer-used cascade functions; r=dbaron
--HG--
extra : rebase_source : 3cdff84fefbc24796abf2d765f6f40062dd7941f
2016-01-06 11:04:05 +09:00
Brian Birtles
96f4a19af3 Bug 1228229 part 9 - Use EffectCompositor::UpdateCascadeResults; r=dbaron
--HG--
extra : rebase_source : c294befb9b57564f17c9c22d8fc0f37e7792eaed
2016-01-06 11:04:05 +09:00
Brian Birtles
f14f3a2be8 Bug 1228229 part 8 - Add EffectCompositor::(Maybe)UpdateCascadeResults; r=dbaron
--HG--
extra : rebase_source : 7f87c5a33e153e0815d39b7eb21917f3c034c0d3
2016-01-06 11:04:05 +09:00
Brian Birtles
144a09f431 Bug 1228229 part 7 - Add a method to Animation to indicate if it applies to the transitions level of the cascade; r=dbaron
For transitions, this method returns true so long as the transition is
bound to markup. This is based on the below discussion,

  https://github.com/w3c/web-animations/issues/97
  https://github.com/w3c/web-animations/issues/62#issuecomment-117357703
  https://github.com/w3c/web-animations/issues/62#issuecomment-117374689

We will likely reuse this method when we come to implement animation style rule
generation in a more generic manner.

--HG--
extra : rebase_source : fe8a3d09296d7f74cabd59c605cf568d200bb240
2016-01-06 11:04:05 +09:00
Brian Birtles
265cbb47a5 Bug 1228229 part 6 - Mark the animation cascade results as dirty when an effect goes in or out of being "in effect"; r=dbaron
This patch implements "case 2" described in the commit message from part 4 of
this patch series.

--HG--
extra : rebase_source : 805f24376fa4648f094fb04247d48d075a73400c
2016-01-06 11:04:05 +09:00
Brian Birtles
5331e1fa91 Bug 1228229 part 5 - Separate target element registration in NotifyAnimationTimingUpdated; r=dbaron
KeyframeEffectReadOnly::NotifyAnimationTimingUpdated currently just acts as an
alias for UpdateTargetRegistration. However, bug 1226118 added logic to
UpdateTargetRegistration which is not strictly related to updating the target
element registration. This patch tidies this up so that UpdateTargetRegistration
only does what its name suggests. This is in preparation for adding more
logic to NotifyAnimationTimingUpdated.

--HG--
extra : rebase_source : c6162e8415613d7ec16744228d7cf498b4c19e2c
2016-01-06 11:04:04 +09:00
Brian Birtles
c773cf7551 Bug 1228229 part 4 - Add a flag to EffectSet to mark when the cascade needs to be updated; r=dbaron
There are three situations when the cascade results of effects needs to be
updated.

1. The sets of effects (animations) has changed.

2. One or more effects have changed their "in effect" status.

3. Other style properties affecting the element have changing meaning that
   animations applied at the animations-level of the cascade may now be
   overridden or become active again.

We want to detect these situations so we can avoid updating the cascade when
none of these possibilities exist.

Currently we handle case 1 by calling UpdateCascadeResults at the appropriate
point in nsAnimationManager and nsTransitionManager when we build
animations/transtiions.

Case 2 only affects animations (since whether transitions are in effect or not
makes no difference to the cascade--they have a lower "composite order" than
animations and never overlap with each other so they can't override anything).
As a result, we handle it by adding a flag to CSSAnimation to track when an
animation was in effect last time we checked or not.

For case 3, we take care to call UpdateCascadeResults when the style context
changed in nsAnimationManager::CheckAnimationRule (called from
nsStyleSet::GetContext).

We want to generalize this detection to handle script-generated animations too.
In order to do that this patch introduces a flag to EffectSet that we will use
to mark when the cascade needs to be updated in cases 1 and 2. This patch also
sets the flag when we detect case 1. A subsequent patch sets the flag for
case 2.

Case 3 is more difficult to detect and so we simply maintain the existing
behavior of making nsAnimationManager::CheckAnimationRule unconditionally
update the cascade without checking if the "needs update" flag is set.

--HG--
extra : rebase_source : fc56b1bb5a98ae78b93a179c7a3b8af4724a06a1
2016-01-06 11:04:04 +09:00
Brian Birtles
114b1e3ebd Bug 1228229 part 3 - Factor out a method to get compositor-animatable overridden properties; r=dbaron
This patch also simplifies this logic by simply always looking for overrides of
'transform' and 'opacity'.

--HG--
extra : rebase_source : d1e432e629e2b97651f14c784f97c03f55d217be
2016-01-06 11:04:04 +09:00
Brian Birtles
5d5fb26344 Bug 1228229 part 2 - Add a helper to get the appropriate (pseudo-)element for a frame; r=dbaron
We will use similar logic later in this patch series so we separate it out into
a separate helper function here.

--HG--
extra : rebase_source : 00cb49e7829bdef7a6084059b31fe2ef4b921af5
2016-01-06 11:04:04 +09:00
Hiroyuki Ikezoe
14a9ac51e5 Bug 1218646 - Skip to check whether property can run on compositor or not if mWinsInCascade is false. r=birtles
--HG--
extra : commitid : EEO5SsbNCyo
2015-12-25 07:14:02 +09:00
Brian Birtles
98bde3e131 Bug 1232829 - Detach obsolete DocumentTimeline from refresh driver when the document is reset; r=smaug 2015-12-22 10:08:19 +09:00
Hiroyuki Ikezoe
f36ff3beb0 Bug 1219543 - Part 3: MutationObserver should disconnect when the test is finished. r=bbirtles 2015-12-20 14:18:00 +01:00
Hiroyuki Ikezoe
1ffc0c63ea Bug 1219543 - Part 1: isRunningOnCompositor flag is now a member of AnimationProperty. r=bbirtles 2015-12-20 14:16:00 +01:00
Brian Birtles
c70be15294 Bug 1230056 part 1 - Add EffectCompositor::HasAnimationsForCompositor; r=dholbert 2015-12-09 16:28:10 -05:00
Bogdan Postelnicu
a32d8ac57a Bug 1231107 - add an assert on animationProperty. r=heycam 2015-12-08 05:13:00 +01:00
Brian Birtles
3cd1347f35 Bug 1226118 part 15 - Remove no-longer-necessary delays from test_running_on_compositor.html; r=hiro
Since part 3 in this patch series updated the way we clear the "running on
compositor" flag, we can update these tests so they no longer wait for this
flag (see bug 1226118 comment 21).
2015-12-04 08:34:18 +09:00
Brian Birtles
f82ce867cf Bug 1226118 part 12b - Rename CommonAnimationManager::GetAnimations to GetAnimationCollection; r=dholbert
This is to align with the existing GetAnimationCollection method that takes
a frame. Also, by making this name more specific hopefully it will be used less
since we are trying to move as much code as possible over to using EffectSet
instead of AnimationCollection.
2015-12-04 08:34:17 +09:00
Brian Birtles
7806ce3d5d Bug 1226118 part 8 - Add EffectCompositor::GetAnimationsForCompositor that uses the EffectSet rather than AnimationCollection; r=dholbert
This added method should behave in an equivalent manner to the existing
CommonAnimationManager::GetAnimationsForCompositor except for the following
differences:

* It uses the EffectSet attached to a target element rather than one of the
  AnimationCollection object on the owning element.

* It returns an array of Animation objects consisting of only those Animations
  that actually have the specified property as opposed to the
  AnimationCollection consisting of *all* CSS animations or *all* CSS
  transitions for the element regardless of whether they run on the compositor
  or not.

It may not be obvious why these two methods otherwise behave in an equivalent
fashion so the following explains how the existing code is mirrored in the new
method.

The existing code is as follows:

> AnimationCollection*
> CommonAnimationManager::GetAnimationsForCompositor(const nsIFrame* aFrame,
>                                                    nsCSSProperty aProperty)
> {
>   AnimationCollection* collection = GetAnimationCollection(aFrame);
>   if (!collection ||
>       !collection->HasCurrentAnimationOfProperty(aProperty) ||
>       !collection->CanPerformOnCompositorThread(aFrame)) {
>     return nullptr;
>   }
>
>   // This animation can be done on the compositor.
>   return collection;
> }

The new EffectCompositor::GetAnimationsForCompositor begins with two checks
performed at the beginning of CanPerformOnCompositorThread: the checks for
whether async animations are enabled or not and whether the frame has refused
async animations since these are cheap and it makes sense to check them first.

The next part of EffectCompositor::GetAnimationsForCompositor checks if there is
an EffectSet associated with the frame. This is equivalent to the check whether
|collection| is null or not above.

Following, we iterate through the effects in the EffectSet.

We first check if each effect is playing or not. In the above code,
HasCurrentAnimationOfProperty only checks if the effect is *current* or not.
However, CanPerformOnCompositorThread will only return true if it finds an
animation that can run on the compositor that is *playing*. Since playing is
a strict subset of current we only need to perform the more restrictive test.

Next we check if the effect should block running other animations on the
compositor. This is equivalent to the remainder of CanPerformOnCompositorThread.
Note that the order is important here. Only playing animations should block
other animations from running on the compositor. Furthermore, this needs to
happen before the following step since animations of property other than
|aProperty| can still block animations from running on the compositor.

Finally, we check if the effect has an animation of |aProperty|. This is
equivalent to the remainder of HasCurrentAnimationOfProperty.

If all these checks succeed, we add the effect's animation to the result to
return.
2015-12-04 08:34:12 +09:00
Brian Birtles
40c6c207b0 Bug 1226118 part 7 - Rename and rework KeyframeEffectReadOnly::CanAnimatePropertyOnCompositor to ShouldBlockCompositorAnimations; r=hiro
KeyframeEffectReadOnly::CanAnimatePropertyOnCompositor has a comment that says
it, "Returns true |aProperty| can be run on compositor for |aFrame|" but it
does nothing of the sort.

What it *does* do is check answer the question, "If there happened to be an
animation of |aProperty| on |aFrame|, should we still run animations on the
compositor for this element?".

This patch renames the method accordingly and moves the step where we iterate
over a given effect's animated properties from
AnimationCollection::CanPerformOnCompositor to inside this method, making this
method a class method rather than a static method at the same time.

As noted in the expanded comment, the approach of blocking opacity animations
in these situations seems unnecessary but for now this patch just preserves the
existing behavior.
2015-12-04 08:32:53 +09:00
Brian Birtles
fd98de719c Bug 1226118 part 5 - Move LogAsyncAnimationFailure to AnimationUtils; r=dholbert
This patch also moves AnimationUtils out of the dom namespace since it seems
unnecessary. We typically only put actual DOM interfaces in the dom namespace.
2015-12-04 08:32:53 +09:00
Brian Birtles
a92b5ec6ab Bug 1226118 part 3 - Use EffectSet in CommonAnimationManager::ClearIsRunningOnCompositor; r=hiro, r=dholbert 2015-12-04 08:32:53 +09:00
Brian Birtles
5ea3caedb7 Bug 1226118 part 1 - Add EffectSet::GetEffectSet(const nsIFrame*); r=dholbert 2015-12-04 08:32:52 +09:00
Brian Birtles
cf420be127 Bug 1225699 part 7 - Keep effect properties when the ownerDocument of the element changes; r=smaug 2015-11-26 16:53:54 +09:00
Brian Birtles
4a1f1632e9 Bug 1225699 part 6 - Use strong refs to store effects on their target elements; r=smaug
This is so that when we have code like:

  elem.animate({ opacity: 0 }, 1000)

the resulting Animation object is kept alive by |elem| based on the following
ownership chain:

  elem --(strong)--> KeyframeEffectReadOnly --(strong)--> Animation

Now, there is an ownership cycle introduced here because KeyframeEffectReadOnly
objects also store owning references to their target elements. This is broken
when the Animation finishes (if it does not fill forwards) or is cancelled
since either event will trigger a call to
KeyframeEffectReadOnly::UpdateTargetRegistration.

If the Animation fills forwards, the resource will not be released until
it is cancelled. For Animations corresponding to CSS Animations / CSS
Transitions this happens when the Element is unbound or when the corresponding
style property is updated causing the animation to be replaced or removed.

For the general case of script-generated animations, however, this cycle won't
be broken until the Element is unbound and all external references to the
Animation or KeyframeEffectReadOnly are dropped.

It's unfortunate that we can't more aggressively prune these objects but it's
what the spec currently says. I've posted to the mailing list[1] about this but
have yet to find a good solution.

[1] https://lists.w3.org/Archives/Public/public-fx/2015OctDec/0029.html
2015-11-26 16:53:54 +09:00
Brian Birtles
fd320ec088 Bug 1225699 part 5 - Use EffectSet in Element::GetAnimations; r=heycam 2015-11-26 16:53:53 +09:00
Brian Birtles
0d264e1081 Bug 1225699 part 4 - Add iterator to EffectSet; r=heycam 2015-11-26 16:53:53 +09:00
Brian Birtles
4f3db8cf45 Bug 1225699 part 3 - Register and unregister effects with elements; r=smaug, r=heycam 2015-11-26 16:53:53 +09:00
Brian Birtles
ac5c423799 Bug 1225699 part 2 - Add Add/RemoveEffect to EffectSet; r=smaug 2015-11-26 16:53:53 +09:00
Brian Birtles
9400c59793 Bug 1225699 part 1 - Add EffectSet class; r=smaug 2015-11-26 16:53:53 +09:00
Boris Chiou
af6590f3dd Bug 1215406 - Part 5: Implement KeyframeEffectOptions in KeyframeEffectReadOnly constructor. r=birtles
Implement KeyframeEffectOptions in KeyframeEffectReadOnly constructor and other
related APIs.
2015-11-19 19:48:00 +01:00
Boris Chiou
fe6df692e1 Bug 1215406 - Part 3: Change the types of direction and fillmode in AnimationTiming. r=heycam
Use mozilla::dom::FillMode and mozilla::dom::PlaybackDirection
in AnimationTiming.

--HG--
extra : rebase_source : 8210d002d6f116793f439d88b0325ab6fb880048
2015-11-20 06:12:00 +01:00
Randall Barker
3fbfbb9aeb Bug 1226193 - Fix test_animation_observers.html timing out on Fennec with C++APZ enabled. r=heycam
Fix: INFO TEST-UNEXPECTED-FAIL | dom/animation/test/chrome/test_animation_observers.html | Test timed out.
By extending animation observer timeout.

--HG--
extra : commitid : GEfsdBOqqsu
2015-11-19 23:06:43 -05:00
Hiroyuki Ikezoe
1e734eff34 Bug 1223255 - Use Animation::AnimationTimeToTimeStamp instead of timeline->ToTimeStamp. r=bbirtles
Otherwise delay value is multiplied by playbackRate twice.

--HG--
extra : rebase_source : 42b088e65c2ce3986bc36fa1c41a06e38f1c133a
2015-11-18 01:50:00 +01:00
Olli Pettay
f50a8c0983 Bug 1223445 - KeyframeEffectReadOnly objects end up keeping lots of other objects alive too long, r=birtles
--HG--
extra : rebase_source : df6828ce26e22e53b632f25952fd1741a693c36a
2015-11-16 19:44:55 +02:00
Hiroyuki Ikezoe
194d123d2a Bug 1216030 - Part 18: Remove IsCurrent() check in assertion in CanThrottle. r=bbirtles
The behavior of unthrottling in case of not current animations there is the
same as on current trunk.
There are two cases to reach there I can think of:

a) 0s duration time and fill-forwards animation
b) Calling pause() after fill-forwards animation finished.

I can provide these automation tests once bug 1222326 is fixed.
2015-11-06 02:57:00 +01:00
Hiroyuki Ikezoe
383ef0ab14 Bug 1216030 - Part 17: Do not calculate unthrottle interval for transform animation every time. r=bbirtles 2015-11-06 02:55:00 +01:00
Hiroyuki Ikezoe
325530125c Bug 1216030 - Part 16: Move CanThrottleAnimation and CanThrottleTransformChanges from AnimationCollection into KeyframeEffectReadOnly::CanThrottle. r=bbirtles
The preference check has been removed from CanThrottleTransformChanges
because we already perform that check that when deciding if we should run
an animation on the compositor (in CanPerformOnCompositorThread, as called
by GetAnimationsForCompositor). Hence if the "is running on compositor" flag
is true, we can assume the preference is set (or was set when we decided to
put the animation on the compositor-- we don't worry about pulling the
animation off the compositor immediately if the preference changes while
it is running)
2015-11-06 02:53:00 +01:00
Hiroyuki Ikezoe
6e809a002a Bug 1216030 - Part 15: Add KeyframeEffectReadOnly::GetCollection. r=bbirtles 2015-11-06 02:53:00 +01:00