style: Hook named scroll timelines to animation-timeline

Basically, animation-timeline could be
1. auto
2. none
3. <timeline-name>

We extend the <timeline-name> to cover both @scroll-timeline rule and
scroll-timeline-name property. We check @scroll-timeline rule first. If
it doesn't exist, we check scroll-timeline-name of the element itself,
the previous silbings, and their ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D146358
This commit is contained in:
Boris Chiou 2022-06-13 20:26:45 +00:00 committed by Martin Robinson
parent 13acff77d1
commit 82d7f2154d

View file

@ -815,9 +815,13 @@ fn is_default<T: Default + PartialEq>(value: &T) -> bool {
pub enum AnimationTimeline { pub enum AnimationTimeline {
/// Use default timeline. The animations timeline is a DocumentTimeline. /// Use default timeline. The animations timeline is a DocumentTimeline.
Auto, Auto,
/// The scroll-timeline name /// The scroll-timeline name.
///
/// Note: This could be the timeline name from @scroll-timeline rule, or scroll-timeline-name
/// from itself, its ancestors, or its previous siblings.
/// https://drafts.csswg.org/scroll-animations-1/rewrite#scroll-timelines-named
Timeline(TimelineName), Timeline(TimelineName),
/// The scroll() notation /// The scroll() notation.
/// https://drafts.csswg.org/scroll-animations-1/rewrite#scroll-notation /// https://drafts.csswg.org/scroll-animations-1/rewrite#scroll-notation
#[css(function)] #[css(function)]
Scroll( Scroll(