diff --git a/components/style/values/specified/length.rs b/components/style/values/specified/length.rs index 42d4a9c1188..1c3f7948f47 100644 --- a/components/style/values/specified/length.rs +++ b/components/style/values/specified/length.rs @@ -588,6 +588,9 @@ impl CalcLengthOrPercentage { let position = input.position(); match input.next_including_whitespace() { Ok(Token::WhiteSpace(_)) => { + if input.is_exhausted() { + break; // allow trailing whitespace + } match input.next() { Ok(Token::Delim('+')) => { products.push(try!(CalcLengthOrPercentage::parse_product(input, expected_unit)));