Allow -moz-stack-sizing to work in a single direction only.

This commit is contained in:
Paolo Amadini 2017-05-16 16:25:23 +01:00
parent d855c929ef
commit 693ec08387
4 changed files with 26 additions and 25 deletions

View file

@ -185,9 +185,6 @@ pub mod root {
pub const NS_FONT_SUB_SUPER_LARGE_SIZE: f64 = 45.; pub const NS_FONT_SUB_SUPER_LARGE_SIZE: f64 = 45.;
pub const NS_FONT_VARIANT_NORMAL: ::std::os::raw::c_uint = 0; pub const NS_FONT_VARIANT_NORMAL: ::std::os::raw::c_uint = 0;
pub const NS_FONT_VARIANT_SMALL_CAPS: ::std::os::raw::c_uint = 1; pub const NS_FONT_VARIANT_SMALL_CAPS: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_STACK_SIZING_IGNORE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_STACK_SIZING_STRETCH_TO_FIT: ::std::os::raw::c_uint =
1;
pub const NS_STYLE_AZIMUTH_LEFT_SIDE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_AZIMUTH_LEFT_SIDE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_AZIMUTH_FAR_LEFT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_AZIMUTH_FAR_LEFT: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_AZIMUTH_LEFT: ::std::os::raw::c_uint = 2; pub const NS_STYLE_AZIMUTH_LEFT: ::std::os::raw::c_uint = 2;
@ -6093,6 +6090,14 @@ pub mod root {
} }
#[repr(u8)] #[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleStackSizing {
Ignore = 0,
StretchToFit = 1,
IgnoreHorizontal = 2,
IgnoreVertical = 3,
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleTextJustify { pub enum StyleTextJustify {
None = 0, None = 0,
Auto = 1, Auto = 1,
@ -30011,7 +30016,7 @@ pub mod root {
pub mBoxDirection: root::mozilla::StyleBoxDirection, pub mBoxDirection: root::mozilla::StyleBoxDirection,
pub mBoxOrient: root::mozilla::StyleBoxOrient, pub mBoxOrient: root::mozilla::StyleBoxOrient,
pub mBoxPack: root::mozilla::StyleBoxPack, pub mBoxPack: root::mozilla::StyleBoxPack,
pub mStretchStack: bool, pub mStackSizing: root::mozilla::StyleStackSizing,
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleXUL() { fn bindgen_test_layout_nsStyleXUL() {
@ -30050,10 +30055,10 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleXUL ) , "::" "Alignment of field: " , stringify ! ( nsStyleXUL ) , "::"
, stringify ! ( mBoxPack ) )); , stringify ! ( mBoxPack ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const nsStyleXUL ) ) . mStretchStack as * & ( * ( 0 as * const nsStyleXUL ) ) . mStackSizing as *
const _ as usize } , 12usize , concat ! ( const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsStyleXUL ) , "::" "Alignment of field: " , stringify ! ( nsStyleXUL ) , "::"
, stringify ! ( mStretchStack ) )); , stringify ! ( mStackSizing ) ));
} }
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -185,9 +185,6 @@ pub mod root {
pub const NS_FONT_SUB_SUPER_LARGE_SIZE: f64 = 45.; pub const NS_FONT_SUB_SUPER_LARGE_SIZE: f64 = 45.;
pub const NS_FONT_VARIANT_NORMAL: ::std::os::raw::c_uint = 0; pub const NS_FONT_VARIANT_NORMAL: ::std::os::raw::c_uint = 0;
pub const NS_FONT_VARIANT_SMALL_CAPS: ::std::os::raw::c_uint = 1; pub const NS_FONT_VARIANT_SMALL_CAPS: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_STACK_SIZING_IGNORE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_STACK_SIZING_STRETCH_TO_FIT: ::std::os::raw::c_uint =
1;
pub const NS_STYLE_AZIMUTH_LEFT_SIDE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_AZIMUTH_LEFT_SIDE: ::std::os::raw::c_uint = 0;
pub const NS_STYLE_AZIMUTH_FAR_LEFT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_AZIMUTH_FAR_LEFT: ::std::os::raw::c_uint = 1;
pub const NS_STYLE_AZIMUTH_LEFT: ::std::os::raw::c_uint = 2; pub const NS_STYLE_AZIMUTH_LEFT: ::std::os::raw::c_uint = 2;
@ -5962,6 +5959,14 @@ pub mod root {
} }
#[repr(u8)] #[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleStackSizing {
Ignore = 0,
StretchToFit = 1,
IgnoreHorizontal = 2,
IgnoreVertical = 3,
}
#[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum StyleTextJustify { pub enum StyleTextJustify {
None = 0, None = 0,
Auto = 1, Auto = 1,
@ -29501,7 +29506,7 @@ pub mod root {
pub mBoxDirection: root::mozilla::StyleBoxDirection, pub mBoxDirection: root::mozilla::StyleBoxDirection,
pub mBoxOrient: root::mozilla::StyleBoxOrient, pub mBoxOrient: root::mozilla::StyleBoxOrient,
pub mBoxPack: root::mozilla::StyleBoxPack, pub mBoxPack: root::mozilla::StyleBoxPack,
pub mStretchStack: bool, pub mStackSizing: root::mozilla::StyleStackSizing,
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleXUL() { fn bindgen_test_layout_nsStyleXUL() {
@ -29540,10 +29545,10 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleXUL ) , "::" "Alignment of field: " , stringify ! ( nsStyleXUL ) , "::"
, stringify ! ( mBoxPack ) )); , stringify ! ( mBoxPack ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const nsStyleXUL ) ) . mStretchStack as * & ( * ( 0 as * const nsStyleXUL ) ) . mStackSizing as *
const _ as usize } , 12usize , concat ! ( const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsStyleXUL ) , "::" "Alignment of field: " , stringify ! ( nsStyleXUL ) , "::"
, stringify ! ( mStretchStack ) )); , stringify ! ( mStackSizing ) ));
} }
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]

