Commit Graph
540 Commits
Author SHA1 Message Date
David Shin 22c4bedb56 Bug 2036423: Implement inactive timeline. r=layout-scroll-driven-animation-reviewers,webidl,firefox-style-system-reviewers,smaug,boris
Differential Revision: https://phabricator.services.mozilla.com/D301916
2026-05-27 19:23:07 +00:00
David Shin c5ff07c574 Bug 2036423: Don't force compositor animation update on timeline change. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D301915
2026-05-27 19:23:04 +00:00
rperta c0008fb44a Revert "Bug 2036423: Implement inactive timeline. r=layout-scroll-driven-animation-reviewers,webidl,firefox-style-system-reviewers,smaug,boris" for causing wr failures at deferred-timeline-composited.html
This reverts commit 12f24969a8.

Revert "Bug 2036423: Don't force compositor animation update on timeline change. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit d0c4d6db66.
2026-05-26 21:33:12 +00:00
David Shin 12f24969a8 Bug 2036423: Implement inactive timeline. r=layout-scroll-driven-animation-reviewers,webidl,firefox-style-system-reviewers,smaug,boris
Differential Revision: https://phabricator.services.mozilla.com/D301916
2026-05-26 19:06:00 +00:00
David Shin d0c4d6db66 Bug 2036423: Don't force compositor animation update on timeline change. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D301915
2026-05-26 19:05:57 +00:00
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
Hiroyuki Ikezoe b06a6e3d95 Bug 2040107 - Use GetFlattenedTreeParentElement rather than GetParentElement in GetNamedProgressTimeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
The spec clearly says `flat tree`.

https://drafts.csswg.org/scroll-animations-1/#timeline-scope

Differential Revision: https://phabricator.services.mozilla.com/D300921
2026-05-16 10:15:34 +00:00
Serban Stanca bf98cb2799 Revert "Bug 2040107 - Use GetFlattenedTreeParentElement rather than GetParentElement in GetNamedProgressTimeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris" for causing build bustages in nsINode.h.
This reverts commit 84db70c77b.
2026-05-16 09:33:59 +00:00
Hiroyuki Ikezoe 84db70c77b Bug 2040107 - Use GetFlattenedTreeParentElement rather than GetParentElement in GetNamedProgressTimeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
The spec clearly says `flat tree`.

https://drafts.csswg.org/scroll-animations-1/#timeline-scope

Differential Revision: https://phabricator.services.mozilla.com/D300921
2026-05-16 09:07:28 +00:00
serge-sans-paille ac25ab3f88 Bug 2037920 - Use explicit namespace to prevent ambiguous references during unified builds r=firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,longsonr,emilio
Differential Revision: https://phabricator.services.mozilla.com/D299383
2026-05-10 08:47:55 +00:00
David Shin 1ba807a696 Bug 1774060: Invalidate named timelines on scroll|view-timeline and timeline-scope changes. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296158
2026-05-02 13:38:03 +00:00
David Shin 5d6f2a2096 Bug 1774060: Populate and return changed timeline names for invalidation. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296157
2026-05-02 13:38:01 +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 c836eb9459 Bug 1774060: Invalidate named timelines on scroll|view-timeline and timeline-scope changes. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296158
2026-05-02 02:00:56 +00:00
David Shin 86943f3b14 Bug 1774060: Populate and return changed timeline names for invalidation. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296157
2026-05-02 02:00:53 +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 2c5fdb9407 Bug 1774060: Invalidate named timelines on scroll|view-timeline and timeline-scope changes. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296158
2026-05-01 20:59:31 +00:00
David Shin e3ca86799a Bug 1774060: Populate and return changed timeline names for invalidation. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D296157
2026-05-01 20:59:28 +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
Lando fde522bf4e Bug 2025282, 2025926: apply code formatting via Lando
# ignore-this-changeset
2026-03-26 12:30:55 +00:00
serge-sans-paille 60cafad33c Bug 2025926 - Remove unused <cmath> inclusion and make sure we don't regress on those r=emilio,media-playback-reviewers,webrtc-reviewers,win-reviewers,firefox-style-system-reviewers,dshin,mjf,gstoll,padenot
Leveraging the `mach lint -lincludes` infrastructure

