From 7099743bbf04d066636acebe9f985628bb4e338e Mon Sep 17 00:00:00 2001 From: Ravi Shankar Date: Wed, 15 Feb 2017 13:26:39 +0530 Subject: [PATCH] Cleanup grid mako --- .../properties/longhand/position.mako.rs | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/components/style/properties/longhand/position.mako.rs b/components/style/properties/longhand/position.mako.rs index ef52ce99d36..002669b1f6f 100644 --- a/components/style/properties/longhand/position.mako.rs +++ b/components/style/properties/longhand/position.mako.rs @@ -255,28 +255,21 @@ ${helpers.predefined_type("object-position", spec="https://drafts.csswg.org/css-images-3/#the-object-position", animatable=True)} -<% grid_longhands = ["grid-row-start", "grid-row-end", "grid-column-start", "grid-column-end"] %> +% for kind in ["row", "column"]: + ${helpers.predefined_type("grid-%s-gap" % kind, + "LengthOrPercentage", + "computed::LengthOrPercentage::Length(Au(0))", + spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-gap" % kind, + animatable=True, + products="gecko")} -% for longhand in grid_longhands: - ${helpers.predefined_type("%s" % longhand, - "GridLine", - "Default::default()", - animatable=False, - spec="https://drafts.csswg.org/css-grid/#propdef-%s" % longhand, - products="gecko", - boxed=True)} + % for range in ["start", "end"]: + ${helpers.predefined_type("grid-%s-%s" % (kind, range), + "GridLine", + "Default::default()", + animatable=False, + spec="https://drafts.csswg.org/css-grid/#propdef-grid-%s-%s" % (kind, range), + products="gecko", + boxed=True)} + % endfor % endfor - -${helpers.predefined_type("grid-row-gap", - "LengthOrPercentage", - "computed::LengthOrPercentage::Length(Au(0))", - spec="https://drafts.csswg.org/css-grid/#propdef-grid-row-gap", - animatable=True, - products="gecko")} - -${helpers.predefined_type("grid-column-gap", - "LengthOrPercentage", - "computed::LengthOrPercentage::Length(Au(0))", - spec="https://drafts.csswg.org/css-grid/#propdef-grid-column-gap", - animatable=True, - products="gecko")}