From 8a0cf600d6cc426ad95ba05d435c5d2ffb4c14b7 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Tue, 28 May 2019 18:31:48 +0000 Subject: [PATCH] style: Animate offset-rotate. Differential Revision: https://phabricator.services.mozilla.com/D32237 --- components/style/properties/longhands/box.mako.rs | 2 +- components/style/values/computed/motion.rs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index da9e5b2e767..7bfd1fa67d5 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -390,7 +390,7 @@ ${helpers.predefined_type( "OffsetRotate", "computed::OffsetRotate::auto()", products="gecko", - animation_value_type="none", + animation_value_type="ComputedValue", gecko_pref="layout.css.motion-path.enabled", spec="https://drafts.fxtf.org/motion-1/#offset-rotate-property", servo_restyle_damage="reflow_out_of_flow" diff --git a/components/style/values/computed/motion.rs b/components/style/values/computed/motion.rs index 932d8074262..e5f82f46558 100644 --- a/components/style/values/computed/motion.rs +++ b/components/style/values/computed/motion.rs @@ -18,13 +18,25 @@ fn is_auto_zero_angle(auto: &bool, angle: &Angle) -> bool { } /// A computed offset-rotate. -#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToCss, ToResolvedValue)] +#[derive( + Animate, + Clone, + ComputeSquaredDistance, + Copy, + Debug, + MallocSizeOf, + PartialEq, + ToAnimatedZero, + ToCss, + ToResolvedValue, +)] #[repr(C)] pub struct OffsetRotate { /// If auto is false, this is a fixed angle which indicates a /// constant clockwise rotation transformation applied to it by this /// specified rotation angle. Otherwise, the angle will be added to /// the angle of the direction in layout. + #[animation(constant)] #[css(represents_keyword)] pub auto: bool, /// The angle value.