From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../components/style/values/specified/animation.rs | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'servo/components/style/values/specified/animation.rs') diff --git a/servo/components/style/values/specified/animation.rs b/servo/components/style/values/specified/animation.rs index e7bbf26fb3..5a1f5003f3 100644 --- a/servo/components/style/values/specified/animation.rs +++ b/servo/components/style/values/specified/animation.rs @@ -112,6 +112,44 @@ impl TransitionProperty { } } +/// A specified value for . +/// +/// https://drafts.csswg.org/css-transitions-2/#transition-behavior-property +#[derive( + Clone, + Copy, + Debug, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, + ToResolvedValue, + ToShmem, +)] +#[repr(u8)] +pub enum TransitionBehavior { + /// Transitions will not be started for discrete properties, only for interpolable properties. + Normal, + /// Transitions will be started for discrete properties as well as interpolable properties. + AllowDiscrete, +} + +impl TransitionBehavior { + /// Return normal, the initial value. + #[inline] + pub fn normal() -> Self { + Self::Normal + } + + /// Return true if it is normal. + #[inline] + pub fn is_normal(&self) -> bool { + matches!(*self, Self::Normal) + } +} + /// https://drafts.csswg.org/css-animations/#animation-iteration-count #[derive(Copy, Clone, Debug, MallocSizeOf, PartialEq, Parse, SpecifiedValueInfo, ToCss, ToShmem)] pub enum AnimationIterationCount { -- cgit v1.2.3