From c40839a24f991c6eb95777f10129ce9a7472f412 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Thu, 17 Jan 2019 21:49:07 +0100 Subject: [PATCH] style: Implement the flow-relative border-radius properties. Bug: 1520684 Reviewed-by: emilio --- .../style/properties/longhands/border.mako.rs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/components/style/properties/longhands/border.mako.rs b/components/style/properties/longhands/border.mako.rs index 79df20d78123..b9d3425f84a8 100644 --- a/components/style/properties/longhands/border.mako.rs +++ b/components/style/properties/longhands/border.mako.rs @@ -3,7 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ <%namespace name="helpers" file="/helpers.mako.rs" /> -<% from data import Keyword, Method, PHYSICAL_SIDES, ALL_SIDES, maybe_moz_logical_alias %> +<% from data import Keyword, Method, ALL_CORNERS, PHYSICAL_SIDES, ALL_SIDES, maybe_moz_logical_alias %> <% data.new_style_struct("Border", inherited=False, additional_methods=[Method("border_" + side + "_has_nonzero_width", @@ -70,17 +70,27 @@ ${helpers.gecko_keyword_conversion( )} // FIXME(#4126): when gfx supports painting it, make this Size2D -% for corner in ["top-left", "top-right", "bottom-right", "bottom-left"]: +% for corner in ALL_CORNERS: + <% + corner_name = corner[0] + is_logical = corner[1] + if is_logical: + prefixes = None + else: + prefixes = "webkit" + %> ${helpers.predefined_type( - "border-" + corner + "-radius", + "border-%s-radius" % corner_name, "BorderCornerRadius", "computed::BorderCornerRadius::zero()", "parse", - extra_prefixes="webkit", - spec="https://drafts.csswg.org/css-backgrounds/#border-%s-radius" % corner, + extra_prefixes=prefixes, + spec=maybe_logical_spec(corner, "radius"), boxed=True, flags="APPLIES_TO_FIRST_LETTER", animation_value_type="BorderCornerRadius", + logical_group="border-radius", + logical=is_logical, )} % endfor