Commit Graph

386 Commits

Author SHA1 Message Date
Brian Birtles
7146315464 Bug 1405548 - Post restyles when creating or removing new CSS animations when using the Servo backend; r=hiro
As explained in the extended comment in this patch, for Servo we want to post
restyles when creating new animations so that we run a second animation
restyle and incorporate the result of new animations into style immediately.
(Gecko does everything in the one restyle, and although this causes other bugs
related to triggering transitions, at least it means it does not require
restyles to be posted here).

It turns out that we normally end up posting a restyle anyway in
CSSAnimation::SetAnimationIndex. Bug 1332958 was supposed to drop that but it
never landed.

However, CSSAnimation::SetAnimationIndex only posts a restyle when there is
a change to the animation index. It turns out that, by chance, there normally
*is* a change to a CSSAnimation's animation index when it is created. Initially
it takes its animation index from Animation::sNextAnimationIndex which is
incremented each time it is assigned to an animation.

If the first Animation we create for a given content process is a CSSAnimation
then sNextAnimationIndex will be zero and so we will initially assign an
animation index of zero. If that CSS animation is also the first in the list
of animations in animation-name, when we call SetAnimationIndex we will pass
zero as the index to use, and when we go to update the animation index we will
detect that there is no change, and will NOT post an animation restyle.
As a result the target element's style will NOT reflect the animated style.

To fix this we need to ensure that *new* CSS animations trigger a restyle.

For *changes* to animations, the corresponding calls to SetKeyframes and
SetSpecifiedTiming post restyles so the behavior should be correct in those
cases.

For *removed* animations I observed that in at least some cases we successfully
post a restyle. However, this appeared to be as much by chance as anything so
this patch also posts a restyle for removed animations. (Note that the
EffectCompositor will ignore redundant restyle requests so this is ok.)

This patch deliberately does not expose Animation::PostUpdate and call that
because the code introduced here is intended to be temporary. Long-term we
should remove the Gecko style backend and allow the calls to PlayFromStyle,
PauseFromStyle, CancelFromStyle etc. to post restyles just like calls to Play,
Pause, and Cancel do. At that point this code can also be removed.

MozReview-Commit-ID: 4c3vJdLBqeY
2017-10-11 16:36:36 +09:00
Hiroyuki Ikezoe
f0a38025cf Bug 1329169 - Use atom for animation-name property. r=xidorn
MozReview-Commit-ID: 9yVWXVi1oXf
2017-10-10 17:00:28 +09:00
Emilio Cobos Álvarez
4b6d7fc287 Bug 1381844: Be more explicit about the kind of style context we handle all the time. r=bholley
MozReview-Commit-ID: E0mdkhU3XBz
2017-07-22 18:02:57 +02:00
Manish Goregaokar
82f2e05017 Bug 1382017 part 4 Gecko piece - Rename ServoComputedValues -> ServoComputedData; r=heycam
ServoComputedValues is confusing because ComputedValues is actually
ServoStyleContext on the C++ side.

MozReview-Commit-ID: IQNVdfREAMt
2017-07-20 21:44:02 -07:00
Manish Goregaokar
0dcf16fa0c Bug 1367904 - Part 14: stylo: Remove FFI calls for fetching style structs from ServoComputedValues; r=bholley
MozReview-Commit-ID: 2HrVZl9HZu1
2017-07-17 21:01:10 -07:00
Manish Goregaokar
86e90da5c3 Bug 1367904 - Part 10: stylo: Switch Gecko over to ServoStyleContext; r=bholley
MozReview-Commit-ID: EmopKVjEzlz
2017-07-17 21:00:46 -07:00
Hiroyuki Ikezoe
1ef73f827c Bug 1360398 - Do not fill computed values in missing keyframes for CSS animations during generating Keyframes. r=birtles
MozReview-Commit-ID: C2dYneoB09g
2017-07-10 17:19:23 +09:00
Hiroyuki Ikezoe
023f9872f2 Bug 1374882 - Encapsulate TimingParams's member variables. r=birtles
MozReview-Commit-ID: 1KhEdCSwpES
2017-06-22 12:12:43 +09:00
Boris Chiou
ca7a2d3001 Bug 1339690 - Part 7: Stop storing invalid property value. r=birtles
MozReview-Commit-ID: H3aRcJIk7CV
2017-06-14 11:43:47 +08:00
Hiroyuki Ikezoe
11db326869 Bug 1367293 - Don't get parent style for GetComputedKeyframeValuesFor. r=birtles
MozReview-Commit-ID: 7WjsO7P2QGz
2017-06-02 09:38:54 +09:00
Hiroyuki Ikezoe
9dd0727d3d Bug 1354947 - Rename FillKeyframesForName to GetKeyframesForName. r=birtles
MozReview-Commit-ID: AOLygEtuhpO
2017-05-13 16:34:38 +09:00
Hiroyuki Ikezoe
b2d74d322a Bug 1354947 - Expose FindMatchingKeyframe and make it reusable for nsTimingFunction. r=birtles
MozReview-Commit-ID: Jjcrk5AhtUH
2017-05-13 16:34:38 +09:00
Brian Birtles
6f31f71d47 Bug 1355348 - Move ServoComputedValuesWithParent to separate file; r=hiro
We will use this type later in this patch series in nsSMILCSSProperty so this
patch moves it to a separate file so it can be re-used.

