Skip to content

Commit

Permalink
Don't accept an extra token at the end of transform property
Browse files Browse the repository at this point in the history
  • Loading branch information
canova committed Jun 7, 2017
1 parent 0934df7 commit 5106643
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion components/style/properties/longhand/box.mako.rs
Expand Up @@ -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,
};
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/style/parsing/box_.rs
Expand Up @@ -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);
}

0 comments on commit 5106643

Please sign in to comment.