diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /servo/components/style/values/specified/animation.rs | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/style/values/specified/animation.rs')
-rw-r--r-- | servo/components/style/values/specified/animation.rs | 38 |
1 files changed, 38 insertions, 0 deletions
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 <transition-behavior-value>. +/// +/// 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 { |