MozReview-Commit-ID: 4Z7YbsQ9xz4
2017-04-26 13:00:11 +09:00
Hiroyuki Ikezoe
57ae304351 Bug 1350754 - Convert pseudo nsIAtom to CSSPseudoElementType in Gecko_UpdateAnimations(). r=heycam
MozReview-Commit-ID: 38ZyRyxB73z
2017-03-27 19:43:13 +09:00
Hiroyuki Ikezoe
1f0798fbb1 Bug 1350754 - Use ServoComputedValuesWithParent for nsAnimationManager::UpdateAnimations(). r=birtles
MozReview-Commit-ID: GkLoACgqVON
2017-03-27 19:43:09 +09:00
Hiroyuki Ikezoe
80bbb9a04f Bug 1341985 - Call UpdateAnimations even if the element has no computed values. r=birtles,heycam
MozReview-Commit-ID: 2dgAF7WOWxr
2017-03-10 11:53:19 +09:00
Daisuke Akatsuka
a66b7e90df Bug 1339332 - Part 2: Remove no longer used method. r=birtles
MozReview-Commit-ID: 6kFBGP4K10Z
2017-03-08 10:07:08 +09:00
Daisuke Akatsuka
1243945dbb Bug 1339332 - Part 1: Introduce neutral value concept for missing keyframe in CSS Animation. r=birtles,hiro
MozReview-Commit-ID: F3qvRY3SRAp
2017-03-08 10:07:08 +09:00
Hiroyuki Ikezoe
86a7d15844 Bug 1344603 - Make Stop{Animations|Transitions}ForElement as a member function of CommonAnimationManager. r=boris
MozReview-Commit-ID: LSSpWYjoPn9
2017-03-06 13:19:09 +09:00
Hiroyuki Ikezoe
333a632f95 Bug 1340322 - Part 13: Update CSS Animations with servo's computed values. r=birtles
MozReview-Commit-ID: B7uSH7wrx3b
2017-03-06 10:09:47 +09:00
Hiroyuki Ikezoe
701883463d Bug 1340322 - Part 12: Add another variant of nsAnimationManager::UpdateAnimations for stylo. r=birtles
This function updates CSS Animations with servo's computed values.

In bug 1341985, this function will be called with null servo's computed values
in the case where the target element is in display:none subtree.

MozReview-Commit-ID: GzOYy57hYho
2017-03-06 09:54:06 +09:00
Hiroyuki Ikezoe
f5a03e3748 Bug 1340322 - Part 11: Introduce ServoCSSAnimationBuilder. r=birtles
MozReview-Commit-ID: 6qWPPXexitN
2017-03-06 09:52:23 +09:00
Hiroyuki Ikezoe
74c458218f Bug 1340322 - Part 10: Rename CSSAnimationBuilder to GeckoCSSAnimationBuilder. r=birtles
MozReview-Commit-ID: 9DV9fijsoXF
2017-03-06 09:52:20 +09:00
Hiroyuki Ikezoe
0686e44b9e Bug 1340322 - Part 9: Templatize functions that will be used with servo's computed values. r=birtles
MozReview-Commit-ID: 8d5wHBhF4y9
2017-03-06 09:51:16 +09:00
Hiroyuki Ikezoe
5c2e9a691e Bug 1340322 - Part 8: Split off some processes that will be used for servo's computed values in UpdateAnimations(). r=birtles
MozReview-Commit-ID: LkWqhGsMCPf
2017-03-06 09:50:09 +09:00
Hiroyuki Ikezoe
dfd9037e88 Bug 1340322 - Part 7: Make BuildAnimation() and BuildAnimations() independent from nsStyleContext. r=birtles
MozReview-Commit-ID: 3R7MyyN17C1
2017-03-06 09:49:16 +09:00
Hiroyuki Ikezoe
4a2a0b0984 Bug 1340322 - Part 6: Add CSSAnimationBuilder::SetKeyframes(). r=birtles
ServoCSSAnimationBuilder will have the same name method too.

MozReview-Commit-ID: ET9GERVtbWP
2017-03-06 09:49:07 +09:00
Hiroyuki Ikezoe
ec3f6c0071 Bug 1340322 - Part 5: Split off BuildKeyframes() r=birtles
ServoCSSAnimationBuilder will also have the same name method.

MozReview-Commit-ID: CySTBGuTZn7
2017-03-06 09:48:50 +09:00
Hiroyuki Ikezoe
57209a9667 Bug 1340322 - Part 4: Make BuildAnimations() independent from nsStyleDisplay r=birtles.
MozReview-Commit-ID: JiV2WxBVH3i
2017-03-06 09:48:44 +09:00
Hiroyuki Ikezoe
7f99401324 Bug 1340322 - Part 3: Make BuildAnimations static function. r=birtles
This function will be also a template function.

MozReview-Commit-ID: 4SbzEw8YzIZ
2017-03-06 09:48:36 +09:00
Hiroyuki Ikezoe
082667cfb1 Bug 1340322 - Part 2: Use NonOwningAnimationTarget instead of Element and aStyleContext()->GetPseudoType(). r=birtles
MozReview-Commit-ID: JOBBGUs8kJd
2017-03-06 09:47:22 +09:00
Hiroyuki Ikezoe
9e411c6834 Bug 1340322 - Part 1: Split CSSAnimationBuilder::Build off as a static function. r=birtles
The static function will be a template function that can be used with servo's
computed values as well.


MozReview-Commit-ID: DgLTQ8ihPod
2017-03-06 09:46:40 +09:00
Hiroyuki Ikezoe
42508fbb2b Bug 1344533 - Replace OwningElementRef::GetRenderedPresContext with nsContentUtils::GetContextForContext(). r=boris
MozReview-Commit-ID: HaAvgNcORQb
2017-03-05 17:28:49 +09:00
Hiroyuki Ikezoe
53e3f74337 Bug 1341518 - We don't need to call SetNeedStyleFlush() explicitly in UpdateAnimations. r=birtles,mantaroh
DocumentTimeline ensures the next tick, which is necessary for animation events,
is processed. Actually CSSAnimation::QueueEvents() is called from WillRefresh(),
the WillRefresh() is not called if the animation is not being observed by the
DocumentTimeline.

MozReview-Commit-ID: AYdqi7x3jty
2017-02-22 15:45:27 +09:00
Hiroyuki Ikezoe
c9b25aeb10 Bug 1340916 - Part 3: Add a helper function to create TimingParams CSS animation/transition properties. r=birtles
MozReview-Commit-ID: 3CmCc44FhvA
2017-02-20 11:02:52 +09:00
Hiroyuki Ikezoe
b4222b93c0 Bug 1340916 - Part 2: Move keyframs array for old animations. r=birtles
MozReview-Commit-ID: BI64Yzgop6
2017-02-20 06:28:40 +09:00
Cameron McCormack
61f5edfdb9 Bug 1297899 - Part 1: Rename RestyleManager.{h,cpp} to GeckoRestyleManager.{h,cpp}. r=bholley
MozReview-Commit-ID: 1v0ufuGFtiD
2017-02-13 11:21:30 +08:00
Mantaroh Yoshinaga
246a4a50cb Bug 1302648 part 5 - Queue animationcancel when animation status is idle. r=birtles
MozReview-Commit-ID: DRjWboQwR0A
2017-02-10 12:32:44 +09:00
Cameron McCormack
334e0fe231 Bug 1334735 - Part 1: Move need style/flush flags from document to pres shell. r=bz
MozReview-Commit-ID: 2Amf9yGRiJA
2017-02-10 10:42:27 +08:00
Hiroyuki Ikezoe
c11a23b8a2 Bug 1328787 - Part 12: Fill Gecko's Keyframe. r=heycam
MozReview-Commit-ID: 5QdUtFj9lK9
2017-01-29 12:58:51 +09:00
Hiroyuki Ikezoe
db471ea747 Bug 1328787 - Part 2: Don't pass nsCSSKeyframesRule* to CSSAnimationBuild::Build. r=heycam
Because, in case of stylo, we don't have nsCSSKeyframesRule.

