style: Add animation-timeline: view() in style system

Support view() notation for animation-timeline:
  `<view()> = view( [ <axis> || <'view-timeline-inset'> ]? )`

We move AnimationTimeline and its related types into the generics folder,
and define two new structs for scroll() and view().

Note:
1. The syntax of scroll() doesn't match the current version of the spec.
    I will update it in Bug 1814444.
2. We will handle the creation/usage of the Anonymous View Progress Timelines
    in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D173904
This commit is contained in:
Boris Chiou 2023-05-02 22:47:28 +00:00 committed by Martin Robinson
parent 115a45f8eb
commit 9fd6f09a41
3 changed files with 184 additions and 51 deletions

View file

@ -11,7 +11,7 @@ use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
pub use crate::values::specified::animation::{
AnimationName, AnimationTimeline, ScrollAxis, ScrollTimelineName, TransitionProperty,
AnimationName, ScrollAxis, ScrollTimelineName, TransitionProperty,
};
/// A computed value for the `animation-iteration-count` property.
@ -62,5 +62,8 @@ impl ToCss for AnimationIterationCount {
}
}
/// A computed value for the `animation-timeline` property.
pub type AnimationTimeline = generics::GenericAnimationTimeline<LengthPercentage>;
/// A computed value for the `view-timeline-inset` property.
pub type ViewTimelineInset = generics::GenericViewTimelineInset<LengthPercentage>;