From 1eb24f1adc2ec87a82430bed121ba0fd2d462fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 8 Mar 2017 17:07:54 +0100 Subject: [PATCH] style: Allow trailing whitespace in a calc expression. --- components/style/values/specified/length.rs | 3 +++ 1 file changed, 3 insertions(+) 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)));