Differential Revision: https://phabricator.services.mozilla.com/D289623
2026-03-26 12:30:41 +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
David Shin 10ae50bec0 Bug 2016258: Implement timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D286173
2026-03-09 20:56:13 +00:00
David Shin be73e3ebf6 Bug 1782995: Get rid of sibling traversal for named timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D286172
2026-03-09 20:56:11 +00:00
Boris Chiou 402c9dc41b Bug 2014914 - Part 3: Calculate the animation attachment range when updating the timing. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin
We use the timeline duration to calculate the propery active duration
and end time in TimingParams. So now it's time to convert
`StyleAnimationRange{Start|End}` into the percentage value.

However, we still have to update start time of animation to align the
animation attachment range. We will do this in Bug 2020822. For now, no
test is passed because of the incorrect start time.

Differential Revision: https://phabricator.services.mozilla.com/D286168
2026-03-08 21:00:31 +00:00
Boris Chiou 9c403df59c Bug 2014914 - Part 2: Store the style of the animation range in Animation. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin
When building the animation, we have to keep `animation-range` for this
animation, and we will use this to get the animation attachment range.

Differential Revision: https://phabricator.services.mozilla.com/D286167
2026-03-08 21:00:28 +00:00
Sandor Molnar beb1b1bcb8 Revert "Bug 2014914 - Part 5: Define the default values for StyleGenericAnimationRangeValue. r=firefox-style-system-reviewers,emilio" for timelineManager crashes
This reverts commit 644a9ce730.

Revert "Bug 2014914 - Part 4: Normalize the timing if the timeline data is changed. r=layout-scroll-driven-animation-reviewers,layout-reviewers,dshin"

This reverts commit b41cc1b969.

Revert "Bug 2014914 - Part 3: Calculate the animation attachment range when updating the timing. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin"

This reverts commit 7dfe5e7abb.

Revert "Bug 2014914 - Part 2: Store the style of the animation range in Animation. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin"

This reverts commit 3f1c0188b5.

Revert "Bug 2014914 - Part 1: Cache the necessary layout info and calculate the timeline data lazily. r=layout-scroll-driven-animation-reviewers,layout-reviewers,dshin"

This reverts commit 3de9737bd5.

Revert "Bug 2016258: Move timeline-scope to the UI struct. r=firefox-style-system-reviewers,emilio"

This reverts commit eb6ede0c75.

Revert "Bug 2016258: Implement timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit 87b661808e.

Revert "Bug 1782995: Get rid of sibling traversal for named timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit be1f75b1e9.

Revert "Bug 2018310: Add hashmap to keep track of all possible timeline targets of that name. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit bd0754e023.

Revert "Bug 2018310: Track timeline-scope on DOM side. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris,emilio"

This reverts commit afd2fa8cb8.
2026-03-08 09:27:29 +00:00
Boris Chiou 7dfe5e7abb Bug 2014914 - Part 3: Calculate the animation attachment range when updating the timing. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin
We use the timeline duration to calculate the propery active duration
and end time in TimingParams. So now it's time to convert
`StyleAnimationRange{Start|End}` into the percentage value.

However, we still have to update start time of animation to align the
animation attachment range. We will do this in Bug 2020822. For now, no
test is passed because of the incorrect start time.

Differential Revision: https://phabricator.services.mozilla.com/D286168
2026-03-06 01:28:09 +00:00
Boris Chiou 3f1c0188b5 Bug 2014914 - Part 2: Store the style of the animation range in Animation. r=firefox-style-system-reviewers,layout-scroll-driven-animation-reviewers,dshin
When building the animation, we have to keep `animation-range` for this
animation, and we will use this to get the animation attachment range.

Differential Revision: https://phabricator.services.mozilla.com/D286167
2026-03-06 01:28:06 +00:00
David Shin 87b661808e Bug 2016258: Implement timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D286173
2026-03-05 23:51:31 +00:00
David Shin be1f75b1e9 Bug 1782995: Get rid of sibling traversal for named timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D286172
2026-03-05 23:51:28 +00:00
David Shin f36b714817 Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
... To be utilized as it was for anchor positioning [1].

