From 82d7f2154d40899fa2fc0a85aba1de4d08d62aa8 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Mon, 13 Jun 2022 20:26:45 +0000 Subject: [PATCH] style: Hook named scroll timelines to animation-timeline Basically, animation-timeline could be 1. auto 2. none 3. We extend the 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 --- components/style/values/specified/box.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index c9583c96235..0fbb030143e 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -815,9 +815,13 @@ fn is_default(value: &T) -> bool { pub enum AnimationTimeline { /// Use default timeline. The animation’s timeline is a DocumentTimeline. 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), - /// The scroll() notation + /// The scroll() notation. /// https://drafts.csswg.org/scroll-animations-1/rewrite#scroll-notation #[css(function)] Scroll(