Allow animation-name to be omitted from shorthand

This commit is contained in:
Xidorn Quan 2017-03-06 22:00:55 +11:00
parent d2bb111ff2
commit bfa847bad7

View file

@ -198,28 +198,25 @@ macro_rules! try_parse_one {
break break
} }
if let Some(name) = name { Ok(SingleAnimation {
Ok(SingleAnimation { animation_name:
animation_name: name, name.unwrap_or_else(animation_name::single_value::get_initial_specified_value),
animation_duration: animation_duration:
duration.unwrap_or_else(animation_duration::single_value::get_initial_value), duration.unwrap_or_else(animation_duration::single_value::get_initial_value),
animation_timing_function: animation_timing_function:
timing_function.unwrap_or_else(animation_timing_function::single_value timing_function.unwrap_or_else(animation_timing_function::single_value
::get_initial_specified_value), ::get_initial_specified_value),
animation_delay: animation_delay:
delay.unwrap_or_else(animation_delay::single_value::get_initial_value), delay.unwrap_or_else(animation_delay::single_value::get_initial_value),
animation_iteration_count: animation_iteration_count:
iteration_count.unwrap_or_else(animation_iteration_count::single_value::get_initial_value), iteration_count.unwrap_or_else(animation_iteration_count::single_value::get_initial_value),
animation_direction: animation_direction:
direction.unwrap_or_else(animation_direction::single_value::get_initial_value), direction.unwrap_or_else(animation_direction::single_value::get_initial_value),
animation_fill_mode: animation_fill_mode:
fill_mode.unwrap_or_else(animation_fill_mode::single_value::get_initial_value), fill_mode.unwrap_or_else(animation_fill_mode::single_value::get_initial_value),
animation_play_state: animation_play_state:
play_state.unwrap_or_else(animation_play_state::single_value::get_initial_value), play_state.unwrap_or_else(animation_play_state::single_value::get_initial_value),
}) })
} else {
Err(())
}
} }
let mut names = vec![]; let mut names = vec![];