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

290 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
Bogdan Postelnicu a32d8ac57a Bug 1231107 - add an assert on animationProperty. r=heycam 2015-12-08 05:13:00 +01: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 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 4f3db8cf45 Bug 1225699 part 3 - Register and unregister effects with elements; r=smaug, r=heycam 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
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
Hiroyuki Ikezoe ac66eb2736 Bug 1216030 - Part 14: Add KeyframeEffectReadOnly::GetPresContext and KeyframeEffectReadonly::GetRenderedDocument. r=bbirtles 2015-11-06 02:51:00 +01:00
Hiroyuki Ikezoe d1085f09b0 Bug 1216030 - Part 11: Add KeyframeEffect::CanAnimatePropertyOnCompositor. r=bbirtles
Based on AnimationCollection::CanAnimatePropertyOnCompositor.
The first argument has been changed to nsIFrame* so that we don't need to
get style frame for CanAnimateTransformOnCompositor again.
2015-11-06 02:45:00 +01:00
Hiroyuki Ikezoe 6f7b96040d Bug 1216030 - Part 8.5: Animation::CanThrottle() should check that all animation properties are running on compositor. r=bbirtles
If this patch (and part 9) is an overkill to throttle animations having both
of properties, one can be run on compositor and another can not be, a test
case in test_running_on_compositor[1] will fail.
The test case is for an animation which has transform and background-color
properties.

Animation::CanThrottle() returns true
  (then, AnimationCollection::CanPerformOnCompositorThread() returns false)
  on current trunk in the test case.
Animation::CanThrottle() returns false with this patch in the test case.

If the test passes, it proves the transform animation is running on compositor
in both cases.

[1] http://hg.mozilla.org/mozilla-central/file/6c7c983bce46/dom/animation/test/chrome/test_running_on_compositor.html#l77
2015-11-06 02:49:00 +01:00
Hiroyuki Ikezoe 5d5a2aa878 Bug 1216030 - Part 8: Add KeyframeEffectReadOnly::GetAnimationFrame. r=bbirtles
This method will be used in KeyframeEffectReadOnly::CanThrottle to get
appropriate target frame for animation.
2015-11-06 02:42:00 +01:00
Hiroyuki Ikezoe 84322d36f1 Bug 1216030 - Part 6: Add KeyframeEffectReadOnly::IsGeometricProperty. r=bbirtles
This method will be private soon.
2015-11-06 02:38:00 +01:00
Hiroyuki Ikezoe 74c73fa482 Bug 1216030 - Part 5: Add KeyframeEffectReadOnly::CanAnimateTransformOnCompositor. r=bbirtles
This method will be private soon.
2015-11-06 02:38:00 +01:00
Boris Chiou 7203e534eb Bug 1208940 - Move ComputedTimingFunction to its own file. r=bbirtles 2015-11-01 22:41:00 +01:00
Boris Chiou 2c0d38d0d8 Bug 1108055 - Part 3: Implement GetComputedTiming method. r=birtles
Implement KeyframeEffectReadOnly::GetComputedTiming().

--HG--
extra : rebase_source : eae0dc0887bf559924ad96cead438d0e7eab9081
2015-10-23 00:48:00 +02:00
Boris Chiou b2d9321540 Bug 1108055 - Part 2: Refine ComputedTiming. r=birtles
Do some minor revisions in struct ComputedTiming.
1. Use Nullable<double> mProgress, so remove the static const kNullProgress.
   The generated ComputedTimingProperties dictionary uses "Nullable" variable,
   so we replace the origin type in ComputedTiming to make it more consistent
   with that in ComputedTimingProperties dictionary.
2. Use scoped enums for AnimationPhase.

