From a06b3f2039fa004eb7db12ff127f496498d9b65a Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 2 Mar 2017 17:59:27 +1100 Subject: [PATCH] Allow animation-name to be omitted from shorthand --- .../style/properties/shorthand/box.mako.rs | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/components/style/properties/shorthand/box.mako.rs b/components/style/properties/shorthand/box.mako.rs index 3bb821fe737..0fa958952cd 100644 --- a/components/style/properties/shorthand/box.mako.rs +++ b/components/style/properties/shorthand/box.mako.rs @@ -198,28 +198,25 @@ macro_rules! try_parse_one { break } - if let Some(name) = name { - Ok(SingleAnimation { - animation_name: name, - animation_duration: - duration.unwrap_or_else(animation_duration::single_value::get_initial_value), - animation_timing_function: - timing_function.unwrap_or_else(animation_timing_function::single_value - ::get_initial_specified_value), - animation_delay: - delay.unwrap_or_else(animation_delay::single_value::get_initial_value), - animation_iteration_count: - iteration_count.unwrap_or_else(animation_iteration_count::single_value::get_initial_value), - animation_direction: - direction.unwrap_or_else(animation_direction::single_value::get_initial_value), - animation_fill_mode: - fill_mode.unwrap_or_else(animation_fill_mode::single_value::get_initial_value), - animation_play_state: - play_state.unwrap_or_else(animation_play_state::single_value::get_initial_value), - }) - } else { - Err(()) - } + Ok(SingleAnimation { + animation_name: + name.unwrap_or_else(animation_name::single_value::get_initial_specified_value), + animation_duration: + duration.unwrap_or_else(animation_duration::single_value::get_initial_value), + animation_timing_function: + timing_function.unwrap_or_else(animation_timing_function::single_value + ::get_initial_specified_value), + animation_delay: + delay.unwrap_or_else(animation_delay::single_value::get_initial_value), + animation_iteration_count: + iteration_count.unwrap_or_else(animation_iteration_count::single_value::get_initial_value), + animation_direction: + direction.unwrap_or_else(animation_direction::single_value::get_initial_value), + animation_fill_mode: + fill_mode.unwrap_or_else(animation_fill_mode::single_value::get_initial_value), + animation_play_state: + play_state.unwrap_or_else(animation_play_state::single_value::get_initial_value), + }) } let mut names = vec![];