diff options
-rw-r--r-- | components/style/properties/gecko.mako.rs | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 56244d89829..e8ba39fa9e1 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -1342,6 +1342,24 @@ fn static_assert() { ${impl_copy_animation_or_transition_value(type, ident, gecko_ffi_name)} </%def> +<%def name="impl_animation_or_transition_timing_function(type)"> + pub fn set_${type}_timing_function(&mut self, v: longhands::${type}_timing_function::computed_value::T) { + debug_assert!(!v.0.is_empty()); + unsafe { self.gecko.m${type.capitalize()}s.ensure_len(v.0.len()) }; + + self.gecko.m${type.capitalize()}TimingFunctionCount = v.0.len() as u32; + for (servo, gecko) in v.0.into_iter().zip(self.gecko.m${type.capitalize()}s.iter_mut()) { + gecko.mTimingFunction = servo.into(); + } + } + ${impl_animation_or_transition_count(type, 'timing_function', 'TimingFunction')} + ${impl_copy_animation_or_transition_value(type, 'timing_function', 'TimingFunction')} + pub fn ${type}_timing_function_at(&self, index: usize) + -> longhands::${type}_timing_function::computed_value::SingleComputedValue { + self.gecko.m${type.capitalize()}s[index].mTimingFunction.into() + } +</%def> + <%def name="impl_transition_time_value(ident, gecko_ffi_name)"> ${impl_animation_or_transition_time_value('transition', ident, gecko_ffi_name)} </%def> @@ -1358,6 +1376,10 @@ fn static_assert() { ${impl_animation_or_transition_time_value('animation', ident, gecko_ffi_name)} </%def> +<%def name="impl_animation_timing_function()"> + ${impl_animation_or_transition_timing_function('animation')} +</%def> + <%def name="impl_animation_keyword(ident, gecko_ffi_name, keyword, cast_type='u8')"> #[allow(non_snake_case)] pub fn set_animation_${ident}(&mut self, v: longhands::animation_${ident}::computed_value::T) { @@ -1817,21 +1839,7 @@ fn static_assert() { ${impl_animation_count('iteration_count', 'IterationCount')} ${impl_copy_animation_value('iteration_count', 'IterationCount')} - pub fn set_animation_timing_function(&mut self, v: longhands::animation_timing_function::computed_value::T) { - debug_assert!(!v.0.is_empty()); - unsafe { self.gecko.mAnimations.ensure_len(v.0.len()) }; - - self.gecko.mAnimationTimingFunctionCount = v.0.len() as u32; - for (servo, gecko) in v.0.into_iter().zip(self.gecko.mAnimations.iter_mut()) { - gecko.mTimingFunction = servo.into(); - } - } - ${impl_animation_count('timing_function', 'TimingFunction')} - ${impl_copy_animation_value('timing_function', 'TimingFunction')} - pub fn animation_timing_function_at(&self, index: usize) - -> longhands::animation_timing_function::computed_value::SingleComputedValue { - self.gecko.mAnimations[index].mTimingFunction.into() - } + ${impl_animation_timing_function()} <% scroll_snap_type_keyword = Keyword("scroll-snap-type", "none mandatory proximity") %> |