--HG--
extra : rebase_source : 31280c867a30e7bcdcfe831cbc72ca08c8ddc762
2015-10-19 00:38:00 +02:00
Cameron McCormack bce3927621 Bug 1216872 - Make 100% Keyframe returned by getFrames() have easing:linear. r=birtles 2015-10-22 19:22:38 +11:00
Cameron McCormack 44142b120c Bug 1208951 - Part 10: Make GetFrames aware of initial/final zero-length segments and discontinuities between segments. r=birtles 2015-10-22 19:22:38 +11:00
Cameron McCormack 235db06383 Bug 1208951 - Part 9: Implement KeyframeEffectReadOnly constructor. r=bzbarsky r=birtles 2015-10-22 19:22:38 +11:00
Cameron McCormack 50c4eb3b78 Bug 1208951 - Part 2: Use a comparator object instead of operator< on KeyframeValueEntry. r=birtles 2015-10-22 19:22:37 +11:00
Cameron McCormack b746909966 Bug 1208951 - Part 1: Split half of KeyframeValueEntry into a base class. r=birtles
In a subsequent patch, we will have another struct like
KeyframeValueEntry, but storing an StyleAnimationValue and an
ComputingTimingFunction object (not a pointer).  So we split
KeyframeValueEntry into two, retaining the KeyframeValueEntry name for
the base class and naming the current one KeyframeStringValueEntry.
2015-10-22 19:22:37 +11:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Brian Birtles ad657213b1 Bug 1208385 part 2 - Remove stored parent time from KeyframeEffectReadOnly and get the time directly from the owning animation; r=heycam 2015-10-07 14:30:28 +09:00
Brian Birtles d89f0d836b Bug 1208385 part 1 - Store a pointer to the owning animation on each KeyframeEffect; r=heycam
We need to do this so effects can query their owning animation for the current
time and avoid falling out of sync. Furthermore, this pointer is needed
for a number of other bugs (e.g. bug 1166500 comment 12, or bug 1190235)
anyway.
2015-10-07 14:30:27 +09:00
Brian Birtles 08a8534ec0 Bug 1208385 part 0 - Fix up some references to Web Animations spec; r=heycam 2015-10-07 14:30:27 +09:00
Cameron McCormack c2e4c54592 Bug 1198708 - Part 6: Implement KeyframeEffectReadOnly.getFrames(). r=birtles,bzbarsky
Since getFrames() must gather all properties set at a given keyframe
offset time for a given easing function, we need to provide a total
ordering for ComputedTimingFunction objects.  Until the spec defines how
to do this, we sort first by NS_STYLE_TRANSITION_TIMING_FUNCTION_*
value, then second by the four values in a cubic-bezier() function (in
order) or the integer and optional keyword in a steps() function.

Because we don't support automatic spacing of keyframes yet,
ComputedKeyFrame.computedOffset is always the same as Keyframe.offset.

