From 58ed502b7f4de990ab00d7feaf4df5547948f23f Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 12 Aug 2014 13:50:34 +0100 Subject: [PATCH] Fix parsing of `text-decoration: none` It would previously accept and ignore garbage in the declaration value after the `none` keyword. --- src/components/style/properties/mod.rs.mako | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/style/properties/mod.rs.mako b/src/components/style/properties/mod.rs.mako index 7abc1005202..f5fc43eb34f 100644 --- a/src/components/style/properties/mod.rs.mako +++ b/src/components/style/properties/mod.rs.mako @@ -927,6 +927,11 @@ pub mod longhands { let mut result = SpecifiedValue { underline: false, overline: false, line_through: false, }; + match one_component_value(input) { + Ok(&Ident(ref value)) + if value.as_slice().eq_ignore_ascii_case("none") => return Ok(result), + _ => {} + } let mut blink = false; let mut empty = true; for component_value in input.skip_whitespace() { @@ -941,7 +946,6 @@ pub mod longhands { else { empty = false; result.line_through = true }, "blink" => if blink { return Err(()) } else { empty = false; blink = true }, - "none" => return if empty { Ok(result) } else { Err(()) }, _ => return Err(()), } }