зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #17218 - Don't accept an extra token at the end of transform property (from canaltinova:transform-bug); r=emilio
The lack of `input.try` usage makes transform property to accept values like `rotate(70deg)foo`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- Either: --> - [X] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 09b4f79ed35fdd5f16a66e3524742ea55a1805bd --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : a524a59b656598665f00f1b532402810ce01dda5
This commit is contained in:
Родитель
cb5ce9d807
Коммит
5d49a4ec7a
|
@ -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);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче