servo: Merge #19136 - style: respect allow_quirks for boxed properties (from emilio:allow-quirks-box); r=SimonSapin
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 07 Nov 2017 07:29:15 -0600
changeset 443817 059f6f6a4ef55c40674ece3d1da45702a0811a47
parent 443816 888caf45e5efb1d4cb7c816e7d61e5895a02c13e
child 443818 16b3860f4f841f12db5d6302f15fc4d44ee31572
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersSimonSapin
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #19136 - style: respect allow_quirks for boxed properties (from emilio:allow-quirks-box); r=SimonSapin This will unblock #19119 Source-Repo: https://github.com/servo/servo Source-Revision: 254c659250e4dacdee5897399a651649cec80c4a
servo/components/style/properties/helpers.mako.rs
--- a/servo/components/style/properties/helpers.mako.rs
+++ b/servo/components/style/properties/helpers.mako.rs
@@ -397,32 +397,40 @@
                 % if property.custom_cascade:
                     cascade_property_custom(declaration, context);
                 % endif
             % else:
                 // Do not allow stylesheets to set derived properties.
             % endif
         }
         % if not property.derived_from:
-            pub fn parse_specified<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
-                % if property.boxed:
-                                   -> Result<Box<SpecifiedValue>, 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<Box<SpecifiedValue>, ParseError<'i>> {
+            % else:
+            ) -> Result<SpecifiedValue, ParseError<'i>> {
+            % endif
+                % if property.allow_quirks:
+                    parse_quirky(context, input, specified::AllowQuirks::Yes)
                 % else:
-                                   -> Result<SpecifiedValue, ParseError<'i>> {
-                    % 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<PropertyDeclaration, ParseError<'i>> {
-                parse_specified(context, input).map(PropertyDeclaration::${property.camel_case})
+
+            pub fn parse_declared<'i, 't>(
+                context: &ParserContext,
+                input: &mut Parser<'i, 't>,
+            ) -> Result<PropertyDeclaration, ParseError<'i>> {
+                parse_specified(context, input)
+                    .map(PropertyDeclaration::${property.camel_case})
             }
         % endif
     }
 </%def>
 
 <%def name="single_keyword_system(name, values, **kwargs)">
     <%
         keyword_kwargs = {a: kwargs.pop(a, None) for a in [