Allow animation-name to be omitted from shorthand draft
authorXidorn Quan <me@upsuper.org>
Fri, 03 Mar 2017 18:24:05 +1100
changeset 494022 a9607d965d75ae35ede723479ff07462ed984241
parent 494021 bd61684f07f9cba13a9e31617c5c8cf54628d969
child 494023 78b31eec43fca55f2a62be31c19c8e0c844ae0b9
push id47899
push userxquan@mozilla.com
push dateMon, 06 Mar 2017 10:53:41 +0000
milestone54.0a1
Allow animation-name to be omitted from shorthand MozReview-Commit-ID: Hlcvj7LWmVZ
servo/components/style/properties/shorthand/box.mako.rs
--- a/servo/components/style/properties/shorthand/box.mako.rs
+++ b/servo/components/style/properties/shorthand/box.mako.rs
@@ -193,38 +193,35 @@ macro_rules! try_parse_one {
                 try_parse_one!(input, direction, animation_direction);
                 try_parse_one!(input, fill_mode, animation_fill_mode);
                 try_parse_one!(input, play_state, animation_play_state);
                 try_parse_one!(context, input, name, animation_name);
 
                 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![];
         let mut durations = vec![];
         let mut timing_functions = vec![];
         let mut delays = vec![];
         let mut iteration_counts = vec![];
         let mut directions = vec![];