Don't accept an extra token at the end of transform property

This commit is contained in:
Nazım Can Altınova 2017-06-08 02:32:45 +03:00
parent 0934df77fd
commit 51066436fa
No known key found for this signature in database
GPG key ID: AF9BCD7CE6449954
2 changed files with 8 additions and 1 deletions

View file

@ -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,
};

View file

@ -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);
}