diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 13e727c3168..89e9d1d2b2e 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -551,10 +551,9 @@ % endif -<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function, needs_context=True)"> - <%self:shorthand name="${name}" sub_properties="${ - ' '.join(sub_property_pattern % side - for side in ['top', 'right', 'bottom', 'left'])}"> +<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function, needs_context=True, **kwargs)"> + <% sub_properties=' '.join(sub_property_pattern % side for side in ['top', 'right', 'bottom', 'left']) %> + <%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)"> #[allow(unused_imports)] use parser::Parse; use super::parse_four_sides; @@ -586,7 +585,7 @@ ) } } - + <%def name="logical_setter_helper(name)"> diff --git a/components/style/properties/longhand/margin.mako.rs b/components/style/properties/longhand/margin.mako.rs index 8ddc676d21f..810386ae023 100644 --- a/components/style/properties/longhand/margin.mako.rs +++ b/components/style/properties/longhand/margin.mako.rs @@ -7,7 +7,12 @@ <% data.new_style_struct("Margin", inherited=False) %> % for side in ALL_SIDES: + <% + spec = "https://drafts.csswg.org/css-box/#propdef-margin-%s" % side[0] + if side[1]: + spec = "https://drafts.csswg.org/css-logical-props/#propdef-margin-%s" % side[1] + %> ${helpers.predefined_type("margin-%s" % side[0], "LengthOrPercentageOrAuto", "computed::LengthOrPercentageOrAuto::Length(Au(0))", - animatable=True, logical = side[1])} + animatable=True, logical = side[1], spec = spec)} % endfor diff --git a/components/style/properties/shorthand/margin.mako.rs b/components/style/properties/shorthand/margin.mako.rs index f83ccb54023..c8e11a8710d 100644 --- a/components/style/properties/shorthand/margin.mako.rs +++ b/components/style/properties/shorthand/margin.mako.rs @@ -4,4 +4,5 @@ <%namespace name="helpers" file="/helpers.mako.rs" /> -${helpers.four_sides_shorthand("margin", "margin-%s", "specified::LengthOrPercentageOrAuto::parse")} +${helpers.four_sides_shorthand("margin", "margin-%s", "specified::LengthOrPercentageOrAuto::parse", + spec="https://drafts.csswg.org/css-box/#propdef-margin")}