Another assumption made is that the value of easing for a Keyframe
object at 100% should be the same as the value from the previous
Keyframe for the same property.  An alternative would be to leave off
easing from that Keyframe, which would need the default value for that
IDL dictionary member removed (otherwise it would always be set to
"linear").
2015-09-29 12:20:14 +10:00
Cameron McCormack 45eb434b3e Bug 1198708 - Part 5: Add method to serialize a ComputedTimingFunction. r=birtles 2015-09-29 12:20:14 +10:00
Cameron McCormack 9293060eef Bug 1198708 - Part 1: Store exact timing-function type on nsTimingFunction and ComputedTimingFunction. r=birtles
Since Keyframe.easing should reflect the {transition,animation}-timing-
function value relevant to each keyframe, we'll need to store on
nsTimingFunction the specific timing function value that was used, and
copy it down into ComputedTimingFunction for
KeyframeEffectReadOnly.getFrames() to access.  This includes storing
whether the optional start/end keyword in a steps() function was
specified.
2015-09-29 12:20:13 +10:00
Hiroyuki Ikezoe 41ec8da9f3 Bug 1151694 - Part 3: Manage mIsRunningOnCompositor flags for each properties respectively. r=bbirtles
--HG--
extra : rebase_source : d189d779ef14e8ae5497b03b01e3d4d994803fe1
2015-09-16 16:05:00 +02:00
Hiroyuki Ikezoe a4077879ac Bug 1194028 - Part 1: Implement Animation NotifyEffectTimingUpdate and KeyframeEffect SetTiming. r=bbirtles 2015-08-17 14:28:00 -04:00
Brian Birtles f5d2835cea Bug 1181392 part 3 - Remove use of IsFinishedTransition in KeyframeEffectReadOnly; r=dbaron
KeyframeEffectReadOnly uses IsFinishedTransition to exclude finished transitions
from certain tests. This check, however, is redundant in each case.
This is because any effect marked as IsFinishedTransition will have the
following properties:
- owning animation's PlayState() == Finished or Idle
- animation phase = after or null
- progress = null (this is because transitions don't fill forwards)
2015-08-07 12:29:35 +09:00
Brian Birtles 774abfc8fe Bug 1180125 part 2 - Move AnimationCommon classes out of CSS namespace; r=dbaron
The long-term plan is to drop the mozilla::css namespace altogether. Before we
go to much further with refactoring code in AnimationCommon, we should drop
usage of the mozilla::css namespace. Specifically, this patch moves the
CommonAnimationManager and AnimValuesStyleRule classes to the mozilla namespace.
2015-07-29 10:57:39 +09:00
Carsten "Tomcat" Book c86b8ab1b4 Backed out changeset a4fb4e4b1c8b (bug 1180125) 2015-07-29 17:32:19 +02:00
Brian Birtles 9b391b0177 Bug 1180125 part 2 - Move AnimationCommon classes out of CSS namespace; r=dbaron
The long-term plan is to drop the mozilla::css namespace altogether. Before we
go to much further with refactoring code in AnimationCommon, we should drop
usage of the mozilla::css namespace. Specifically, this patch moves the
CommonAnimationManager and AnimValuesStyleRule classes to the mozilla namespace.
2015-07-29 10:57:39 +09:00
Brian Birtles 87aaa8fc5f Bug 1164330 - Rename time fraction to (iteration) progress; r=jwatt
--HG--
extra : rebase_source : ca36d4d5dab2d08d42c7daa1e6778cda1408f465
2015-05-13 13:57:35 +09:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Brian Birtles a606228cd8 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly. r=smaug 2015-04-30 09:06:43 -04:00
Carsten "Tomcat" Book b05d97c166 Backed out changeset 1b5fc672f0d4 (bug 1159082) for B2G ICS Emulator opt R6 test failures on a CLOSED TREE
--HG--
rename : dom/animation/AnimationEffectReadOnly.cpp => dom/animation/AnimationEffectReadonly.cpp
rename : dom/animation/AnimationEffectReadOnly.h => dom/animation/AnimationEffectReadonly.h
rename : dom/webidl/AnimationEffectReadOnly.webidl => dom/webidl/AnimationEffectReadonly.webidl
2015-04-30 13:15:04 +02:00
Brian Birtles 4fb166f6b2 Bug 1159082 - Rename *Readonly animation interfaces to *ReadOnly; r=smaug
--HG--
rename : dom/animation/AnimationEffectReadonly.cpp => dom/animation/AnimationEffectReadOnly.cpp
rename : dom/animation/AnimationEffectReadonly.h => dom/animation/AnimationEffectReadOnly.h
rename : dom/webidl/AnimationEffectReadonly.webidl => dom/webidl/AnimationEffectReadOnly.webidl
extra : rebase_source : 5fb31684bf494a57e208d0cfbbc76f65b502fc0e
2015-04-28 10:16:45 +09:00
Brian Birtles 8f5fbac8a9 Bug 1154615 part 5 - Rename AnimationPlayerCollection to AnimationCollection; r=jwatt 2015-04-21 10:22:10 +09:00
Brian Birtles bd4c87f07a Bug 1154615 part 4 - Rename references to players in dom/animation; r=jwatt
This patch does not, however,  update references to
AnimationPlayerCollection/CSSTransitionPlayer etc. which we will fix when we get
to layout/style.
2015-04-21 10:22:09 +09:00
Brian Birtles 5c7929fd2a Bug 1154615 part 1 - Rename AnimationPlayer to Animation in WebIDL; r=smaug
This patch is a fairly minimal rename of the AnimationPlayer interface. It
leaves a bunch of local variables and helper classes still using the word
"player". These will be addressed in subsequent patches that don't require DOM
peer review.

--HG--
rename : dom/animation/AnimationPlayer.cpp => dom/animation/Animation.cpp
rename : dom/animation/AnimationPlayer.h => dom/animation/Animation.h
rename : dom/webidl/AnimationPlayer.webidl => dom/webidl/Animation.webidl
2015-04-21 10:22:09 +09:00
Brian Birtles 7d31acbd42 Bug 1153734 part 5 - Add AnimationEffectReadonly as a superinterface of KeyframeEffectReadonly; r=smaug
This patch also replaces some tabs with spaces in KeyframeEffect.h because I was
in the area.
2015-04-15 08:48:21 +09:00
Brian Birtles 63e2382338 Bug 1153734 part 2 - Rename Animation to KeyframeEffectReadonly; r=smaug
We define KeyframeEffectReadonly in KeyframeEffect.cpp since Web Animations also
defines KeyframeEffect and when we come to implement that I expect we'll define
it in the same class, maybe even using the same object.

This patch also adds a few missing includes in places where
KeyframeEffectReadonly is used so that we're not just cargo-culting it in.

--HG--
rename : dom/animation/Animation.cpp => dom/animation/KeyframeEffect.cpp
rename : dom/animation/Animation.h => dom/animation/KeyframeEffect.h
rename : dom/animation/test/css-animations/test_animation-name.html => dom/animation/test/css-animations/test_effect-name.html
rename : dom/animation/test/css-animations/test_animation-target.html => dom/animation/test/css-animations/test_effect-target.html
rename : dom/animation/test/css-transitions/test_animation-name.html => dom/animation/test/css-transitions/test_effect-name.html
rename : dom/animation/test/css-transitions/test_animation-target.html => dom/animation/test/css-transitions/test_effect-target.html
rename : dom/webidl/Animation.webidl => dom/webidl/KeyframeEffect.webidl
2015-04-15 08:48:21 +09:00