View file

@ -4199,16 +4199,7 @@ clip-path
</%self:impl_trait> </%self:impl_trait>
<%self:impl_trait style_struct_name="XUL" <%self:impl_trait style_struct_name="XUL"
skip_longhands="-moz-stack-sizing -moz-box-ordinal-group"> skip_longhands="-moz-box-ordinal-group">
#[allow(non_snake_case)]
pub fn set__moz_stack_sizing(&mut self, v: longhands::_moz_stack_sizing::computed_value::T) {
use properties::longhands::_moz_stack_sizing::computed_value::T;
self.gecko.mStretchStack = v == T::stretch_to_fit;
}
${impl_simple_copy('_moz_stack_sizing', 'mStretchStack')}
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub fn set__moz_box_ordinal_group(&mut self, v: i32) { pub fn set__moz_box_ordinal_group(&mut self, v: i32) {
self.gecko.mBoxOrdinal = v as u32; self.gecko.mBoxOrdinal = v as u32;

View file

@ -44,9 +44,9 @@ ${helpers.single_keyword("-moz-box-pack", "start center end justify",
alias="-webkit-box-pack", alias="-webkit-box-pack",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)")}
${helpers.single_keyword("-moz-stack-sizing", "stretch-to-fit ignore", ${helpers.single_keyword("-moz-stack-sizing", "stretch-to-fit ignore ignore-horizontal ignore-vertical",
products="gecko", gecko_ffi_name="mStretchStack", products="gecko", gecko_ffi_name="mStackSizing",
gecko_constant_prefix="NS_STYLE_STACK_SIZING", gecko_enum_prefix="StyleStackSizing",
animation_value_type="none", animation_value_type="none",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-stack-sizing)")} spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-stack-sizing)")}