mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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))
|
Ok(TransitionTimingFunction::CubicBezier(p1, p2))
|
||||||
},
|
},
|
||||||
"steps" => {
|
"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| {
|
try!(input.parse_nested_block(|input| {
|
||||||
step_count = try!(specified::parse_integer(input));
|
step_count = try!(specified::parse_integer(input));
|
||||||
try!(input.expect_comma());
|
if input.try(|input| input.expect_comma()).is_ok() {
|
||||||
start_end = try!(match_ignore_ascii_case! {
|
start_end = try!(match_ignore_ascii_case! {
|
||||||
try!(input.expect_ident()),
|
try!(input.expect_ident()),
|
||||||
"start" => Ok(computed_value::StartEnd::Start),
|
"start" => Ok(computed_value::StartEnd::Start),
|
||||||
"end" => Ok(computed_value::StartEnd::End),
|
"end" => Ok(computed_value::StartEnd::End),
|
||||||
_ => Err(())
|
_ => Err(())
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}));
|
}));
|
||||||
Ok(TransitionTimingFunction::Steps(step_count as u32, start_end))
|
Ok(TransitionTimingFunction::Steps(step_count as u32, start_end))
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
[transition-timing-function-001.htm]
|
[transition-timing-function-001.htm]
|
||||||
type: testharness
|
type: testharness
|
||||||
[parse 'steps(3)']
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[parse 'cubic-bezier(-0.1, -0.2, -0.3, -0.4)']
|
[parse 'cubic-bezier(-0.1, -0.2, -0.3, -0.4)']
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue