Commit Graph
565 Commits
Author SHA1 Message Date
Boris Chiou c1b9a832b9 Bug 2039090 - Pass AnimationRange to GetComputedOffset(). r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin,jwatt
We need the information of animation attachment range for resolving the
keyframe computed offsets.

Differential Revision: https://phabricator.services.mozilla.com/D301216
2026-05-20 00:14:03 +00:00
Boris Chiou 8703a41947 Bug 2033130 - Extend Keyframe offset with range names. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,dshin
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
2026-05-14 00:42:52 +00:00
David Shin b127c615d9 Bug 1774060: Keep track of named timeline animations in nsAnimationManager. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
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
2026-05-02 13:37:58 +00:00
Norisz Fay 0a8c88cc69 Revert "Bug 1774060: Adjust WPT expectations. r=layout-scroll-driven-animation-reviewers,boris" for causing wpt failures @ scroll-timeline-snapshotting.html , timeline-scope.html
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.
2026-05-02 02:53:47 +00:00
David Shin cfd345fe1d Bug 1774060: Keep track of named timeline animations in nsAnimationManager. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
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
2026-05-02 02:00:51 +00:00
Alexandru Marc f1935f9727 Revert "Bug 1774060: Adjust WPT expectations. r=layout-scroll-driven-animation-reviewers,boris" for causing mochitest fails @ test_transitions_per_property
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.
2026-05-01 22:13:25 +00:00
David Shin 1bd23d96d8 Bug 1774060: Keep track of named timeline animations in nsAnimationManager. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
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
2026-05-01 20:59:25 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Emilio Cobos Álvarez 7eb8b17a1a Bug 2023344 - Remove some unneeded includes of ServoStyleConst with common headers. r=firefox-style-system-reviewers,dom-core,webidl,layout-reviewers,smaug,tlouw
Differential Revision: https://phabricator.services.mozilla.com/D287782
2026-03-16 13:35:13 +00:00
Hiroyuki Ikezoe dd7ee5988f Bug 2011353 - Use Animtion::PlaybackRateInternal(). r=boris,firefox-style-system-reviewers
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
2026-02-14 03:52:51 +00:00
Alexandru Marc 22974a8951 Revert "Bug 2011353 - Call Animation::PostUpdate() when invalidating the multiplier cache to update the playback rate for animations on the compositor. r=boris,layout-reviewers" for causing multiple reftest failures
This reverts commit f7edd8fc73.

Revert "Bug 2011353 - Add a mochitest for animation playback multiplier. r=boris"

This reverts commit 63c7cf7f09.

Revert "Bug 2011353 - Apply the animations playback rate multiplier in CurrentOrPendingPlaybackRate. r=boris"

This reverts commit b198b8a748.

Revert "Bug 2011353 - Use Animtion::PlaybackRateInternal(). r=boris,firefox-style-system-reviewers"

This reverts commit d9d321cd8d.

Revert "Bug 2011353 - Add Animation::PlaybackRateInternal. r=boris"

This reverts commit 70672442b4.

Revert "Bug 2011353 - Cache the animations playback rate multiplier in nsPresContext. r=layout-reviewers,emilio"

This reverts commit 9dfe09d39d.

Revert "Bug 2011353 - Change CurrentTimeFromTimelineTime and StartTimeFromTimelineTime's type of playback rate. r=boris"

