Bug 1380327: Fix causes of non-determinism in gecko_properties.rs. r?Manishearth draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 12 Jul 2017 21:18:40 +0200
changeset 607698 3c83ee580c4887ae39eecf69a456f153d94d1509
parent 607472 4e5faf81f7de3e0a2f34a9f58fb1f011b0b5f4a7
child 607888 60509a5454cd671f59255bac3a07e11b7aeae1f6
push id68092
push userbmo:emilio+bugs@crisal.io
push dateWed, 12 Jul 2017 19:42:07 +0000
reviewersManishearth
bugs1380327
milestone56.0a1
Bug 1380327: Fix causes of non-determinism in gecko_properties.rs. r?Manishearth We should sort out all the different ways we have to get sides and all those nasty loops, eventually... MozReview-Commit-ID: 4lAPEGeZaik
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1168,17 +1168,17 @@ fn static_assert() {
     pub fn clone_border_image_slice(&self) -> longhands::border_image_slice::computed_value::T {
         use gecko_bindings::structs::NS_STYLE_BORDER_IMAGE_SLICE_FILL;
         use values::computed::{BorderImageSlice, NumberOrPercentage};
         type NumberOrPercentageRect = ::values::generics::rect::Rect<NumberOrPercentage>;
 
         BorderImageSlice {
             offsets:
                 NumberOrPercentageRect::from_gecko_rect(&self.gecko.mBorderImageSlice)
-                    .expect("mBorderImageSlice[${side.index}] could not convert to NumberOrPercentageRect"),
+                    .expect("mBorderImageSlice[${side}] could not convert to NumberOrPercentageRect"),
             fill: self.gecko.mBorderImageFill as u32 == NS_STYLE_BORDER_IMAGE_SLICE_FILL
         }
     }
 </%self:impl_trait>
 
 <% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>
 <%self:impl_trait style_struct_name="Margin"
                   skip_longhands="${skip_margin_longhands}">
@@ -1512,17 +1512,17 @@ fn static_assert() {
             % endfor
                 Either::First(Auto) =>
                     structs::${border_style_keyword.gecko_constant('auto')} ${border_style_keyword.maybe_cast("u8")},
         };
         ${set_gecko_property("mOutlineStyle", "result")}
 
         // NB: This is needed to correctly handling the initial value of
         // outline-width when outline-style changes, see the
-        // update_border_${side} comment for more details.
+        // update_border_${side.ident} comment for more details.
         self.gecko.mActualOutlineWidth = self.gecko.mOutlineWidth;
     }
 
     #[allow(non_snake_case)]
     pub fn copy_outline_style_from(&mut self, other: &Self) {
         self.gecko.mOutlineStyle = other.gecko.mOutlineStyle;
     }