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

77 Коммитов

Автор SHA1 Сообщение Дата
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
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
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
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
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 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
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 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
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
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
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 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 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 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 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 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 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 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 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 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 235db06383 Bug 1208951 - Part 9: Implement KeyframeEffectReadOnly constructor. r=bzbarsky r=birtles 2015-10-22 19:22:38 +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