From d06ffc22897f0e3128020482a9fd2dadd5fa4d9b Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 2 Feb 2017 16:07:49 +1100 Subject: [PATCH] Parse value entirely for setting property via CSSOM Fixes #15037 --- components/style/properties/declaration_block.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 0128338dcfd4a..e4b5b6be586ce 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -520,11 +520,13 @@ pub fn parse_one_declaration(id: PropertyId, extra_data: ParserContextExtraData) -> Result, ()> { let context = ParserContext::new_with_extra_data(Origin::Author, base_url, error_reporter, extra_data); - let mut results = vec![]; - match PropertyDeclaration::parse(id, &context, &mut Parser::new(input), &mut results, false) { - PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results), - _ => Err(()) - } + Parser::new(input).parse_entirely(|parser| { + let mut results = vec![]; + match PropertyDeclaration::parse(id, &context, parser, &mut results, false) { + PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => Ok(results), + _ => Err(()) + } + }) } /// A struct to parse property declarations.