From 7f073456f9b0acb528920cf15873f5a71d85c6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 7 Nov 2017 13:28:06 +0100 Subject: [PATCH] style: respect allow_quirks for boxed properties. This will unblock #19119 --- components/style/properties/helpers.mako.rs | 34 +++++++++++++-------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 559034078ce..74df70469a6 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -402,22 +402,30 @@ % endif } % if not property.derived_from: - pub fn parse_specified<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) - % if property.boxed: - -> Result, ParseError<'i>> { - parse(context, input).map(|result| Box::new(result)) + pub fn parse_specified<'i, 't>( + context: &ParserContext, + input: &mut Parser<'i, 't>, + % if property.boxed: + ) -> Result, ParseError<'i>> { + % else: + ) -> Result> { + % endif + % if property.allow_quirks: + parse_quirky(context, input, specified::AllowQuirks::Yes) % else: - -> Result> { - % if property.allow_quirks: - parse_quirky(context, input, specified::AllowQuirks::Yes) - % else: - parse(context, input) - % endif + parse(context, input) + % endif + % if property.boxed: + .map(Box::new) % endif } - pub fn parse_declared<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) - -> Result> { - parse_specified(context, input).map(PropertyDeclaration::${property.camel_case}) + + pub fn parse_declared<'i, 't>( + context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result> { + parse_specified(context, input) + .map(PropertyDeclaration::${property.camel_case}) } % endif }