servo: Merge #17262 - Update bindings for StyleImageLayerRepeat (from Manishearth:bindings); r=Manishearth
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 09 Jun 2017 15:56:10 -0700
changeset 411426 f627e18598c3ccd3c086865186459eda991fca0b
parent 411425 53bc47324ae04505287898b760a069989f214a04
child 411427 2d949a67f1fce4d5d03de6631bc55127095cf10a
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
bugs17262, 1371354
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #17262 - Update bindings for StyleImageLayerRepeat (from Manishearth:bindings); r=Manishearth https://bugzilla.mozilla.org/show_bug.cgi?id=1371354 Source-Repo: https://github.com/servo/servo Source-Revision: ff17af064b672482e12d98ec474e2dc0013cb17f
servo/components/style/gecko/generated/structs_debug.rs
servo/components/style/gecko/generated/structs_release.rs
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/gecko/generated/structs_debug.rs
+++ b/servo/components/style/gecko/generated/structs_debug.rs
@@ -253,23 +253,16 @@ pub mod root {
     pub const NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING:
               ::std::os::raw::c_uint =
         127;
     pub const NS_STYLE_IMAGELAYER_POSITION_CENTER: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_IMAGELAYER_POSITION_TOP: ::std::os::raw::c_uint = 2;
     pub const NS_STYLE_IMAGELAYER_POSITION_BOTTOM: ::std::os::raw::c_uint = 4;
     pub const NS_STYLE_IMAGELAYER_POSITION_LEFT: ::std::os::raw::c_uint = 8;
     pub const NS_STYLE_IMAGELAYER_POSITION_RIGHT: ::std::os::raw::c_uint = 16;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT: ::std::os::raw::c_uint =
-        0;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_X: ::std::os::raw::c_uint = 1;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_Y: ::std::os::raw::c_uint = 2;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT: ::std::os::raw::c_uint = 3;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_SPACE: ::std::os::raw::c_uint = 4;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_ROUND: ::std::os::raw::c_uint = 5;
     pub const NS_STYLE_IMAGELAYER_SIZE_CONTAIN: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_IMAGELAYER_SIZE_COVER: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_MASK_MODE_ALPHA: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_MASK_MODE_LUMINANCE: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_MASK_MODE_MATCH_SOURCE: ::std::os::raw::c_uint = 2;
     pub const NS_STYLE_BG_INLINE_POLICY_EACH_BOX: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_BG_INLINE_POLICY_CONTINUOUS: ::std::os::raw::c_uint =
         1;
@@ -6415,16 +6408,26 @@ pub mod root {
         pub enum StyleOrient {
             Inline = 0,
             Block = 1,
             Horizontal = 2,
             Vertical = 3,
         }
         #[repr(u8)]
         #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+        pub enum StyleImageLayerRepeat {
+            NoRepeat = 0,
+            RepeatX = 1,
+            RepeatY = 2,
+            Repeat = 3,
+            Space = 4,
+            Round = 5,
+        }
+        #[repr(u8)]
+        #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
         pub enum StyleDisplay {
             None = 0,
             Block = 1,
             FlowRoot = 2,
             Inline = 3,
             InlineBlock = 4,
             ListItem = 5,
             Table = 6,
@@ -29972,18 +29975,18 @@ pub mod root {
                     mHeightType ) ));
     }
     impl Clone for nsStyleImageLayers_Size {
         fn clone(&self) -> Self { *self }
     }
     #[repr(C)]
     #[derive(Debug, Copy)]
     pub struct nsStyleImageLayers_Repeat {
-        pub mXRepeat: u8,
-        pub mYRepeat: u8,
+        pub mXRepeat: root::mozilla::StyleImageLayerRepeat,
+        pub mYRepeat: root::mozilla::StyleImageLayerRepeat,
     }
     #[test]
     fn bindgen_test_layout_nsStyleImageLayers_Repeat() {
         assert_eq!(::std::mem::size_of::<nsStyleImageLayers_Repeat>() , 2usize
                    , concat ! (
                    "Size of: " , stringify ! ( nsStyleImageLayers_Repeat ) ));
         assert_eq! (::std::mem::align_of::<nsStyleImageLayers_Repeat>() ,
                     1usize , concat ! (
--- a/servo/components/style/gecko/generated/structs_release.rs
+++ b/servo/components/style/gecko/generated/structs_release.rs
@@ -253,23 +253,16 @@ pub mod root {
     pub const NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING:
               ::std::os::raw::c_uint =
         127;
     pub const NS_STYLE_IMAGELAYER_POSITION_CENTER: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_IMAGELAYER_POSITION_TOP: ::std::os::raw::c_uint = 2;
     pub const NS_STYLE_IMAGELAYER_POSITION_BOTTOM: ::std::os::raw::c_uint = 4;
     pub const NS_STYLE_IMAGELAYER_POSITION_LEFT: ::std::os::raw::c_uint = 8;
     pub const NS_STYLE_IMAGELAYER_POSITION_RIGHT: ::std::os::raw::c_uint = 16;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT: ::std::os::raw::c_uint =
-        0;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_X: ::std::os::raw::c_uint = 1;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT_Y: ::std::os::raw::c_uint = 2;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_REPEAT: ::std::os::raw::c_uint = 3;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_SPACE: ::std::os::raw::c_uint = 4;
-    pub const NS_STYLE_IMAGELAYER_REPEAT_ROUND: ::std::os::raw::c_uint = 5;
     pub const NS_STYLE_IMAGELAYER_SIZE_CONTAIN: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_IMAGELAYER_SIZE_COVER: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_MASK_MODE_ALPHA: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_MASK_MODE_LUMINANCE: ::std::os::raw::c_uint = 1;
     pub const NS_STYLE_MASK_MODE_MATCH_SOURCE: ::std::os::raw::c_uint = 2;
     pub const NS_STYLE_BG_INLINE_POLICY_EACH_BOX: ::std::os::raw::c_uint = 0;
     pub const NS_STYLE_BG_INLINE_POLICY_CONTINUOUS: ::std::os::raw::c_uint =
         1;
@@ -6271,16 +6264,26 @@ pub mod root {
         pub enum StyleOrient {
             Inline = 0,
             Block = 1,
             Horizontal = 2,
             Vertical = 3,
         }
         #[repr(u8)]
         #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+        pub enum StyleImageLayerRepeat {
+            NoRepeat = 0,
+            RepeatX = 1,
+            RepeatY = 2,
+            Repeat = 3,
+            Space = 4,
+            Round = 5,
+        }
+        #[repr(u8)]
+        #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
         pub enum StyleDisplay {
             None = 0,
             Block = 1,
             FlowRoot = 2,
             Inline = 3,
             InlineBlock = 4,
             ListItem = 5,
             Table = 6,
@@ -29427,18 +29430,18 @@ pub mod root {
                     mHeightType ) ));
     }
     impl Clone for nsStyleImageLayers_Size {
         fn clone(&self) -> Self { *self }
     }
     #[repr(C)]
     #[derive(Debug, Copy)]
     pub struct nsStyleImageLayers_Repeat {
-        pub mXRepeat: u8,
-        pub mYRepeat: u8,
+        pub mXRepeat: root::mozilla::StyleImageLayerRepeat,
+        pub mYRepeat: root::mozilla::StyleImageLayerRepeat,
     }
     #[test]
     fn bindgen_test_layout_nsStyleImageLayers_Repeat() {
         assert_eq!(::std::mem::size_of::<nsStyleImageLayers_Repeat>() , 2usize
                    , concat ! (
                    "Size of: " , stringify ! ( nsStyleImageLayers_Repeat ) ));
         assert_eq! (::std::mem::align_of::<nsStyleImageLayers_Repeat>() ,
                     1usize , concat ! (
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -2923,35 +2923,32 @@ fn static_assert() {
         else:
             image_layers_field = "mMask"
             struct_name = "SVG"
     %>
 
     <%self:simple_image_array_property name="repeat" shorthand="${shorthand}" field_name="mRepeat">
         use properties::longhands::${shorthand}_repeat::single_value::computed_value::RepeatKeyword;
         use gecko_bindings::structs::nsStyleImageLayers_Repeat;
-        use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_REPEAT;
-        use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT;
-        use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_SPACE;
-        use gecko_bindings::structs::NS_STYLE_IMAGELAYER_REPEAT_ROUND;
-
-        fn to_ns(repeat: RepeatKeyword) -> u32 {
+        use gecko_bindings::structs::StyleImageLayerRepeat;
+
+        fn to_ns(repeat: RepeatKeyword) -> StyleImageLayerRepeat {
             match repeat {
-                RepeatKeyword::Repeat => NS_STYLE_IMAGELAYER_REPEAT_REPEAT,
-                RepeatKeyword::Space => NS_STYLE_IMAGELAYER_REPEAT_SPACE,
-                RepeatKeyword::Round => NS_STYLE_IMAGELAYER_REPEAT_ROUND,
-                RepeatKeyword::NoRepeat => NS_STYLE_IMAGELAYER_REPEAT_NO_REPEAT,
+                RepeatKeyword::Repeat => StyleImageLayerRepeat::Repeat,
+                RepeatKeyword::Space => StyleImageLayerRepeat::Space,
+                RepeatKeyword::Round => StyleImageLayerRepeat::Round,
+                RepeatKeyword::NoRepeat => StyleImageLayerRepeat::NoRepeat,
             }
         }
 
         let repeat_x = to_ns(servo.0);
         let repeat_y = to_ns(servo.1);
         nsStyleImageLayers_Repeat {
-              mXRepeat: repeat_x as u8,
-              mYRepeat: repeat_y as u8,
+              mXRepeat: repeat_x,
+              mYRepeat: repeat_y,
         }
     </%self:simple_image_array_property>
 
     <% impl_simple_image_array_property("clip", shorthand, image_layers_field, "mClip", struct_name) %>
     <% impl_simple_image_array_property("origin", shorthand, image_layers_field, "mOrigin", struct_name) %>
 
     % for orientation in ["x", "y"]:
     pub fn copy_${shorthand}_position_${orientation}_from(&mut self, other: &Self) {