Skip to content

Commit

Permalink
style: bonus: Fix parsing of steps() function.
Browse files Browse the repository at this point in the history
Still doesn't work properly (this also happened with transitions).

This is spec'd in:
https://www.w3.org/TR/css3-transitions/#transition-timing-function
  • Loading branch information
emilio committed Jul 7, 2016
1 parent 411ae84 commit 8bbebd0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
17 changes: 9 additions & 8 deletions components/style/properties/longhand/box.mako.rs
Expand Up @@ -507,16 +507,17 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto",
Ok(TransitionTimingFunction::CubicBezier(p1, p2))
},
"steps" => {
let (mut step_count, mut start_end) = (0, computed_value::StartEnd::Start);
let (mut step_count, mut start_end) = (0, computed_value::StartEnd::End);
try!(input.parse_nested_block(|input| {
step_count = try!(specified::parse_integer(input));
try!(input.expect_comma());
start_end = try!(match_ignore_ascii_case! {
try!(input.expect_ident()),
"start" => Ok(computed_value::StartEnd::Start),
"end" => Ok(computed_value::StartEnd::End),
_ => Err(())
});
if input.try(|input| input.expect_comma()).is_ok() {
start_end = try!(match_ignore_ascii_case! {
try!(input.expect_ident()),
"start" => Ok(computed_value::StartEnd::Start),
"end" => Ok(computed_value::StartEnd::End),
_ => Err(())
});
}
Ok(())
}));
Ok(TransitionTimingFunction::Steps(step_count as u32, start_end))
Expand Down
@@ -1,8 +1,5 @@
[transition-timing-function-001.htm]
type: testharness
[parse 'steps(3)']
expected: FAIL

[parse 'cubic-bezier(-0.1, -0.2, -0.3, -0.4)']
expected: FAIL

Expand Down

0 comments on commit 8bbebd0

Please sign in to comment.