mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Don't accept an extra token at the end of transform property
This commit is contained in:
parent
0934df77fd
commit
51066436fa
2 changed files with 8 additions and 1 deletions
|
@ -956,7 +956,7 @@ ${helpers.predefined_type("scroll-snap-coordinate",
|
|||
|
||||
let mut result = Vec::new();
|
||||
loop {
|
||||
let name = match input.expect_function() {
|
||||
let name = match input.try(|i| i.expect_function()) {
|
||||
Ok(name) => name,
|
||||
Err(_) => break,
|
||||
};
|
||||
|
|
|
@ -31,3 +31,10 @@ fn test_transform_translate() {
|
|||
assert!(parse(transform::parse, "translate(2px foo)").is_err());
|
||||
assert!(parse(transform::parse, "perspective(-10px)").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unexhausted_transform() {
|
||||
use style::properties::longhands::transform;
|
||||
assert_parser_exhausted!(transform::parse, "rotate(70deg)foo", false);
|
||||
assert_parser_exhausted!(transform::parse, "rotate(70deg) foo", false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue