Don't consume invalid idents when parsing text-decoration.

This commit is contained in:
Cameron McCormack 2016-05-25 20:23:51 +10:00
parent 61fd5e79f7
commit 53a9defa9f
2 changed files with 20 additions and 15 deletions

View file

@ -75,7 +75,9 @@ ${helpers.single_keyword("unicode-bidi", "normal embed isolate bidi-override iso
} }
let mut blink = false; let mut blink = false;
let mut empty = true; let mut empty = true;
while let Ok(ident) = input.expect_ident() {
while input.try(|input| {
if let Ok(ident) = input.expect_ident() {
match_ignore_ascii_case! { ident, match_ignore_ascii_case! { ident,
"underline" => if result.underline { return Err(()) } "underline" => if result.underline { return Err(()) }
else { empty = false; result.underline = true }, else { empty = false; result.underline = true },
@ -85,9 +87,15 @@ ${helpers.single_keyword("unicode-bidi", "normal embed isolate bidi-override iso
else { empty = false; result.line_through = true }, else { empty = false; result.line_through = true },
"blink" => if blink { return Err(()) } "blink" => if blink { return Err(()) }
else { empty = false; blink = true }, else { empty = false; blink = true },
_ => break _ => return Err(())
} }
} else {
return Err(());
} }
Ok(())
}).is_ok() {
}
if !empty { Ok(result) } else { Err(()) } if !empty { Ok(result) } else { Err(()) }
} }

View file

@ -1,3 +0,0 @@
[c71-fwd-parsing-003.htm]
type: reftest
expected: FAIL