Introduce `Keyframe::OffsetType` which is a pair of `StyleTimelineRangeName`
and `double`. Also, extend `Keyframe::mOffset` to use this new type.
No behavior change, and we are still generating the keyframes with
double offset (or null offseet from script-generated animations).
Differential Revision: https://phabricator.services.mozilla.com/D296481
Animations can refer to the timeline to use, by name. The timeline resolution
can change due to style invalidation, e.g. An element mutating its
`scroll-timeline` property. Additionally, the referenced timeline may not even
exist at the time it is referenced. To respond to such changes correctly, we
need to keep track of what animations refer to named timelines.
Differential Revision: https://phabricator.services.mozilla.com/D296156
This reverts commit acc24781f3.
Revert "Bug 1774060: Invalidate named timelines on scroll|view-timeline and timeline-scope changes. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit c836eb9459.
Revert "Bug 1774060: Populate and return changed timeline names for invalidation. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit 86943f3b14.
Revert "Bug 1774060: Keep track of named timeline animations in `nsAnimationManager`. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit cfd345fe1d.
Animations can refer to the timeline to use, by name. The timeline resolution
can change due to style invalidation, e.g. An element mutating its
`scroll-timeline` property. Additionally, the referenced timeline may not even
exist at the time it is referenced. To respond to such changes correctly, we
need to keep track of what animations refer to named timelines.
Differential Revision: https://phabricator.services.mozilla.com/D296156
This reverts commit 668d470d4a.
Revert "Bug 1774060: Invalidate named timelines on scroll|view-timeline and timeline-scope changes. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit 2c5fdb9407.
Revert "Bug 1774060: Populate and return changed timeline names for invalidation. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit e3ca86799a.
Revert "Bug 1774060: Keep track of named timeline animations in `nsAnimationManager`. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"
This reverts commit 1bd23d96d8.
Animations can refer to the timeline to use, by name. The timeline resolution
can change due to style invalidation, e.g. An element mutating its
`scroll-timeline` property. Additionally, the referenced timeline may not even
exist at the time it is referenced. To respond to such changes correctly, we
need to keep track of what animations refer to named timelines.
Differential Revision: https://phabricator.services.mozilla.com/D296156
One caveat here is that the returned value of PlaybackRateInternal() can
be changed while calling a member function of the Animation instance so
that we need to call PlaybackRateInternal() every time.
test_animations_reverse.html fails if we use a local variable something
like `const double playbackRate = PlaybackRateInternal()` in functions.
Differential Revision: https://phabricator.services.mozilla.com/D282974
One caveat here is that the returned value of PlaybackRateInternal() can
be changed while calling a member function of the Animation instance so
that we need to call PlaybackRateInternal() every time.
test_animations_reverse.html fails if we use a local variable something
like `const double playbackRate = PlaybackRateInternal()` in functions.
Differential Revision: https://phabricator.services.mozilla.com/D282974
Introduce new factory helper methods on CSSPropertyId to safely construct a
property identifier from either a non custom property id or a custom property.
The patch also fixes an existing mis construction in
nsDOMWindowUtils::ComputeAnimationDistance, which incorrectly built a
CSSPropertyId for custom properties.
Differential Revision: https://phabricator.services.mozilla.com/D271787
This patch renames AnimatedPropertyID to CSSPropertyId and updates all uses
accordingly. No behavior changes intended.
AnimatedPropertyID has long served as the general property identifier,
covering both non custom and custom properties. The name is currently
misleading.
Potential follow-ups:
- Rename AnimatedPropertyIDSet
Differential Revision: https://phabricator.services.mozilla.com/D271750
nsCSSPropertyID only enumerates non custom properties, but the name suggests
otherwise. (eCSSPropertyExtra_variable only signals a custom property and does
not carry the custom name.) This mismatch has been confusing and also blocks
renaming AnimatedPropertyID to CSSPropertyId.
This patch renames nsCSSPropertyID to NonCustomCSSPropertyId to make the non
custom scope explicit. It also normalizes identifier naming (aPropID ->
aPropId, mID -> mId, etc.) for consistency.
No behavior changes intended.
Potential follow-ups:
- Move the enum to the mozilla namespace.
- Convert the enum to an enum class.
- Rename nsCSSPropertyIDSet.
Differential Revision: https://phabricator.services.mozilla.com/D271443
And all its callers, e.g. AnimationCollection/TimelineCollection, and
nsAnimationManager/nsTransitionManager.
We will add the data field for view-transitions in Bug 1921116.
Differential Revision: https://phabricator.services.mozilla.com/D229565
Even though we don't support CSS Transitions on view transition
pseudo-elements, it's better to use PseudoStyleRequest for consistency
and avoid allocating unnecessary objects.
Also, make sure we use the correct element to retrieve the transition
collection.
Differential Revision: https://phabricator.services.mozilla.com/D228229
Just like what we do for EffectSet. Also, we will update
ElementAnimationData later, so for now only change the APIs of
AnimationCollection and TimelineCollection (and their callers).
Differential Revision: https://phabricator.services.mozilla.com/D228227
Use `PseudoStyleRequest` in the APIs of EffectSet. We would like to
store the animation in the originating element, so need to use
`PseudoStyleRequest`.
Differential Revision: https://phabricator.services.mozilla.com/D228226
This improves the behavior significantly. Transitions that are not
running on the compositor but are throttled on the main thread due to
being scrolled out of view have the same issue as compositor animations.
Differential Revision: https://phabricator.services.mozilla.com/D229026
We rely on the current value to check if we have to create a transition
to replace the running one, and if the running transition is on the
compositor, we don't have the up-do-date transition rule on the main
thread, so we have to compute it when trying to create a new transition.
Differential Revision: https://phabricator.services.mozilla.com/D213687
The implementation is straight-forward. We have to check
if `transition-behavior` is `allow-discrete` when trying to create a new
transition and when checking if we have to cancel a running transition.
Also, the test case is out-of-date, so I tweak it a little bit and add
more general test cases for transtiion-behavior. Besides, I enable the
preference in the WPT folders which use `transition-behavior` (but
those tests may be passed already or failed due to reasons other than
`transition-behavior`).
Differential Revision: https://phabricator.services.mozilla.com/D201864
This will make possible to animate custom properties on Gecko side. For now, the
animation code keeps only dealing with nsCSSPropertyID, so behavior is unchanged.
Co-authored-by: Frederic Wang <[email protected]>
Depends on D190816
Differential Revision: https://phabricator.services.mozilla.com/D191059
The only difference is the usage of `nsCSSProps::IsEnabled()` for all
keyword when handling the cancellation of existing transitions.
However, this is a kind of preference check so it shouldn't break the
consistency. And in fact we don't have to cancel the no longer used
transitions if we specifies `all` keyword. Besides, I will update this part
again to remove the for loop, in a later patch.
This patch doesn't change behaviors.
Differential Revision: https://phabricator.services.mozilla.com/D175533
If duration or delay are infinite, and the value portion is zero, we
could end up with a `nan` duration (multiplying inf by 0).
Differential Revision: https://phabricator.services.mozilla.com/D177255
This should both be faster and simpler. Also will allow us in the future
to animate more pseudos without having to add a gazillion properties.
I think we should try to clear more stuff (maybe the whole animation
data) on unbind, but that's a bit tangential.
Differential Revision: https://phabricator.services.mozilla.com/D169860