Bug 1454591 part 3 - Consistently use top-right-bottom-left order for physical sides. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Fri, 04 May 2018 15:15:56 +1000
changeset 791365 13b76ba90225edb1713834c43b6b9309fd74587e
parent 791364 3304d221aa8378873137f1500f982e45b9f643c0
child 791366 85dec9de475c49aa525828a1ded1c46c5ff15fd4
child 791424 f8a3e47aa4d265cf670078c93993776c2439dc7e
push id108797
push userxquan@mozilla.com
push dateFri, 04 May 2018 07:07:28 +0000
reviewersheycam
bugs1454591
milestone61.0a1
Bug 1454591 part 3 - Consistently use top-right-bottom-left order for physical sides. r?heycam MozReview-Commit-ID: 6pLRSO8YNDI
servo/components/style/properties/data.py
servo/components/style/properties/helpers.mako.rs
--- a/servo/components/style/properties/data.py
+++ b/servo/components/style/properties/data.py
@@ -1,15 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import re
 
-PHYSICAL_SIDES = ["top", "left", "bottom", "right"]
+PHYSICAL_SIDES = ["top", "right", "bottom", "left"]
 LOGICAL_SIDES = ["block-start", "block-end", "inline-start", "inline-end"]
 PHYSICAL_SIZES = ["width", "height"]
 LOGICAL_SIZES = ["block-size", "inline-size"]
 
 # bool is True when logical
 ALL_SIDES = [(side, False) for side in PHYSICAL_SIDES] + [(side, True) for side in LOGICAL_SIDES]
 ALL_SIZES = [(size, False) for size in PHYSICAL_SIZES] + [(size, True) for size in LOGICAL_SIZES]
 
--- a/servo/components/style/properties/helpers.mako.rs
+++ b/servo/components/style/properties/helpers.mako.rs
@@ -754,17 +754,17 @@
 
         ${caller.body()}
     }
     % endif
 </%def>
 
 <%def name="four_sides_shorthand(name, sub_property_pattern, parser_function,
                                  needs_context=True, allow_quirks=False, **kwargs)">
-    <% sub_properties=' '.join(sub_property_pattern % side for side in ['top', 'right', 'bottom', 'left']) %>
+    <% sub_properties=' '.join(sub_property_pattern % side for side in PHYSICAL_SIDES) %>
     <%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)">
         #[allow(unused_imports)]
         use parser::Parse;
         use values::generics::rect::Rect;
         use values::specified;
 
         pub fn parse_value<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
                                    -> Result<Longhands, ParseError<'i>> {