[1]: https://searchfox.org/firefox-main/rev/eea0f8f080f0eb810c0c6296da9792e81cd69ce6/layout/base/AnchorPositioningUtils.cpp#114

Differential Revision: https://phabricator.services.mozilla.com/D284562
2026-02-25 14:28:05 +00:00
iulian moraru 25fc25a6f9 Revert "Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris" for causing multiple mochitest failures.
This reverts commit 103fd273bc.

Revert "Bug 2016245: Add parsing for timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit 8e5fa13d51.

Revert "Bug 2016245: Rename anchor-scope's backing type for general use. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,layout-reviewers,boris"

This reverts commit 7b7e701073.
2026-02-24 21:11:26 +00:00
David Shin 103fd273bc Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
... To be utilized as it was for anchor positioning [1].

[1]: https://searchfox.org/firefox-main/rev/eea0f8f080f0eb810c0c6296da9792e81cd69ce6/layout/base/AnchorPositioningUtils.cpp#114

Differential Revision: https://phabricator.services.mozilla.com/D284562
2026-02-24 19:56:51 +00:00
Cosmin Sabou 61f86e6d73 Revert "Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris" for causing mochitest plain failures on test_computed_style_difference.
This reverts commit 4caefb9c09.

Revert "Bug 2016245: Add parsing for timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit c6f5455dd1.

Revert "Bug 2016245: Rename anchor-scope's backing type for general use. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,layout-reviewers,boris"

This reverts commit 007f70e272.
2026-02-24 05:18:37 +00:00
David Shin 4caefb9c09 Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
... To be utilized as it was for anchor positioning [1].

[1]: https://searchfox.org/firefox-main/rev/eea0f8f080f0eb810c0c6296da9792e81cd69ce6/layout/base/AnchorPositioningUtils.cpp#114

Differential Revision: https://phabricator.services.mozilla.com/D284562
2026-02-24 03:50:31 +00:00
Sandor Molnar ae02646542 Revert "Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris" for causing mochitest failures @ test_property_database DONTBUILD
This reverts commit bcf761a291.

Revert "Bug 2016245: Add parsing for timeline-scope. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris"

This reverts commit d42607ba35.

Revert "Bug 2016245: Rename anchor-scope's backing type for general use. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,layout-reviewers,boris"

This reverts commit 228f755dd6.
2026-02-24 01:26:49 +00:00
David Shin bcf761a291 Bug 2016245: Parse tree-scoped names in scroll-timeline, view-timeline, animation-timeline. r=layout-scroll-driven-animation-reviewers,firefox-style-system-reviewers,boris
... To be utilized as it was for anchor positioning [1].

[1]: https://searchfox.org/firefox-main/rev/eea0f8f080f0eb810c0c6296da9792e81cd69ce6/layout/base/AnchorPositioningUtils.cpp#114

Differential Revision: https://phabricator.services.mozilla.com/D284562
2026-02-24 00:25:14 +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
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 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 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
Boris Chiou 30af2312c9 Bug 1921553 - Use PseudoStyleRequest in AnimationUtils and EffectCompositor. r=view-transitions-reviewers,layout-reviewers,emilio
Basically, we'd like to separate the originating element and its pseudo
element request in Animation code (for better compatibility with Web
Animations APIs and other pseudo types), and store the animations and
keyframe effects in the origninating element as well.

In this patch, we reuse `Element::GetPseudoElement()`, and update the
function signatures in EffectCompositor and RestyleManager.

All the following patches will replace more places with
`PseudoStyleRequest`.

Differential Revision: https://phabricator.services.mozilla.com/D228223
2024-11-25 23:46:31 +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 9ca59b79d4 Bug 1804574 - Part 1: Add auto to animation-duration longhand. r=firefox-style-system-reviewers,layout-reviewers,emilio
Also, in order to backwards-compatibility with Level 1, we have to
serialize auto as 0s for getComputedStyle in some cases, which depend on
the value of animation-timeline.

Differential Revision: https://phabricator.services.mozilla.com/D217871
2024-08-06 18:23:14 +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
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