summaryrefslogtreecommitdiffstats
path: root/servo/components/style/values/specified/animation.rs
diff options
context:
space:
mode:
Diffstat (limited to 'servo/components/style/values/specified/animation.rs')
-rw-r--r--servo/components/style/values/specified/animation.rs38
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 {