MozReview-Commit-ID: uWlrFihjbx
2017-01-29 12:58:25 +09:00
Mantaroh Yoshinaga
831b5a3b13 Bug 1308099 part 2 - Remove unnecessary typedef and use defined name instead of full namespace. r=hiro
MozReview-Commit-ID: Jn5qLqS9Kc3
2017-01-25 15:59:30 +09:00
Mantaroh Yoshinaga
7cf3d2b8b4 Bug 1308099 part 1 - Rename AnimationPhase::Null to AnimationPhase::Idle. r=hiro
In Web Animations specification, if the animation effect is in none of the any phase, it define as 'Idle' phase. [1]
But, in the gecko, it defined as 'Null' phase.

So we will need to use 'Idle' phase for consistency.

[1] https://w3c.github.io/web-animations/#idle-phase

MozReview-Commit-ID: FlPpYOqdM4X
2017-01-25 15:43:57 +09:00
Hiroyuki Ikezoe
6044c74e91 Bug 1330190 - Part 2: Add a new function named ResolveStyleWithoutAnimation. r=heycam
Unlike the other one this function does not need an old nsStyleContext.
This function just resolves style without all animation data in the first place.
The existing ResolveStyleWithoutAnimation is renamed to
ResolveStyleByRemovingAnimation.

MozReview-Commit-ID: 1RmCQNw0MmW
2017-01-16 16:57:13 +09:00
Mantaroh Yoshinaga
2c4227d412 Bug 1202333 part 2 - Update the CSSTransition::QueueEvents to specification. r=birtles
MozReview-Commit-ID: BxkZ359g7JR
2016-12-20 15:57:20 +09:00
Mantaroh Yoshinaga
f980e319fe Bug 1202333 part 1 - Remove excessive animationiteration event. r=birtles
The Firefox fired excessive animationiteration event.
But We fixed specification in order to prevent firing the animationiteration when animation is start.

For detail, See https://github.com/w3c/csswg-drafts/issues/68

MozReview-Commit-ID: 391DRxSpq86
2016-12-20 15:57:13 +09:00
Xidorn Quan
3b74963c68 Bug 1307357 part 2 - Fix issues appear after adding file to unified source. r=heycam
MozReview-Commit-ID: 5FkisMn3LKq
2016-11-23 10:26:20 +11:00
Mantaroh Yoshinaga
0249279370 Bug 1287983 part 6 - Integrate ElapsedTimeToTimeStamp function to the Animation class. r=birtles
MozReview-Commit-ID: 43AGaTYQoqn
2016-10-19 15:16:52 +09:00
Hiroyuki Ikezoe
84855153b8 Bug 1216843 - Part 16: Fix bug number for implementation of keyframe composition. r=birtles
The content of this bug (1216843) has changed since it filed initially,
so we should change bug numbers in our source tree.

Re-generating ini file re-ordered items in the ini file.

MozReview-Commit-ID: HnJGJDSmZl3
2016-09-13 11:48:46 +09:00
Brian Birtles
cf51ad1c35 Bug 1300045 part 2 - Split KeyframeEffect.cpp into KeyframeEffect{ReadOnly}.cpp r=hiro,smaug
MozReview-Commit-ID: DdBEicunApv
2016-09-04 16:34:21 +09:00