This reverts commit d2677b7b2b.
2026-02-13 11:45:31 +00:00
Hiroyuki Ikezoe d9d321cd8d Bug 2011353 - Use Animtion::PlaybackRateInternal(). r=boris,firefox-style-system-reviewers
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
2026-02-13 06:31:53 +00:00
Jan Varga f6a33ca75b Bug 1998939 - Add safe CSSPropertyId factory helpers and fix a mis construction; r=emilio,firefox-style-system-reviewers
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
2025-11-16 12:17:50 +00:00
Jan Varga af94611fd2 Bug 1998896 - Rename AnimatedPropertyID to CSSPropertyId; r=emilio,firefox-style-system-reviewers
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
2025-11-15 02:19:19 +00:00
Jan Varga b314d21751 Bug 1998365 - Rename nsCSSPropertyID to NonCustomCSSPropertyId and normalize ID naming; r=emilio,firefox-style-system-reviewers,layout-reviewers
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
2025-11-12 06:11:29 +00:00
serge-sans-paille c3b06ff4b4 Bug 1997165 - Remove unused mfbt inclusion in layout/** r=emilio,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,dshin,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D270577
2025-10-29 22:18:06 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Otto Länd 109d722aca Bug 1921553: apply code formatting via Lando
# ignore-this-changeset
2024-11-25 23:49:54 +00:00
Boris Chiou 70f8516d3a Bug 1921553 - Use PseudoStyleRequest in ElementAnimationData. r=view-transitions-reviewers,emilio
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
2024-11-25 23:46:34 +00:00
Boris Chiou 1c5a34c22d Bug 1921553 - Use PseudoStyleRequest in nsTransitionManager. r=view-transitions-reviewers,layout-reviewers,emilio
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
2024-11-25 23:46:33 +00:00
Boris Chiou 2cacb75b9a Bug 1921553 - Use PseudoStyleRequest in AnimationCollection and TimelineCollection. r=view-transitions-reviewers,layout-reviewers,emilio
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
2024-11-25 23:46:33 +00:00
Boris Chiou dac5d98343 Bug 1921553 - Use PseudoStyleRequest in EffectSet. r=view-transitions-reviewers,layout-reviewers,emilio
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
2024-11-25 23:46:32 +00:00
Boris Chiou 611b6b2ec3 Bug 1921553 - Use PseudoStyleRequest in AnimationTarget. r=view-transitions-reviewers,layout-reviewers,emilio
And also update some related functions.

We will udpate `EffectSet::Get()` in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D228225
2024-11-25 23:46:32 +00:00
Emilio Cobos Álvarez 2f036b2b6f Bug 1930907 - Allow replacing transitions that are not running on the compositor. r=boris,birtles
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
2024-11-15 12:10:04 +00:00
Boris Chiou 4cf8e54b36 Bug 1804574 - Part 2: Fix the normalized iteration duration for scroll animations. r=layout-reviewers,emilio
So we can run scroll animation with `animation-duration:auto`.

Note that the active duration is still 0s (when calling
`AnimationEffect::getComputedTiming()`) because we haven't changed our time
type from double [1] to CSSNumberish [2] (Bug 1762238).

[1] https://drafts.csswg.org/web-animations-1/#the-computedeffecttiming-dictionary
[2] https://drafts.csswg.org/web-animations-2/#the-computedeffecttiming-dictionary

Differential Revision: https://phabricator.services.mozilla.com/D217872
2024-08-06 18:23:14 +00:00
Boris Chiou 070bf4e940 Bug 1859660 - Compute the current value for the replaced transition running on the compositor. r=firefox-style-system-reviewers,zrhoffman
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
2024-07-03 22:57:09 +00:00
Daniel Holbert cd7fd0677f Bug 1896711 part 5: Use MakeRefPtr/MakeAndAddRef to reduce boilerplate, in layout/style. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D210390
2024-05-15 07:29:21 +00:00
Boris Chiou 3899bc85aa Bug 1805727 - Part 4: Implement transition-behavior for properties with discrete animation type. r=emilio
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
2024-02-23 21:41:49 +00:00
Emilio Cobos Álvarez 7f66a1a527 Bug 1876266 - Do less work on the ConsiderInitiatingTransition loop. r=firefox-style-system-reviewers,zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D199483
2024-01-24 23:08:51 +00:00
Otto Länd 087354e70e Bug 1870832: apply code formatting via Lando
# ignore-this-changeset
2023-12-20 10:55:14 +00:00
Emilio Cobos Álvarez 9fd6a588a2 Bug 1870832 - Use cbindgen for animation-{name,composition,fill-mode,direction}. r=firefox-style-system-reviewers,zrhoffman
Same amount of code, but more boring code (and I've probably missed
removing some), which is better.

Differential Revision: https://phabricator.services.mozilla.com/D196843
2023-12-20 10:52:25 +00:00
Emilio Cobos Álvarez 9e9c9e2dfc Bug 1870832 - Auto-generate transition-property. r=firefox-style-system-reviewers,zrhoffman
Now that NonCustomPropertyId is not in mako, it can be auto-generated by
cbindgen. This allows simplifying some code.

Differential Revision: https://phabricator.services.mozilla.com/D196842
2023-12-20 10:52:24 +00:00
Emilio Cobos Álvarez 47f2d9c7be Bug 1870676 - Clean up transition-property handling, and remove eCSSPropertyExtra_all_properties. r=firefox-style-system-reviewers,zrhoffman
While we're at it, let's fix this long-standing TODO.

Differential Revision: https://phabricator.services.mozilla.com/D196760
2023-12-19 11:02:39 +00:00
Emilio Cobos Álvarez e50a1238ea Bug 1846516 - Minor fix ups and logical animation clean-up. r=zrhoffman
Differential Revision: https://phabricator.services.mozilla.com/D196341
2023-12-18 09:24:09 +00:00
cc6095536c Bug 1846516 - [css-properties-values-api] Use AnimatedPropertyID to communicate between Gecko and Servo. r=emilio,layout-reviewers,firefox-style-system-reviewers
Co-authored-by: Frederic Wang <[email protected]>
Co-authored-by: Emilio Cobos Álvarez <[email protected]>

Depends on D191059

Differential Revision: https://phabricator.services.mozilla.com/D191322
2023-12-18 09:24:08 +00:00
Zach HoffmanandFrederic Wang 1e7649831a Bug 1846516 - [css-properties-values-api] Introduce AnimatedPropertyID/AnimatedPropertIDSet. r=firefox-animation-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,hiro
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
2023-12-18 09:24:08 +00:00
Emilio Cobos Álvarez c019bfa948 Bug 1858485 - Avoid AnimationValue allocation churn during transition handling. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D191080
2023-10-17 11:43:26 +00:00
Emilio Cobos Álvarez 057cadb272 Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 22:31:38 +00:00
Butkovits Atila 1f06787277 Backed out changeset f6e3d050b3e7 (bug 1832173) for causing bustages at CanvasRenderingContext2D.cpp. CLOSED TREE 2023-05-13 01:16:03 +03:00
Emilio Cobos Álvarez 5c9b936c47 Bug 1832173 - Finish removing HasArcFFI. r=boris
Use the actual Locked<T> types around (via a typedef, just for
convenience).

Differential Revision: https://phabricator.services.mozilla.com/D177824
2023-05-12 21:37:19 +00:00
Boris Chiou 1e1a13dc7a Bug 1831981 - Make the creation of a transition be a separate function. r=emilio
Only movement. Just try to make it easier to read the code.

This patch doesn't change behaviors.

Differential Revision: https://phabricator.services.mozilla.com/D175534
2023-05-08 22:33:38 +00:00
Boris Chiou a118502c84 Bug 1831981 - Move the cancellation of transitions into a separate function. r=emilio
Improve the readibility, and change some comments and spec links.

This patch doesn't change behaviors.

Differential Revision: https://phabricator.services.mozilla.com/D174985
2023-05-08 22:33:38 +00:00
Boris Chiou 12d2050073 Bug 1831981 - Share code for expanding all keyword and shorthands when iterating transition-property list. r=emilio
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
2023-05-08 22:33:37 +00:00
Emilio Cobos Álvarez f84eea3381 Bug 1831410 - Deal with infinite transition durations / delays. r=boris
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
2023-05-08 10:55:08 +00:00
Emilio Cobos Álvarez 46f75451b0 Bug 1816915 - Clean up EffectSet APIs. r=firefox-animation-reviewers,boris
EffectSet::GetEffectSet seems rather redundant, use just EffectSet::Get
and tweak naming of similar APIs.

Differential Revision: https://phabricator.services.mozilla.com/D169931
2023-02-15 20:39:16 +00:00
Emilio Cobos Álvarez 765e4c3182 Bug 1807003 - Centralize animation data in slots. r=smaug,firefox-animation-reviewers,boris
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
2023-02-15 14:12:33 +00:00
Otto Länd 518cfdadaf Bug 1810946, 1810946, 1810946: apply code formatting via Lando
# ignore-this-changeset
2023-01-19 10:09:23 +00:00
Emilio Cobos Álvarez 0da20c8321 Bug 1810946 - Use the same computed time representation between Servo and Gecko. r=boris
Same as above.

Differential Revision: https://phabricator.services.mozilla.com/D167126
2023-01-19 10:06:38 +00:00
Stanca Serban e9d8116d7e Backed out 4 changesets (bug 1810946) for causing bustages in nsStyleStruct.cpp. CLOSED TREE
Backed out changeset 8bc18b0e7a91 (bug 1810946)
Backed out changeset 1d02bd23dabe (bug 1810946)
Backed out changeset 258c2f8c1bc9 (bug 1810946)
Backed out changeset bd491b11178a (bug 1810946)
2023-01-19 04:40:39 +02:00
Otto Länd 709b5c6bb6 Bug 1810946, 1810946, 1810946: apply code formatting via Lando
# ignore-this-changeset
2023-01-19 02:08:56 +00:00