From 6e36a62c8cc8859555b15ca78a1861c1a926c55f Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 21 Apr 2017 21:49:41 +0200 Subject: [PATCH] Use all for the default value of transition-property in transition --- .../style/properties/longhand/box.mako.rs | 4 ++++ .../style/properties/shorthand/box.mako.rs | 9 ++++++--- .../html/transition-001.htm.ini | 17 ----------------- 3 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 tests/wpt/metadata-css/css-transitions-1_dev/html/transition-001.htm.ini diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 9f539243fd2..48dd6abe412 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -748,6 +748,10 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", SpecifiedValue::parse(input) } + pub fn get_initial_specified_value() -> SpecifiedValue { + TransitionProperty::All + } + use values::HasViewportPercentage; no_viewport_percentage!(SpecifiedValue); diff --git a/components/style/properties/shorthand/box.mako.rs b/components/style/properties/shorthand/box.mako.rs index c3d612f9d99..b5deb7891f5 100644 --- a/components/style/properties/shorthand/box.mako.rs +++ b/components/style/properties/shorthand/box.mako.rs @@ -70,19 +70,22 @@ macro_rules! try_parse_one { let mut ${prop} = None; % endfor + let mut parsed = 0; loop { + parsed += 1; + try_parse_one!(input, property, transition_property); try_parse_one!(context, input, duration, transition_duration); try_parse_one!(context, input, timing_function, transition_timing_function); try_parse_one!(context, input, delay, transition_delay); + parsed -= 1; break } - if let Some(property) = property { + if parsed != 0 { Ok(SingleTransition { - transition_property: property, - % for prop in "duration timing_function delay".split(): + % for prop in "property duration timing_function delay".split(): transition_${prop}: ${prop}.unwrap_or_else(transition_${prop}::single_value ::get_initial_specified_value), % endfor diff --git a/tests/wpt/metadata-css/css-transitions-1_dev/html/transition-001.htm.ini b/tests/wpt/metadata-css/css-transitions-1_dev/html/transition-001.htm.ini deleted file mode 100644 index 1682dd7d592..00000000000 --- a/tests/wpt/metadata-css/css-transitions-1_dev/html/transition-001.htm.ini +++ /dev/null @@ -1,17 +0,0 @@ -[transition-001.htm] - type: testharness - [parse '1s'] - expected: FAIL - - [parse '1s 2s'] - expected: FAIL - - [parse '1s 2s ease-in'] - expected: FAIL - - [parse '1s ease-in 2s'] - expected: FAIL - - [parse 'ease-in 1s 2s'] - expected: FAIL -