mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: bonus: Fix parsing of steps() function.
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
This commit is contained in:
parent
411ae84908
commit
8bbebd0514
2 changed files with 9 additions and 11 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue