diff --git a/components/style/properties/data.py b/components/style/properties/data.py index a54bd6c25ae..fd741f9713a 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -20,7 +20,7 @@ class Keyword(object): def __init__(self, name, values, gecko_constant_prefix=None, extra_gecko_values=None, extra_servo_values=None): self.name = name - self.values = values + self.values = values.split() self.gecko_constant_prefix = gecko_constant_prefix or \ "NS_STYLE_" + self.name.upper().replace("-", "_") self.extra_gecko_values = (extra_gecko_values or "").split() @@ -41,13 +41,13 @@ class Keyword(object): raise Exception("Bad product: " + product) def gecko_constant(self, value): - return self.gecko_constant_prefix + "_" + value.upper().replace("-", "_") + return self.gecko_constant_prefix + "_" + value.replace("-moz-", "").replace("-", "_").upper() class Longhand(object): def __init__(self, style_struct, name, derived_from=None, keyword=None, custom_cascade=False, experimental=False, internal=False, - gecko_ffi_name=None): + need_clone=False, gecko_ffi_name=None): self.name = name self.keyword = keyword self.ident = to_rust_ident(name) @@ -56,6 +56,7 @@ class Longhand(object): self.experimental = ("layout.%s.enabled" % name) if experimental else None self.custom_cascade = custom_cascade self.internal = internal + self.need_clone = need_clone self.gecko_ffi_name = gecko_ffi_name or "m" + self.camel_case self.derived_from = (derived_from or "").split() diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index d2783b92a70..8f1a7820e1f 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -16,8 +16,8 @@ -<%def name="predefined_type(name, type, initial_value, parse_method='parse', products='gecko servo')"> - <%self:longhand name="${name}" products="${products}"> +<%def name="predefined_type(name, type, initial_value, parse_method='parse', **kwargs)"> + <%call expr="longhand(name, **kwargs)"> #[allow(unused_imports)] use app_units::Au; pub type SpecifiedValue = specified::${type}; @@ -29,7 +29,7 @@ -> Result { specified::${type}::${parse_method}(input) } - + <%def name="raw_longhand(*args, **kwargs)"> @@ -170,7 +170,7 @@ 'gecko_constant_prefix', 'extra_gecko_values', 'extra_servo_values' ]} %> - <%call expr="longhand(name, keyword=Keyword(name, values.split(), **keyword_kwargs), **kwargs)"> + <%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)"> pub use self::computed_value::T as SpecifiedValue; ${caller.body()} pub mod computed_value { diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 49903672754..16e8bc7a6eb 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -7,7 +7,7 @@ <% from data import Method %> <% data.new_style_struct("Border", inherited=False, gecko_ffi_name="nsStyleBorder", - additional_methods=[Method("border_" + side + "_is_none_or_hidden_and_has_nonzero_width", + additional_methods=[Method("border_" + side + "_has_nonzero_width", "bool") for side in ["top", "right", "bottom", "left"]]) %> % for side in ["top", "right", "bottom", "left"]: @@ -15,7 +15,7 @@ % endfor % for side in ["top", "right", "bottom", "left"]: - ${helpers.predefined_type("border-%s-style" % side, "BorderStyle", "specified::BorderStyle::none")} + ${helpers.predefined_type("border-%s-style" % side, "BorderStyle", "specified::BorderStyle::none", need_clone=True)} % endfor % for side in ["top", "right", "bottom", "left"]: diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 9b89fa282b8..34d425ec16e 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -9,15 +9,10 @@ <% data.new_style_struct("Box", inherited=False, gecko_ffi_name="nsStyleDisplay", - additional_methods=[Method("clone_display", "longhands::display::computed_value::T"), - Method("clone_position", "longhands::position::computed_value::T"), - Method("is_floated", "bool"), - Method("overflow_x_is_visible", "bool"), - Method("overflow_y_is_visible", "bool"), - Method("transition_count", "usize")]) %> + additional_methods=[Method("transition_count", "usize")]) %> // TODO(SimonSapin): don't parse `inline-table`, since we don't support it -<%helpers:longhand name="display" custom_cascade="${product == 'servo'}"> +<%helpers:longhand name="display" need_clone="True" custom_cascade="${product == 'servo'}"> <% values = """inline block inline-block table inline-table table-row-group table-header-group table-footer-group @@ -89,9 +84,9 @@ -${helpers.single_keyword("position", "static absolute relative fixed", extra_gecko_values="sticky")} +${helpers.single_keyword("position", "static absolute relative fixed", need_clone=True, extra_gecko_values="sticky")} -<%helpers:single_keyword_computed name="float" values="none left right" gecko_ffi_name="mFloats"> +<%helpers:single_keyword_computed name="float" values="none left right" need_clone="True" gecko_ffi_name="mFloats"> impl ToComputedValue for SpecifiedValue { type ComputedValue = computed_value::T; diff --git a/components/style/properties/longhand/outline.mako.rs b/components/style/properties/longhand/outline.mako.rs index ef3649b6b88..0b36e664a23 100644 --- a/components/style/properties/longhand/outline.mako.rs +++ b/components/style/properties/longhand/outline.mako.rs @@ -9,12 +9,12 @@ <% data.new_style_struct("Outline", inherited=False, gecko_ffi_name="nsStyleOutline", - additional_methods=[Method("outline_is_none_or_hidden_and_has_nonzero_width", "bool")]) %> + additional_methods=[Method("outline_has_nonzero_width", "bool")]) %> // TODO(pcwalton): `invert` ${helpers.predefined_type("outline-color", "CSSColor", "::cssparser::Color::CurrentColor")} -<%helpers:longhand name="outline-style"> +<%helpers:longhand name="outline-style" need_clone="True"> pub use values::specified::BorderStyle as SpecifiedValue; pub fn get_initial_value() -> SpecifiedValue { SpecifiedValue::none } pub mod computed_value { diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 0868b23f91c..9fb8e132184 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -54,15 +54,9 @@ pub mod longhands { <%include file="/longhand/padding.mako.rs" /> <%include file="/longhand/position.mako.rs" /> - <% data.new_style_struct("InheritedBox", inherited=True, gecko_ffi_name="nsStyleVisibility", - additional_methods=[Method("clone_direction", - "longhands::direction::computed_value::T"), - Method("clone_writing_mode", - "longhands::writing_mode::computed_value::T"), - Method("clone_text_orientation", - "longhands::text_orientation::computed_value::T")]) %> + <% data.new_style_struct("InheritedBox", inherited=True, gecko_ffi_name="nsStyleVisibility") %> - ${helpers.single_keyword("direction", "ltr rtl")} + ${helpers.single_keyword("direction", "ltr rtl", need_clone=True)} // CSS 2.1, Section 10 - Visual formatting model details @@ -92,10 +86,7 @@ pub mod longhands { "computed::LengthOrPercentageOrNone::None", "parse_non_negative")} - <% data.new_style_struct("InheritedText", inherited=True, gecko_ffi_name="nsStyleText", - additional_methods=([Method("clone__servo_text_decorations_in_effect", - "longhands::_servo_text_decorations_in_effect::computed_value::T")] - if product == "servo" else [])) %> + <% data.new_style_struct("InheritedText", inherited=True, gecko_ffi_name="nsStyleText") %> <%helpers:longhand name="line-height"> use cssparser::ToCss; @@ -286,10 +277,11 @@ pub mod longhands { internal=True)} // FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`. - ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", gecko_constant_prefix="NS_STYLE_OVERFLOW")} + ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", need_clone=True, + gecko_constant_prefix="NS_STYLE_OVERFLOW")} // FIXME(pcwalton, #2742): Implement scrolling for `scroll` and `auto`. - <%helpers:longhand name="overflow-y"> + <%helpers:longhand name="overflow-y" need_clone="True"> use super::overflow_x; use cssparser::ToCss; @@ -1076,11 +1068,9 @@ pub mod longhands { } - <% data.new_style_struct("Color", inherited=True, gecko_ffi_name="nsStyleColor", - additional_methods=[Method("clone_color", - "longhands::color::computed_value::T")]) %> + <% data.new_style_struct("Color", inherited=True, gecko_ffi_name="nsStyleColor") %> - <%helpers:raw_longhand name="color"> + <%helpers:raw_longhand name="color" need_clone="True"> use cssparser::Color as CSSParserColor; use cssparser::RGBA; use values::specified::{CSSColor, CSSRGBA}; @@ -1119,12 +1109,7 @@ pub mod longhands { // CSS 2.1, Section 15 - Fonts <% data.new_style_struct("Font", inherited=True, gecko_ffi_name="nsStyleFont", - additional_methods=[Method("clone_font_size", - "longhands::font_size::computed_value::T"), - Method("clone_font_weight", - "longhands::font_weight::computed_value::T"), - Method("compute_font_hash", is_mut=True)]) %> - + additional_methods=[Method("compute_font_hash", is_mut=True)]) %> <%helpers:longhand name="font-family"> use self::computed_value::FontFamily; use values::computed::ComputedValueAsSpecified; @@ -1238,7 +1223,7 @@ pub mod longhands { ${helpers.single_keyword("font-style", "normal italic oblique")} ${helpers.single_keyword("font-variant", "normal small-caps")} - <%helpers:longhand name="font-weight"> + <%helpers:longhand name="font-weight" need_clone="True"> use cssparser::ToCss; use std::fmt; @@ -1356,7 +1341,7 @@ pub mod longhands { } - <%helpers:longhand name="font-size"> + <%helpers:longhand name="font-size" need_clone="True"> use app_units::Au; use cssparser::ToCss; use std::fmt; @@ -1724,7 +1709,7 @@ pub mod longhands { <% data.switch_to_style_struct("InheritedText") %> <%helpers:longhand name="-servo-text-decorations-in-effect" - derived_from="display text-decoration" products="servo"> + derived_from="display text-decoration" need_clone="True" products="servo"> use cssparser::{RGBA, ToCss}; use std::fmt; @@ -1970,11 +1955,16 @@ pub mod longhands { // http://dev.w3.org/csswg/css-writing-modes/ <% data.switch_to_style_struct("InheritedBox") %> - ${helpers.single_keyword("writing-mode", "horizontal-tb vertical-rl vertical-lr", experimental=True)} + ${helpers.single_keyword("writing-mode", "horizontal-tb vertical-rl vertical-lr", + experimental=True, need_clone=True)} // FIXME(SimonSapin): Add 'mixed' and 'upright' (needs vertical text support) // FIXME(SimonSapin): initial (first) value should be 'mixed', when that's implemented - ${helpers.single_keyword("text-orientation", "sideways sideways-left sideways-right", experimental=True)} + // FIXME(bholley): sideways-right is needed as an alias to sideways in gecko. + ${helpers.single_keyword("text-orientation", "sideways", + experimental=True, need_clone=True, + extra_gecko_values="mixed upright", + extra_servo_values="sideways-right sideways-left")} // CSS Color Module Level 4 // https://drafts.csswg.org/css-color/ @@ -5678,6 +5668,10 @@ pub mod style_struct_traits { fn set_${longhand.ident}(&mut self, v: longhands::${longhand.ident}::computed_value::T); #[allow(non_snake_case)] fn copy_${longhand.ident}_from(&mut self, other: &Self); + % if longhand.need_clone: + #[allow(non_snake_case)] + fn clone_${longhand.ident}(&self) -> longhands::${longhand.ident}::computed_value::T; + % endif % endfor % for additional in style_struct.additional_methods: #[allow(non_snake_case)] @@ -5729,8 +5723,10 @@ pub mod style_structs { % endfor % if style_struct.trait_name == "Border": % for side in ["top", "right", "bottom", "left"]: - fn border_${side}_is_none_or_hidden_and_has_nonzero_width(&self) -> bool { - self.border_${side}_style.none_or_hidden() && + fn clone_border_${side}_style(&self) -> longhands::border_${side}_style::computed_value::T { + self.border_${side}_style.clone() + } + fn border_${side}_has_nonzero_width(&self) -> bool { self.border_${side}_width != ::app_units::Au(0) } % endfor @@ -5741,14 +5737,14 @@ pub mod style_structs { fn clone_position(&self) -> longhands::position::computed_value::T { self.position.clone() } - fn is_floated(&self) -> bool { - self.float != longhands::float::SpecifiedValue::none + fn clone_float(&self) -> longhands::float::computed_value::T { + self.float.clone() } - fn overflow_x_is_visible(&self) -> bool { - self.overflow_x == longhands::overflow_x::computed_value::T::visible + fn clone_overflow_x(&self) -> longhands::overflow_x::computed_value::T { + self.overflow_x.clone() } - fn overflow_y_is_visible(&self) -> bool { - self.overflow_y.0 == longhands::overflow_x::computed_value::T::visible + fn clone_overflow_y(&self) -> longhands::overflow_y::computed_value::T { + self.overflow_y.clone() } fn transition_count(&self) -> usize { self.transition_property.0.len() @@ -5788,8 +5784,11 @@ pub mod style_structs { self._servo_text_decorations_in_effect.clone() } % elif style_struct.trait_name == "Outline": - fn outline_is_none_or_hidden_and_has_nonzero_width(&self) -> bool { - self.outline_style.none_or_hidden() && self.outline_width != ::app_units::Au(0) + fn clone_outline_style(&self) -> longhands::outline_style::computed_value::T { + self.outline_style.clone() + } + fn outline_has_nonzero_width(&self) -> bool { + self.outline_width != ::app_units::Au(0) } % elif style_struct.trait_name == "Text": fn has_underline(&self) -> bool { @@ -6131,10 +6130,17 @@ pub fn get_writing_mode(inheritedbox_style }, } match inheritedbox_style.clone_text_orientation() { + % if product == "servo": computed_values::text_orientation::T::sideways_right => {}, computed_values::text_orientation::T::sideways_left => { flags.insert(logical_geometry::FLAG_VERTICAL_LR); }, + % elif product == "gecko": + // FIXME(bholley): Need to make sure these are correct when we add + // full writing-mode support. + computed_values::text_orientation::T::mixed => {}, + computed_values::text_orientation::T::upright => {}, + % endif computed_values::text_orientation::T::sideways => { if flags.intersects(logical_geometry::FLAG_VERTICAL_LR) { flags.insert(logical_geometry::FLAG_SIDEWAYS_LEFT); @@ -6448,7 +6454,7 @@ pub fn cascade( let positioned = matches!(style.get_box().clone_position(), longhands::position::SpecifiedValue::absolute | longhands::position::SpecifiedValue::fixed); - let floated = style.get_box().is_floated(); + let floated = style.get_box().clone_float() != longhands::float::SpecifiedValue::none; if positioned || floated || is_root_element { use computed_values::display::T; @@ -6482,7 +6488,8 @@ pub fn cascade( { use computed_values::overflow_x::T as overflow; use computed_values::overflow_y; - match (style.get_box().overflow_x_is_visible(), style.get_box().overflow_y_is_visible()) { + match (style.get_box().clone_overflow_x() == longhands::overflow_x::computed_value::T::visible, + style.get_box().clone_overflow_y().0 == longhands::overflow_x::computed_value::T::visible) { (true, true) => {} (true, _) => { style.mutate_box().set_overflow_x(overflow::auto); @@ -6497,13 +6504,15 @@ pub fn cascade( // The initial value of border-*-width may be changed at computed value time. % for side in ["top", "right", "bottom", "left"]: // Like calling to_computed_value, which wouldn't type check. - if style.get_border().border_${side}_is_none_or_hidden_and_has_nonzero_width() { + if style.get_border().clone_border_${side}_style().none_or_hidden() && + style.get_border().border_${side}_has_nonzero_width() { style.mutate_border().set_border_${side}_width(Au(0)); } % endfor // The initial value of outline width may be changed at computed value time. - if style.get_outline().outline_is_none_or_hidden_and_has_nonzero_width() { + if style.get_outline().clone_outline_style().none_or_hidden() && + style.get_outline().outline_has_nonzero_width() { style.mutate_outline().set_outline_width(Au(0)); } diff --git a/ports/geckolib/gecko_style_structs.rs b/ports/geckolib/gecko_style_structs.rs index cda95f7be86..039f1b1320a 100644 --- a/ports/geckolib/gecko_style_structs.rs +++ b/ports/geckolib/gecko_style_structs.rs @@ -1,6 +1,6 @@ /* automatically generated by rust-bindgen */ -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Debug)] pub struct __BindgenUnionField(::std::marker::PhantomData); impl __BindgenUnionField { #[inline] @@ -14,6 +14,10 @@ impl ::std::default::Default for __BindgenUnionField { #[inline] fn default() -> Self { Self::new() } } +impl ::std::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { Self::new() } +} pub const NS_ERROR_MODULE_XPCOM: ::std::os::raw::c_uint = 1; pub const NS_ERROR_MODULE_BASE: ::std::os::raw::c_uint = 2; pub const NS_ERROR_MODULE_GFX: ::std::os::raw::c_uint = 3; @@ -196,6 +200,7 @@ pub const NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL: ::std::os::raw::c_uint = 2; pub const NS_STYLE_IMAGELAYER_CLIP_BORDER: ::std::os::raw::c_uint = 0; pub const NS_STYLE_IMAGELAYER_CLIP_PADDING: ::std::os::raw::c_uint = 1; pub const NS_STYLE_IMAGELAYER_CLIP_CONTENT: ::std::os::raw::c_uint = 2; +pub const NS_STYLE_IMAGELAYER_CLIP_TEXT: ::std::os::raw::c_uint = 3; pub const NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING: ::std::os::raw::c_uint = 127; @@ -1343,7 +1348,7 @@ pub type nsASingleFragmentCString = nsCSubstring; * @see nsTAString */ #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct nsReadingIterator { pub mStart: *const CharT, pub mEnd: *const CharT, @@ -1353,7 +1358,7 @@ pub struct nsReadingIterator { * @see nsTAString */ #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct nsWritingIterator { pub mStart: *mut CharT, pub mEnd: *mut CharT, @@ -1374,6 +1379,7 @@ impl ::std::clone::Clone for nsDefaultStringComparator { fn clone(&self) -> Self { *self } } #[repr(C)] +#[derive(Debug)] pub struct nsAString_internal { pub mData: *mut ::std::os::raw::c_ushort, pub mLength: ::std::os::raw::c_uint, @@ -1411,6 +1417,7 @@ impl ::std::clone::Clone for nsDefaultCStringComparator { fn clone(&self) -> Self { *self } } #[repr(C)] +#[derive(Debug)] pub struct nsACString_internal { pub mData: *mut ::std::os::raw::c_char, pub mLength: ::std::os::raw::c_uint, @@ -1482,6 +1489,7 @@ fn bindgen_test_layout_nsCSubstringTuple() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsString { pub _base: nsAString_internal, } @@ -1505,6 +1513,7 @@ fn bindgen_test_layout_nsString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsFixedString { pub _base: nsString, pub mFixedCapacity: ::std::os::raw::c_uint, @@ -1531,11 +1540,11 @@ fn bindgen_test_layout_nsAutoString() { pub enum Dont_Instantiate_nsTArray_of { } pub enum Instead_Use_nsTArray_of { } #[repr(C)] -#[derive(Copy, Clone, Debug)] pub struct nsTArrayElementTraits<> { pub _phantom0: ::std::marker::PhantomData, } #[repr(C)] +#[derive(Debug)] pub struct nsXPIDLString { pub _base: nsString, } @@ -1545,6 +1554,7 @@ fn bindgen_test_layout_nsXPIDLString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsGetterCopies { pub mString: *mut nsAString_internal, pub mData: *mut ::std::os::raw::c_ushort, @@ -1555,6 +1565,7 @@ fn bindgen_test_layout_nsGetterCopies() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsAdoptingString { pub _base: nsXPIDLString, } @@ -1564,6 +1575,7 @@ fn bindgen_test_layout_nsAdoptingString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCString { pub _base: nsACString_internal, } @@ -1587,6 +1599,7 @@ fn bindgen_test_layout_nsCString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsFixedCString { pub _base: nsCString, pub mFixedCapacity: ::std::os::raw::c_uint, @@ -1611,6 +1624,7 @@ fn bindgen_test_layout_nsAutoCString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsXPIDLCString { pub _base: nsCString, } @@ -1620,6 +1634,7 @@ fn bindgen_test_layout_nsXPIDLCString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCGetterCopies { pub mString: *mut nsACString_internal, pub mData: *mut ::std::os::raw::c_char, @@ -1630,6 +1645,7 @@ fn bindgen_test_layout_nsCGetterCopies() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsAdoptingCString { pub _base: nsXPIDLCString, } @@ -1782,6 +1798,7 @@ pub enum nsCSSScannerExclude { eCSSScannerExclude_WhitespaceAndComments = 2, } #[repr(C)] +#[derive(Debug)] pub struct nsCSSScanner { pub mBuffer: *const ::std::os::raw::c_ushort, pub mOffset: u32, @@ -1848,16 +1865,13 @@ fn bindgen_test_layout_nsCSSGridTemplateAreaScanner() { * A "unique identifier". This is modeled after OSF DCE UUIDs. */ #[repr(C)] -#[derive(Debug, Copy)] +#[derive(Debug)] pub struct nsID { pub m0: u32, pub m1: u16, pub m2: u16, pub m3: [u8; 8usize], } -impl ::std::clone::Clone for nsID { - fn clone(&self) -> Self { *self } -} #[test] fn bindgen_test_layout_nsID() { assert_eq!(::std::mem::size_of::() , 16usize); @@ -1953,6 +1967,7 @@ fn bindgen_test_layout_nsAutoRefCnt() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct ThreadSafeAutoRefCnt { pub mValue: u64, } @@ -1990,29 +2005,30 @@ fn bindgen_test_layout_QITableEntry() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct RefPtrTraits { pub _phantom0: ::std::marker::PhantomData, } #[repr(C)] +#[derive(Debug)] pub struct RefPtr { pub mRawPtr: *mut T, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug)] pub struct RefPtr_Proxy { pub mRawPtr: *mut T, pub _phantom0: ::std::marker::PhantomData, pub _phantom1: ::std::marker::PhantomData, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct RefPtr_ConstRemovingRefPtrTraits { pub _phantom0: ::std::marker::PhantomData, pub _phantom1: ::std::marker::PhantomData, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct RefPtrGetterAddRefs { pub mTargetSmartPtr: *mut RefPtr, pub _phantom0: ::std::marker::PhantomData, @@ -2117,6 +2133,7 @@ fn bindgen_test_layout_nsGetServiceByContractIDWithError() { * template class Foo : private Foo { ... }; */ #[repr(C)] +#[derive(Debug)] pub struct nsCOMPtr_base { pub mRawPtr: *mut nsISupports, } @@ -2126,6 +2143,7 @@ fn bindgen_test_layout_nsCOMPtr_base() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCOMPtr { pub mRawPtr: *mut T, } @@ -2145,28 +2163,30 @@ pub struct nsCOMPtr { * This type should be a nested class inside |nsCOMPtr|. */ #[repr(C)] +#[derive(Debug)] pub struct nsGetterAddRefs { pub mTargetSmartPtr: *mut nsCOMPtr, pub _phantom0: ::std::marker::PhantomData, } #[repr(C)] +#[derive(Debug)] pub struct nsAutoPtr { pub mRawPtr: *mut T, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct nsAutoPtr_Ptr { pub mPtr: *mut T, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug)] pub struct nsAutoPtr_Proxy { pub mRawPtr: *mut T, pub _phantom0: ::std::marker::PhantomData, pub _phantom1: ::std::marker::PhantomData, } #[repr(C)] -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone)] pub struct nsAutoPtrGetterTransfers { pub mTargetSmartPtr: *mut nsAutoPtr, pub _phantom0: ::std::marker::PhantomData, @@ -2186,6 +2206,7 @@ fn bindgen_test_layout_PLDHashEntryHdr() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct Checker { pub mState: u32, pub mIsWritable: u32, @@ -2202,13 +2223,12 @@ pub struct PLDHashTable { pub mEntrySize: u32, pub mEntryCount: u32, pub mRemovedCount: u32, - pub mEntryStore: PLDHashTable_EntryStore, + pub mEntryStore: [u64; 2usize], pub mChecker: Checker, } #[repr(C)] pub struct PLDHashTable_EntryStore { - pub mEntryStore: *mut ::std::os::raw::c_char, - pub mGeneration: u32, + pub _bindgen_opaque_blob: [u64; 2usize], } #[test] fn bindgen_test_layout_PLDHashTable_EntryStore() { @@ -2216,6 +2236,7 @@ fn bindgen_test_layout_PLDHashTable_EntryStore() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct PLDHashTable_Iterator { pub mTable: *mut PLDHashTable, pub mStart: *mut ::std::os::raw::c_char, @@ -2346,17 +2367,13 @@ pub struct nsTHashtable { pub _phantom0: ::std::marker::PhantomData, } #[repr(C)] +#[derive(Debug)] pub struct nsTHashtable_Iterator { pub _base: PLDHashTable_Iterator, pub _phantom0: ::std::marker::PhantomData, } #[repr(C)] pub struct nsDataHashtable; -#[test] -fn bindgen_test_layout_nsDataHashtable() { - assert_eq!(::std::mem::size_of::() , 0usize); - assert_eq!(::std::mem::align_of::() , 0usize); -} pub enum CSSVariableResolver { } #[repr(C)] pub struct CSSVariableValues { @@ -2364,6 +2381,7 @@ pub struct CSSVariableValues { pub mVariables: u64, } #[repr(C)] +#[derive(Debug)] pub struct CSSVariableValues_Variable { pub mVariableName: nsString, pub mValue: nsString, @@ -2396,6 +2414,337 @@ pub enum SheetType { Count = 10, Unknown = -1, } +pub enum _cairo_surface { } +pub type cairo_surface_t = _cairo_surface; +pub enum _cairo_user_data_key { } +pub type cairo_user_data_key_t = _cairo_user_data_key; +pub type thebes_destroy_func_t = + ::std::option::Option; +/** + * Currently needs to be 'double' for Cairo compatibility. Could + * become 'float', perhaps, in some configurations. + */ +pub type gfxFloat = f64; +/** + * Priority of a line break opportunity. + * + * eNoBreak The line has no break opportunities + * eWordWrapBreak The line has a break opportunity only within a word. With + * word-wrap: break-word we will break at this point only if + * there are no other break opportunities in the line. + * eNormalBreak The line has a break opportunity determined by the standard + * line-breaking algorithm. + * + * Future expansion: split eNormalBreak into multiple priorities, e.g. + * punctuation break and whitespace break (bug 389710). + * As and when we implement it, text-wrap: unrestricted will + * mean that priorities are ignored and all line-break + * opportunities are equal. + * + * @see gfxTextRun::BreakAndMeasureText + * @see nsLineLayout::NotifyOptionalBreakPosition + */ +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum gfxBreakPriority { + eNoBreak = 0, + eWordWrapBreak = 1, + eNormalBreak = 2, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum gfxSurfaceType { + Image = 0, + PDF = 1, + PS = 2, + Xlib = 3, + Xcb = 4, + Glitz = 5, + Quartz = 6, + Win32 = 7, + BeOS = 8, + DirectFB = 9, + SVG = 10, + OS2 = 11, + Win32Printing = 12, + QuartzImage = 13, + Script = 14, + QPainter = 15, + Recording = 16, + VG = 17, + GL = 18, + DRM = 19, + Tee = 20, + XML = 21, + Skia = 22, + Subsurface = 23, + Max = 24, +} +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum gfxContentType { + COLOR = 4096, + ALPHA = 8192, + COLOR_ALPHA = 12288, + SENTINEL = 65535, +} +pub type Float = f32; +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum SurfaceType { + DATA = 0, + D2D1_BITMAP = 1, + D2D1_DRAWTARGET = 2, + CAIRO = 3, + CAIRO_IMAGE = 4, + COREGRAPHICS_IMAGE = 5, + COREGRAPHICS_CGCONTEXT = 6, + SKIA = 7, + DUAL_DT = 8, + D2D1_1_IMAGE = 9, + RECORDING = 10, + TILED = 11, +} +pub const A8R8G8B8_UINT32: SurfaceFormat = SurfaceFormat::B8G8R8A8; +pub const X8R8G8B8_UINT32: SurfaceFormat = SurfaceFormat::B8G8R8X8; +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum SurfaceFormat { + B8G8R8A8 = 0, + B8G8R8X8 = 1, + R8G8B8A8 = 2, + R8G8B8X8 = 3, + A8R8G8B8 = 4, + X8R8G8B8 = 5, + R5G6B5_UINT16 = 6, + A8 = 7, + YUV = 8, + NV12 = 9, + YUV422 = 10, + UNKNOWN = 11, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum FilterType { + BLEND = 0, + TRANSFORM = 1, + MORPHOLOGY = 2, + COLOR_MATRIX = 3, + FLOOD = 4, + TILE = 5, + TABLE_TRANSFER = 6, + DISCRETE_TRANSFER = 7, + LINEAR_TRANSFER = 8, + GAMMA_TRANSFER = 9, + CONVOLVE_MATRIX = 10, + DISPLACEMENT_MAP = 11, + TURBULENCE = 12, + ARITHMETIC_COMBINE = 13, + COMPOSITE = 14, + DIRECTIONAL_BLUR = 15, + GAUSSIAN_BLUR = 16, + POINT_DIFFUSE = 17, + POINT_SPECULAR = 18, + SPOT_DIFFUSE = 19, + SPOT_SPECULAR = 20, + DISTANT_DIFFUSE = 21, + DISTANT_SPECULAR = 22, + CROP = 23, + PREMULTIPLY = 24, + UNPREMULTIPLY = 25, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum DrawTargetType { + SOFTWARE_RASTER = 0, + HARDWARE_RASTER = 1, + VECTOR = 2, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum BackendType { + NONE = 0, + DIRECT2D = 1, + COREGRAPHICS = 2, + COREGRAPHICS_ACCELERATED = 3, + CAIRO = 4, + SKIA = 5, + RECORDING = 6, + DIRECT2D1_1 = 7, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum FontType { + DWRITE = 0, + GDI = 1, + MAC = 2, + SKIA = 3, + CAIRO = 4, + COREGRAPHICS = 5, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum NativeSurfaceType { + D3D10_TEXTURE = 0, + CAIRO_CONTEXT = 1, + CGCONTEXT = 2, + CGCONTEXT_ACCELERATED = 3, + OPENGL_TEXTURE = 4, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum NativeFontType { + DWRITE_FONT_FACE = 0, + GDI_FONT_FACE = 1, + MAC_FONT_FACE = 2, + SKIA_FONT_FACE = 3, + CAIRO_FONT_FACE = 4, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum FontStyle { NORMAL = 0, ITALIC = 1, BOLD = 2, BOLD_ITALIC = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum FontHinting { NONE = 0, LIGHT = 1, NORMAL = 2, FULL = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum CompositionOp { + OP_OVER = 0, + OP_ADD = 1, + OP_ATOP = 2, + OP_OUT = 3, + OP_IN = 4, + OP_SOURCE = 5, + OP_DEST_IN = 6, + OP_DEST_OUT = 7, + OP_DEST_OVER = 8, + OP_DEST_ATOP = 9, + OP_XOR = 10, + OP_MULTIPLY = 11, + OP_SCREEN = 12, + OP_OVERLAY = 13, + OP_DARKEN = 14, + OP_LIGHTEN = 15, + OP_COLOR_DODGE = 16, + OP_COLOR_BURN = 17, + OP_HARD_LIGHT = 18, + OP_SOFT_LIGHT = 19, + OP_DIFFERENCE = 20, + OP_EXCLUSION = 21, + OP_HUE = 22, + OP_SATURATION = 23, + OP_COLOR = 24, + OP_LUMINOSITY = 25, + OP_COUNT = 26, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum Axis { X_AXIS = 0, Y_AXIS = 1, BOTH = 2, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum ExtendMode { + CLAMP = 0, + REPEAT = 1, + REPEAT_X = 2, + REPEAT_Y = 3, + REFLECT = 4, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum FillRule { FILL_WINDING = 0, FILL_EVEN_ODD = 1, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum AntialiasMode { NONE = 0, GRAY = 1, SUBPIXEL = 2, DEFAULT = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum Filter { GOOD = 0, LINEAR = 1, POINT = 2, SENTINEL = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum PatternType { + COLOR = 0, + SURFACE = 1, + LINEAR_GRADIENT = 2, + RADIAL_GRADIENT = 3, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum JoinStyle { BEVEL = 0, ROUND = 1, MITER = 2, MITER_OR_BEVEL = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum CapStyle { BUTT = 0, ROUND = 1, SQUARE = 2, } +#[repr(i8)] +#[derive(Debug, Copy, Clone)] +pub enum SamplingBounds { UNBOUNDED = 0, BOUNDED = 1, } +#[repr(C)] +#[derive(Debug, Copy)] +pub struct Color { + pub r: Float, + pub g: Float, + pub b: Float, + pub a: Float, +} +impl ::std::clone::Clone for Color { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_Color() { + assert_eq!(::std::mem::size_of::() , 16usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +#[repr(C)] +#[derive(Debug, Copy)] +pub struct GradientStop { + pub offset: Float, + pub color: Color, +} +impl ::std::clone::Clone for GradientStop { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_GradientStop() { + assert_eq!(::std::mem::size_of::() , 20usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +#[repr(i32)] +#[derive(Debug, Copy, Clone)] +pub enum JobStatus { Complete = 0, Wait = 1, Yield = 2, Error = 3, } +pub type gfxImageFormat = SurfaceFormat; +#[repr(C)] +#[derive(Debug, Copy)] +pub struct RectCorner; +#[repr(u32)] +#[derive(Debug, Copy, Clone)] +pub enum RectCorner_Types_h_unnamed_5 { + TopLeft = 0, + TopRight = 1, + BottomRight = 2, + BottomLeft = 3, + Count = 4, +} +impl ::std::clone::Clone for RectCorner { + fn clone(&self) -> Self { *self } +} +#[repr(u32)] +#[derive(Debug, Copy, Clone)] +pub enum Side { + eSideTop = 0, + eSideRight = 1, + eSideBottom = 2, + eSideLeft = 3, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone)] +pub enum SideBits { + eSideBitsNone = 0, + eSideBitsTop = 1, + eSideBitsRight = 2, + eSideBitsBottom = 4, + eSideBitsLeft = 8, + eSideBitsTopBottom = 5, + eSideBitsLeftRight = 10, + eSideBitsAll = 15, +} pub type nscoord = i32; #[repr(C)] pub struct nsIntPoint { @@ -2518,6 +2867,7 @@ pub enum QuotedName { eQuotedName = 0, eUnquotedName = 1, } * a font type indicated named family or which generic family */ #[repr(C)] +#[derive(Debug)] pub struct FontFamilyName { pub mType: FontFamilyType, pub mName: nsString, @@ -2557,6 +2907,7 @@ fn bindgen_test_layout_gfxFontFeature() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct gfxAlternateValue { pub alternate: u32, pub value: nsString, @@ -2655,11 +3006,11 @@ impl ::std::clone::Clone for nsIURI { fn clone(&self) -> Self { *self } } pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty = - nsCSSProperty::eCSSProperty__x_text_zoom; -pub const eCSSProperty__moz_outline_radius: nsCSSProperty = + nsCSSProperty::eCSSProperty_z_index; +pub const eCSSProperty_all: nsCSSProperty = nsCSSProperty::eCSSProperty_COUNT_no_shorthands; pub const eCSSProperty_COUNT_DUMMY2: nsCSSProperty = - nsCSSProperty::eCSSProperty__moz_transform; + nsCSSProperty::eCSSProperty_transition; pub const eCSSPropertyAlias_MozTransformOrigin: nsCSSProperty = nsCSSProperty::eCSSProperty_COUNT; pub const eCSSProperty_COUNT_DUMMY3: nsCSSProperty = @@ -2670,48 +3021,48 @@ pub const eCSSPropertyExtra_no_properties: nsCSSProperty = #[derive(Debug, Copy, Clone)] pub enum nsCSSProperty { eCSSProperty_UNKNOWN = -1, - eCSSProperty_appearance = 0, - eCSSProperty__moz_outline_radius_topLeft = 1, - eCSSProperty__moz_outline_radius_topRight = 2, - eCSSProperty__moz_outline_radius_bottomRight = 3, - eCSSProperty__moz_outline_radius_bottomLeft = 4, - eCSSProperty__moz_tab_size = 5, - eCSSProperty__x_system_font = 6, - eCSSProperty_animation_delay = 7, - eCSSProperty_animation_direction = 8, - eCSSProperty_animation_duration = 9, - eCSSProperty_animation_fill_mode = 10, - eCSSProperty_animation_iteration_count = 11, - eCSSProperty_animation_name = 12, - eCSSProperty_animation_play_state = 13, - eCSSProperty_animation_timing_function = 14, - eCSSProperty_background_attachment = 15, - eCSSProperty_background_clip = 16, - eCSSProperty_background_color = 17, - eCSSProperty_background_image = 18, - eCSSProperty_background_blend_mode = 19, - eCSSProperty_background_origin = 20, - eCSSProperty_background_position = 21, - eCSSProperty_background_repeat = 22, - eCSSProperty_background_size = 23, - eCSSProperty_binding = 24, - eCSSProperty_block_size = 25, - eCSSProperty_border_block_end_color = 26, - eCSSProperty_border_block_end_style = 27, - eCSSProperty_border_block_end_width = 28, - eCSSProperty_border_block_start_color = 29, - eCSSProperty_border_block_start_style = 30, - eCSSProperty_border_block_start_width = 31, - eCSSProperty_border_bottom_color = 32, - eCSSProperty_border_bottom_colors = 33, + eCSSProperty_align_content = 0, + eCSSProperty_align_items = 1, + eCSSProperty_align_self = 2, + eCSSProperty_animation_delay = 3, + eCSSProperty_animation_direction = 4, + eCSSProperty_animation_duration = 5, + eCSSProperty_animation_fill_mode = 6, + eCSSProperty_animation_iteration_count = 7, + eCSSProperty_animation_name = 8, + eCSSProperty_animation_play_state = 9, + eCSSProperty_animation_timing_function = 10, + eCSSProperty_appearance = 11, + eCSSProperty_backface_visibility = 12, + eCSSProperty_background_attachment = 13, + eCSSProperty_background_blend_mode = 14, + eCSSProperty_background_clip = 15, + eCSSProperty_background_color = 16, + eCSSProperty_background_image = 17, + eCSSProperty_background_origin = 18, + eCSSProperty_background_position = 19, + eCSSProperty_background_repeat = 20, + eCSSProperty_background_size = 21, + eCSSProperty_binding = 22, + eCSSProperty_block_size = 23, + eCSSProperty_border_block_end_color = 24, + eCSSProperty_border_block_end_style = 25, + eCSSProperty_border_block_end_width = 26, + eCSSProperty_border_block_start_color = 27, + eCSSProperty_border_block_start_style = 28, + eCSSProperty_border_block_start_width = 29, + eCSSProperty_border_bottom_color = 30, + eCSSProperty_border_bottom_colors = 31, + eCSSProperty_border_bottom_left_radius = 32, + eCSSProperty_border_bottom_right_radius = 33, eCSSProperty_border_bottom_style = 34, eCSSProperty_border_bottom_width = 35, eCSSProperty_border_collapse = 36, - eCSSProperty_border_image_source = 37, - eCSSProperty_border_image_slice = 38, - eCSSProperty_border_image_width = 39, - eCSSProperty_border_image_outset = 40, - eCSSProperty_border_image_repeat = 41, + eCSSProperty_border_image_outset = 37, + eCSSProperty_border_image_repeat = 38, + eCSSProperty_border_image_slice = 39, + eCSSProperty_border_image_source = 40, + eCSSProperty_border_image_width = 41, eCSSProperty_border_inline_end_color = 42, eCSSProperty_border_inline_end_style = 43, eCSSProperty_border_inline_end_width = 44, @@ -2729,290 +3080,290 @@ pub enum nsCSSProperty { eCSSProperty_border_spacing = 56, eCSSProperty_border_top_color = 57, eCSSProperty_border_top_colors = 58, - eCSSProperty_border_top_style = 59, - eCSSProperty_border_top_width = 60, - eCSSProperty_border_top_left_radius = 61, - eCSSProperty_border_top_right_radius = 62, - eCSSProperty_border_bottom_right_radius = 63, - eCSSProperty_border_bottom_left_radius = 64, - eCSSProperty_bottom = 65, - eCSSProperty_box_decoration_break = 66, - eCSSProperty_box_shadow = 67, - eCSSProperty_box_sizing = 68, - eCSSProperty_caption_side = 69, - eCSSProperty_clear = 70, - eCSSProperty_clip = 71, - eCSSProperty_color = 72, - eCSSProperty_color_adjust = 73, - eCSSProperty__moz_column_count = 74, - eCSSProperty__moz_column_fill = 75, - eCSSProperty__moz_column_width = 76, - eCSSProperty__moz_column_gap = 77, - eCSSProperty__moz_column_rule_color = 78, - eCSSProperty__moz_column_rule_style = 79, - eCSSProperty__moz_column_rule_width = 80, - eCSSProperty_contain = 81, - eCSSProperty_content = 82, - eCSSProperty__moz_control_character_visibility = 83, - eCSSProperty_counter_increment = 84, - eCSSProperty_counter_reset = 85, - eCSSProperty_cursor = 86, - eCSSProperty_direction = 87, - eCSSProperty_display = 88, - eCSSProperty_empty_cells = 89, - eCSSProperty_align_content = 90, - eCSSProperty_align_items = 91, - eCSSProperty_align_self = 92, - eCSSProperty_flex_basis = 93, - eCSSProperty_flex_direction = 94, - eCSSProperty_webkit_box_orient = 95, - eCSSProperty_flex_grow = 96, - eCSSProperty_flex_shrink = 97, - eCSSProperty_flex_wrap = 98, - eCSSProperty_order = 99, - eCSSProperty_justify_content = 100, - eCSSProperty_justify_items = 101, - eCSSProperty_justify_self = 102, - eCSSProperty_float = 103, - eCSSProperty_float_edge = 104, - eCSSProperty_font_family = 105, - eCSSProperty_font_feature_settings = 106, - eCSSProperty_font_kerning = 107, - eCSSProperty_font_language_override = 108, - eCSSProperty_font_size = 109, - eCSSProperty_font_size_adjust = 110, - eCSSProperty_osx_font_smoothing = 111, - eCSSProperty_font_stretch = 112, - eCSSProperty_font_style = 113, - eCSSProperty_font_synthesis = 114, - eCSSProperty_font_variant_alternates = 115, - eCSSProperty_font_variant_caps = 116, - eCSSProperty_font_variant_east_asian = 117, - eCSSProperty_font_variant_ligatures = 118, - eCSSProperty_font_variant_numeric = 119, - eCSSProperty_font_variant_position = 120, - eCSSProperty_font_weight = 121, - eCSSProperty_force_broken_image_icon = 122, - eCSSProperty_grid_auto_flow = 123, - eCSSProperty_grid_auto_columns = 124, - eCSSProperty_grid_auto_rows = 125, - eCSSProperty_grid_template_areas = 126, - eCSSProperty_grid_template_columns = 127, - eCSSProperty_grid_template_rows = 128, - eCSSProperty_grid_column_start = 129, - eCSSProperty_grid_column_end = 130, - eCSSProperty_grid_row_start = 131, - eCSSProperty_grid_row_end = 132, - eCSSProperty_grid_column_gap = 133, - eCSSProperty_grid_row_gap = 134, - eCSSProperty_height = 135, - eCSSProperty_image_orientation = 136, - eCSSProperty_image_region = 137, - eCSSProperty_ime_mode = 138, - eCSSProperty_inline_size = 139, - eCSSProperty_left = 140, - eCSSProperty_letter_spacing = 141, - eCSSProperty_line_height = 142, - eCSSProperty_list_style_image = 143, - eCSSProperty_list_style_position = 144, - eCSSProperty_list_style_type = 145, - eCSSProperty_margin_block_end = 146, - eCSSProperty_margin_block_start = 147, - eCSSProperty_margin_bottom = 148, - eCSSProperty_margin_inline_end = 149, - eCSSProperty_margin_inline_start = 150, - eCSSProperty_margin_left = 151, - eCSSProperty_margin_right = 152, - eCSSProperty_margin_top = 153, - eCSSProperty_marker_offset = 154, - eCSSProperty_max_block_size = 155, - eCSSProperty_max_height = 156, - eCSSProperty_max_inline_size = 157, - eCSSProperty_max_width = 158, - eCSSProperty__moz_min_font_size_ratio = 159, - eCSSProperty_min_height = 160, - eCSSProperty_min_block_size = 161, - eCSSProperty_min_inline_size = 162, - eCSSProperty_min_width = 163, - eCSSProperty_mix_blend_mode = 164, - eCSSProperty_isolation = 165, - eCSSProperty_object_fit = 166, - eCSSProperty_object_position = 167, - eCSSProperty_offset_block_end = 168, - eCSSProperty_offset_block_start = 169, - eCSSProperty_offset_inline_end = 170, - eCSSProperty_offset_inline_start = 171, - eCSSProperty_opacity = 172, - eCSSProperty_orient = 173, - eCSSProperty_outline_color = 174, - eCSSProperty_outline_style = 175, - eCSSProperty_outline_width = 176, - eCSSProperty_outline_offset = 177, - eCSSProperty_overflow_clip_box = 178, - eCSSProperty_overflow_x = 179, - eCSSProperty_overflow_y = 180, - eCSSProperty_padding_block_end = 181, - eCSSProperty_padding_block_start = 182, - eCSSProperty_padding_bottom = 183, - eCSSProperty_padding_inline_end = 184, - eCSSProperty_padding_inline_start = 185, - eCSSProperty_padding_left = 186, - eCSSProperty_padding_right = 187, - eCSSProperty_padding_top = 188, - eCSSProperty_page_break_after = 189, - eCSSProperty_page_break_before = 190, - eCSSProperty_page_break_inside = 191, - eCSSProperty_paint_order = 192, - eCSSProperty_pointer_events = 193, - eCSSProperty_position = 194, - eCSSProperty_quotes = 195, - eCSSProperty_resize = 196, - eCSSProperty_right = 197, - eCSSProperty_ruby_align = 198, - eCSSProperty_ruby_position = 199, - eCSSProperty_scroll_behavior = 200, - eCSSProperty_scroll_snap_coordinate = 201, - eCSSProperty_scroll_snap_destination = 202, - eCSSProperty_scroll_snap_points_x = 203, - eCSSProperty_scroll_snap_points_y = 204, - eCSSProperty_scroll_snap_type_x = 205, - eCSSProperty_scroll_snap_type_y = 206, - eCSSProperty_table_layout = 207, - eCSSProperty_text_align = 208, - eCSSProperty_text_align_last = 209, - eCSSProperty_text_combine_upright = 210, - eCSSProperty_text_decoration_color = 211, - eCSSProperty_text_decoration_line = 212, - eCSSProperty_text_decoration_style = 213, - eCSSProperty_text_emphasis_color = 214, - eCSSProperty_text_emphasis_position = 215, - eCSSProperty_text_emphasis_style = 216, - eCSSProperty__webkit_text_fill_color = 217, - eCSSProperty_text_indent = 218, - eCSSProperty_text_orientation = 219, - eCSSProperty_text_overflow = 220, - eCSSProperty_text_shadow = 221, - eCSSProperty_text_size_adjust = 222, - eCSSProperty_text_transform = 223, - eCSSProperty_transform = 224, - eCSSProperty_transform_box = 225, - eCSSProperty_transform_origin = 226, - eCSSProperty_perspective_origin = 227, - eCSSProperty_perspective = 228, - eCSSProperty_transform_style = 229, - eCSSProperty_backface_visibility = 230, - eCSSProperty_top = 231, - eCSSProperty__moz_top_layer = 232, - eCSSProperty_touch_action = 233, - eCSSProperty_transition_delay = 234, - eCSSProperty_transition_duration = 235, - eCSSProperty_transition_property = 236, - eCSSProperty_transition_timing_function = 237, - eCSSProperty_unicode_bidi = 238, - eCSSProperty_user_focus = 239, - eCSSProperty_user_input = 240, - eCSSProperty_user_modify = 241, - eCSSProperty_user_select = 242, - eCSSProperty_vertical_align = 243, - eCSSProperty_visibility = 244, - eCSSProperty_white_space = 245, - eCSSProperty_width = 246, - eCSSProperty__moz_window_dragging = 247, - eCSSProperty__moz_window_shadow = 248, - eCSSProperty_word_break = 249, - eCSSProperty_word_spacing = 250, - eCSSProperty_word_wrap = 251, - eCSSProperty_hyphens = 252, - eCSSProperty_writing_mode = 253, - eCSSProperty_z_index = 254, - eCSSProperty_box_align = 255, - eCSSProperty_box_direction = 256, - eCSSProperty_box_flex = 257, - eCSSProperty_box_orient = 258, - eCSSProperty_box_pack = 259, - eCSSProperty_box_ordinal_group = 260, - eCSSProperty_stack_sizing = 261, - eCSSProperty_script_level = 262, - eCSSProperty_script_size_multiplier = 263, - eCSSProperty_script_min_size = 264, - eCSSProperty_math_variant = 265, - eCSSProperty_math_display = 266, - eCSSProperty_clip_path = 267, - eCSSProperty_clip_rule = 268, - eCSSProperty_color_interpolation = 269, - eCSSProperty_color_interpolation_filters = 270, - eCSSProperty_dominant_baseline = 271, - eCSSProperty_fill = 272, - eCSSProperty_fill_opacity = 273, - eCSSProperty_fill_rule = 274, - eCSSProperty_filter = 275, - eCSSProperty_flood_color = 276, - eCSSProperty_flood_opacity = 277, - eCSSProperty_image_rendering = 278, - eCSSProperty_lighting_color = 279, - eCSSProperty_marker_end = 280, - eCSSProperty_marker_mid = 281, - eCSSProperty_marker_start = 282, - eCSSProperty_mask = 283, - eCSSProperty_mask_type = 284, - eCSSProperty_shape_rendering = 285, - eCSSProperty_stop_color = 286, - eCSSProperty_stop_opacity = 287, - eCSSProperty_stroke = 288, - eCSSProperty_stroke_dasharray = 289, - eCSSProperty_stroke_dashoffset = 290, - eCSSProperty_stroke_linecap = 291, - eCSSProperty_stroke_linejoin = 292, - eCSSProperty_stroke_miterlimit = 293, - eCSSProperty_stroke_opacity = 294, - eCSSProperty_stroke_width = 295, - eCSSProperty_text_anchor = 296, - eCSSProperty_text_rendering = 297, - eCSSProperty_vector_effect = 298, - eCSSProperty_will_change = 299, - eCSSProperty__x_lang = 300, - eCSSProperty__x_span = 301, - eCSSProperty__x_text_zoom = 302, + eCSSProperty_border_top_left_radius = 59, + eCSSProperty_border_top_right_radius = 60, + eCSSProperty_border_top_style = 61, + eCSSProperty_border_top_width = 62, + eCSSProperty_bottom = 63, + eCSSProperty_box_align = 64, + eCSSProperty_box_decoration_break = 65, + eCSSProperty_box_direction = 66, + eCSSProperty_box_flex = 67, + eCSSProperty_box_ordinal_group = 68, + eCSSProperty_box_orient = 69, + eCSSProperty_webkit_box_orient = 70, + eCSSProperty_box_pack = 71, + eCSSProperty_box_shadow = 72, + eCSSProperty_box_sizing = 73, + eCSSProperty_caption_side = 74, + eCSSProperty_clear = 75, + eCSSProperty_clip = 76, + eCSSProperty_clip_path = 77, + eCSSProperty_clip_rule = 78, + eCSSProperty_color = 79, + eCSSProperty_color_adjust = 80, + eCSSProperty_color_interpolation = 81, + eCSSProperty_color_interpolation_filters = 82, + eCSSProperty__moz_column_count = 83, + eCSSProperty__moz_column_fill = 84, + eCSSProperty__moz_column_gap = 85, + eCSSProperty__moz_column_rule_color = 86, + eCSSProperty__moz_column_rule_style = 87, + eCSSProperty__moz_column_rule_width = 88, + eCSSProperty__moz_column_width = 89, + eCSSProperty_contain = 90, + eCSSProperty_content = 91, + eCSSProperty__moz_control_character_visibility = 92, + eCSSProperty_counter_increment = 93, + eCSSProperty_counter_reset = 94, + eCSSProperty_cursor = 95, + eCSSProperty_direction = 96, + eCSSProperty_display = 97, + eCSSProperty_dominant_baseline = 98, + eCSSProperty_empty_cells = 99, + eCSSProperty_fill = 100, + eCSSProperty_fill_opacity = 101, + eCSSProperty_fill_rule = 102, + eCSSProperty_filter = 103, + eCSSProperty_flex_basis = 104, + eCSSProperty_flex_direction = 105, + eCSSProperty_flex_grow = 106, + eCSSProperty_flex_shrink = 107, + eCSSProperty_flex_wrap = 108, + eCSSProperty_float = 109, + eCSSProperty_float_edge = 110, + eCSSProperty_flood_color = 111, + eCSSProperty_flood_opacity = 112, + eCSSProperty_font_family = 113, + eCSSProperty_font_feature_settings = 114, + eCSSProperty_font_kerning = 115, + eCSSProperty_font_language_override = 116, + eCSSProperty_font_size = 117, + eCSSProperty_font_size_adjust = 118, + eCSSProperty_font_stretch = 119, + eCSSProperty_font_style = 120, + eCSSProperty_font_synthesis = 121, + eCSSProperty_font_variant_alternates = 122, + eCSSProperty_font_variant_caps = 123, + eCSSProperty_font_variant_east_asian = 124, + eCSSProperty_font_variant_ligatures = 125, + eCSSProperty_font_variant_numeric = 126, + eCSSProperty_font_variant_position = 127, + eCSSProperty_font_weight = 128, + eCSSProperty_force_broken_image_icon = 129, + eCSSProperty_grid_auto_columns = 130, + eCSSProperty_grid_auto_flow = 131, + eCSSProperty_grid_auto_rows = 132, + eCSSProperty_grid_column_end = 133, + eCSSProperty_grid_column_gap = 134, + eCSSProperty_grid_column_start = 135, + eCSSProperty_grid_row_end = 136, + eCSSProperty_grid_row_gap = 137, + eCSSProperty_grid_row_start = 138, + eCSSProperty_grid_template_areas = 139, + eCSSProperty_grid_template_columns = 140, + eCSSProperty_grid_template_rows = 141, + eCSSProperty_height = 142, + eCSSProperty_hyphens = 143, + eCSSProperty_image_orientation = 144, + eCSSProperty_image_region = 145, + eCSSProperty_image_rendering = 146, + eCSSProperty_ime_mode = 147, + eCSSProperty_inline_size = 148, + eCSSProperty_isolation = 149, + eCSSProperty_justify_content = 150, + eCSSProperty_justify_items = 151, + eCSSProperty_justify_self = 152, + eCSSProperty__x_lang = 153, + eCSSProperty_left = 154, + eCSSProperty_letter_spacing = 155, + eCSSProperty_lighting_color = 156, + eCSSProperty_line_height = 157, + eCSSProperty_list_style_image = 158, + eCSSProperty_list_style_position = 159, + eCSSProperty_list_style_type = 160, + eCSSProperty_margin_block_end = 161, + eCSSProperty_margin_block_start = 162, + eCSSProperty_margin_bottom = 163, + eCSSProperty_margin_inline_end = 164, + eCSSProperty_margin_inline_start = 165, + eCSSProperty_margin_left = 166, + eCSSProperty_margin_right = 167, + eCSSProperty_margin_top = 168, + eCSSProperty_marker_end = 169, + eCSSProperty_marker_mid = 170, + eCSSProperty_marker_offset = 171, + eCSSProperty_marker_start = 172, + eCSSProperty_mask = 173, + eCSSProperty_mask_type = 174, + eCSSProperty_math_display = 175, + eCSSProperty_math_variant = 176, + eCSSProperty_max_block_size = 177, + eCSSProperty_max_height = 178, + eCSSProperty_max_inline_size = 179, + eCSSProperty_max_width = 180, + eCSSProperty_min_block_size = 181, + eCSSProperty__moz_min_font_size_ratio = 182, + eCSSProperty_min_height = 183, + eCSSProperty_min_inline_size = 184, + eCSSProperty_min_width = 185, + eCSSProperty_mix_blend_mode = 186, + eCSSProperty_object_fit = 187, + eCSSProperty_object_position = 188, + eCSSProperty_offset_block_end = 189, + eCSSProperty_offset_block_start = 190, + eCSSProperty_offset_inline_end = 191, + eCSSProperty_offset_inline_start = 192, + eCSSProperty_opacity = 193, + eCSSProperty_order = 194, + eCSSProperty_orient = 195, + eCSSProperty_osx_font_smoothing = 196, + eCSSProperty_outline_color = 197, + eCSSProperty_outline_offset = 198, + eCSSProperty__moz_outline_radius_bottomLeft = 199, + eCSSProperty__moz_outline_radius_bottomRight = 200, + eCSSProperty__moz_outline_radius_topLeft = 201, + eCSSProperty__moz_outline_radius_topRight = 202, + eCSSProperty_outline_style = 203, + eCSSProperty_outline_width = 204, + eCSSProperty_overflow_clip_box = 205, + eCSSProperty_overflow_x = 206, + eCSSProperty_overflow_y = 207, + eCSSProperty_padding_block_end = 208, + eCSSProperty_padding_block_start = 209, + eCSSProperty_padding_bottom = 210, + eCSSProperty_padding_inline_end = 211, + eCSSProperty_padding_inline_start = 212, + eCSSProperty_padding_left = 213, + eCSSProperty_padding_right = 214, + eCSSProperty_padding_top = 215, + eCSSProperty_page_break_after = 216, + eCSSProperty_page_break_before = 217, + eCSSProperty_page_break_inside = 218, + eCSSProperty_paint_order = 219, + eCSSProperty_perspective = 220, + eCSSProperty_perspective_origin = 221, + eCSSProperty_pointer_events = 222, + eCSSProperty_position = 223, + eCSSProperty_quotes = 224, + eCSSProperty_resize = 225, + eCSSProperty_right = 226, + eCSSProperty_ruby_align = 227, + eCSSProperty_ruby_position = 228, + eCSSProperty_script_level = 229, + eCSSProperty_script_min_size = 230, + eCSSProperty_script_size_multiplier = 231, + eCSSProperty_scroll_behavior = 232, + eCSSProperty_scroll_snap_coordinate = 233, + eCSSProperty_scroll_snap_destination = 234, + eCSSProperty_scroll_snap_points_x = 235, + eCSSProperty_scroll_snap_points_y = 236, + eCSSProperty_scroll_snap_type_x = 237, + eCSSProperty_scroll_snap_type_y = 238, + eCSSProperty_shape_rendering = 239, + eCSSProperty__x_span = 240, + eCSSProperty_stack_sizing = 241, + eCSSProperty_stop_color = 242, + eCSSProperty_stop_opacity = 243, + eCSSProperty_stroke = 244, + eCSSProperty_stroke_dasharray = 245, + eCSSProperty_stroke_dashoffset = 246, + eCSSProperty_stroke_linecap = 247, + eCSSProperty_stroke_linejoin = 248, + eCSSProperty_stroke_miterlimit = 249, + eCSSProperty_stroke_opacity = 250, + eCSSProperty_stroke_width = 251, + eCSSProperty__x_system_font = 252, + eCSSProperty__moz_tab_size = 253, + eCSSProperty_table_layout = 254, + eCSSProperty_text_align = 255, + eCSSProperty_text_align_last = 256, + eCSSProperty_text_anchor = 257, + eCSSProperty_text_combine_upright = 258, + eCSSProperty_text_decoration_color = 259, + eCSSProperty_text_decoration_line = 260, + eCSSProperty_text_decoration_style = 261, + eCSSProperty_text_emphasis_color = 262, + eCSSProperty_text_emphasis_position = 263, + eCSSProperty_text_emphasis_style = 264, + eCSSProperty__webkit_text_fill_color = 265, + eCSSProperty_text_indent = 266, + eCSSProperty_text_orientation = 267, + eCSSProperty_text_overflow = 268, + eCSSProperty_text_rendering = 269, + eCSSProperty_text_shadow = 270, + eCSSProperty_text_size_adjust = 271, + eCSSProperty_text_transform = 272, + eCSSProperty__x_text_zoom = 273, + eCSSProperty_top = 274, + eCSSProperty__moz_top_layer = 275, + eCSSProperty_touch_action = 276, + eCSSProperty_transform = 277, + eCSSProperty_transform_box = 278, + eCSSProperty_transform_origin = 279, + eCSSProperty_transform_style = 280, + eCSSProperty_transition_delay = 281, + eCSSProperty_transition_duration = 282, + eCSSProperty_transition_property = 283, + eCSSProperty_transition_timing_function = 284, + eCSSProperty_unicode_bidi = 285, + eCSSProperty_user_focus = 286, + eCSSProperty_user_input = 287, + eCSSProperty_user_modify = 288, + eCSSProperty_user_select = 289, + eCSSProperty_vector_effect = 290, + eCSSProperty_vertical_align = 291, + eCSSProperty_visibility = 292, + eCSSProperty_white_space = 293, + eCSSProperty_width = 294, + eCSSProperty_will_change = 295, + eCSSProperty__moz_window_dragging = 296, + eCSSProperty__moz_window_shadow = 297, + eCSSProperty_word_break = 298, + eCSSProperty_word_spacing = 299, + eCSSProperty_word_wrap = 300, + eCSSProperty_writing_mode = 301, + eCSSProperty_z_index = 302, eCSSProperty_COUNT_no_shorthands = 303, - eCSSProperty_all = 304, - eCSSProperty_animation = 305, - eCSSProperty_background = 306, - eCSSProperty_border = 307, - eCSSProperty_border_block_end = 308, - eCSSProperty_border_block_start = 309, - eCSSProperty_border_bottom = 310, - eCSSProperty_border_color = 311, - eCSSProperty_border_image = 312, - eCSSProperty_border_inline_end = 313, - eCSSProperty_border_inline_start = 314, - eCSSProperty_border_left = 315, + eCSSProperty_animation = 304, + eCSSProperty_background = 305, + eCSSProperty_border = 306, + eCSSProperty_border_block_end = 307, + eCSSProperty_border_block_start = 308, + eCSSProperty_border_bottom = 309, + eCSSProperty_border_color = 310, + eCSSProperty_border_image = 311, + eCSSProperty_border_inline_end = 312, + eCSSProperty_border_inline_start = 313, + eCSSProperty_border_left = 314, + eCSSProperty_border_radius = 315, eCSSProperty_border_right = 316, eCSSProperty_border_style = 317, eCSSProperty_border_top = 318, eCSSProperty_border_width = 319, - eCSSProperty_border_radius = 320, + eCSSProperty__moz_column_rule = 320, eCSSProperty__moz_columns = 321, - eCSSProperty__moz_column_rule = 322, - eCSSProperty_flex = 323, - eCSSProperty_flex_flow = 324, - eCSSProperty_font = 325, - eCSSProperty_font_variant = 326, - eCSSProperty_grid = 327, + eCSSProperty_flex = 322, + eCSSProperty_flex_flow = 323, + eCSSProperty_font = 324, + eCSSProperty_font_variant = 325, + eCSSProperty_grid = 326, + eCSSProperty_grid_area = 327, eCSSProperty_grid_column = 328, - eCSSProperty_grid_row = 329, - eCSSProperty_grid_area = 330, - eCSSProperty_grid_gap = 331, - eCSSProperty_list_style = 332, - eCSSProperty_margin = 333, + eCSSProperty_grid_gap = 329, + eCSSProperty_grid_row = 330, + eCSSProperty_list_style = 331, + eCSSProperty_margin = 332, + eCSSProperty_marker = 333, eCSSProperty_outline = 334, - eCSSProperty_overflow = 335, - eCSSProperty_padding = 336, - eCSSProperty_scroll_snap_type = 337, - eCSSProperty_text_decoration = 338, - eCSSProperty_text_emphasis = 339, - eCSSProperty_transition = 340, - eCSSProperty_marker = 341, - eCSSProperty__moz_transform = 342, + eCSSProperty__moz_outline_radius = 335, + eCSSProperty_overflow = 336, + eCSSProperty_padding = 337, + eCSSProperty_scroll_snap_type = 338, + eCSSProperty_text_decoration = 339, + eCSSProperty_text_emphasis = 340, + eCSSProperty__moz_transform = 341, + eCSSProperty_transition = 342, eCSSProperty_COUNT = 343, eCSSPropertyAlias_MozPerspectiveOrigin = 344, eCSSPropertyAlias_MozPerspective = 345, @@ -3151,6 +3502,7 @@ pub type nscolor = u32; * count is 1. */ #[repr(C)] +#[derive(Debug)] pub struct nsStringBuffer { pub mRefCount: u32, pub mStorageSize: u32, @@ -3180,6 +3532,7 @@ fn bindgen_test_layout_ImageValue() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct GridNamedArea { pub mName: nsString, pub mColumnStart: u32, @@ -3302,16 +3655,17 @@ pub enum nsCSSUnit { eCSSUnit_FlexFraction = 4000, } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValue { pub mUnit: nsCSSUnit, - pub mValue: nsCSSValue_nsCSSValue_h_unnamed_7, + pub mValue: nsCSSValue_nsCSSValue_h_unnamed_8, } #[repr(u32)] #[derive(Debug, Copy, Clone)] pub enum nsCSSValue_Serialization { eNormalized = 0, eAuthorSpecified = 1, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsCSSValue_nsCSSValue_h_unnamed_7 { +#[derive(Debug, Copy)] +pub struct nsCSSValue_nsCSSValue_h_unnamed_8 { pub mInt: __BindgenUnionField, pub mFloat: __BindgenUnionField, pub mString: __BindgenUnionField<*mut nsStringBuffer>, @@ -3334,15 +3688,15 @@ pub struct nsCSSValue_nsCSSValue_h_unnamed_7 { pub mFontFamilyList: __BindgenUnionField<*mut FontFamilyListRefCnt>, pub _bindgen_data_: u64, } -impl nsCSSValue_nsCSSValue_h_unnamed_7 { } -impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_7 { +impl nsCSSValue_nsCSSValue_h_unnamed_8 { } +impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_8 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_7() { - assert_eq!(::std::mem::size_of::() , +fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_8() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() , + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -3351,6 +3705,7 @@ fn bindgen_test_layout_nsCSSValue() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct Array { pub mRefCnt: usize, pub mCount: usize, @@ -3362,6 +3717,7 @@ fn bindgen_test_layout_Array() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueList { pub mValue: nsCSSValue, pub mNext: *mut nsCSSValueList, @@ -3372,6 +3728,7 @@ fn bindgen_test_layout_nsCSSValueList() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueList_heap { pub _base: nsCSSValueList, pub mRefCnt: nsAutoRefCnt, @@ -3383,6 +3740,7 @@ fn bindgen_test_layout_nsCSSValueList_heap() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueSharedList { pub mRefCnt: nsAutoRefCnt, pub _mOwningThread: nsAutoOwningThread, @@ -3394,6 +3752,7 @@ fn bindgen_test_layout_nsCSSValueSharedList() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSRect { pub mTop: nsCSSValue, pub mRight: nsCSSValue, @@ -3406,6 +3765,7 @@ fn bindgen_test_layout_nsCSSRect() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSRect_heap { pub _base: nsCSSRect, pub mRefCnt: nsAutoRefCnt, @@ -3417,6 +3777,7 @@ fn bindgen_test_layout_nsCSSRect_heap() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValuePair { pub mXValue: nsCSSValue, pub mYValue: nsCSSValue, @@ -3427,6 +3788,7 @@ fn bindgen_test_layout_nsCSSValuePair() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValuePair_heap { pub _base: nsCSSValuePair, pub mRefCnt: nsAutoRefCnt, @@ -3438,6 +3800,7 @@ fn bindgen_test_layout_nsCSSValuePair_heap() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueTriplet { pub mXValue: nsCSSValue, pub mYValue: nsCSSValue, @@ -3449,6 +3812,7 @@ fn bindgen_test_layout_nsCSSValueTriplet() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueTriplet_heap { pub _base: nsCSSValueTriplet, pub mRefCnt: nsAutoRefCnt, @@ -3460,6 +3824,7 @@ fn bindgen_test_layout_nsCSSValueTriplet_heap() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValuePairList { pub mXValue: nsCSSValue, pub mYValue: nsCSSValue, @@ -3471,6 +3836,7 @@ fn bindgen_test_layout_nsCSSValuePairList() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValuePairList_heap { pub _base: nsCSSValuePairList, pub mRefCnt: nsAutoRefCnt, @@ -3482,6 +3848,7 @@ fn bindgen_test_layout_nsCSSValuePairList_heap() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueGradientStop { pub mLocation: nsCSSValue, pub mColor: nsCSSValue, @@ -3530,6 +3897,7 @@ fn bindgen_test_layout_nsCSSValueTokenStream() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSValueFloatColor { pub mRefCnt: nsAutoRefCnt, pub _mOwningThread: nsAutoOwningThread, @@ -3544,6 +3912,7 @@ fn bindgen_test_layout_nsCSSValueFloatColor() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSCornerSizes { pub mTopLeft: nsCSSValue, pub mTopRight: nsCSSValue, @@ -3616,7 +3985,7 @@ pub struct _vftable_nsIRequest { } #[repr(u32)] #[derive(Debug, Copy, Clone)] -pub enum nsIRequest_nsIRequest_h_unnamed_8 { +pub enum nsIRequest_nsIRequest_h_unnamed_9 { LOAD_REQUESTMASK = 65535, LOAD_NORMAL = 0, LOAD_BACKGROUND = 1, @@ -3660,6 +4029,7 @@ fn bindgen_test_layout_nsIAtom() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsAtomString { pub _base: nsString, } @@ -3669,6 +4039,7 @@ fn bindgen_test_layout_nsAtomString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsAtomCString { pub _base: nsCString, } @@ -3678,13 +4049,9 @@ fn bindgen_test_layout_nsAtomCString() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] -#[derive(Debug, Copy)] pub struct nsDependentAtomString { pub _base: [u64; 2usize], } -impl ::std::clone::Clone for nsDependentAtomString { - fn clone(&self) -> Self { *self } -} /** * A class for holding strong references to handle-managed objects. * @@ -3693,6 +4060,7 @@ impl ::std::clone::Clone for nsDependentAtomString { * and ->Release() called on it. */ #[repr(C)] +#[derive(Debug)] pub struct HandleRefPtr { pub mHandle: T, } @@ -3723,6 +4091,7 @@ pub struct HandleRefPtr { * (or a proxy for it) in which the object was allocated. */ #[repr(C)] +#[derive(Debug)] pub struct ArenaRefPtr { pub mPtr: RefPtr, pub _phantom0: ::std::marker::PhantomData, @@ -3762,23 +4131,23 @@ pub enum nsStyleUnit { eStyleUnit_Calc = 40, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleCoord_h_unnamed_9 { +#[derive(Debug, Copy)] +pub struct nsStyleCoord_h_unnamed_10 { pub mInt: __BindgenUnionField, pub mFloat: __BindgenUnionField, pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>, pub _bindgen_data_: u64, } -impl nsStyleCoord_h_unnamed_9 { } -impl ::std::clone::Clone for nsStyleCoord_h_unnamed_9 { +impl nsStyleCoord_h_unnamed_10 { } +impl ::std::clone::Clone for nsStyleCoord_h_unnamed_10 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleCoord_h_unnamed_9() { - assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_nsStyleCoord_h_unnamed_10() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub type nsStyleUnion = nsStyleCoord_h_unnamed_9; +pub type nsStyleUnion = nsStyleCoord_h_unnamed_10; /** * Class that hold a single size specification used by the style * system. The size specification consists of two parts -- a number @@ -3788,6 +4157,7 @@ pub type nsStyleUnion = nsStyleCoord_h_unnamed_9; * form. */ #[repr(C)] +#[derive(Debug)] pub struct nsStyleCoord { pub mUnit: nsStyleUnit, pub mValue: nsStyleUnion, @@ -3808,6 +4178,7 @@ fn bindgen_test_layout_nsStyleCoord_CalcValue() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleCoord_Calc { pub _base: nsStyleCoord_CalcValue, pub mRefCnt: nsAutoRefCnt, @@ -3832,6 +4203,7 @@ fn bindgen_test_layout_nsStyleCoord() { * or paddings of a box. */ #[repr(C)] +#[derive(Debug)] pub struct nsStyleSides { pub mUnits: [nsStyleUnit; 4usize], pub mValues: [nsStyleUnion; 4usize], @@ -3847,6 +4219,7 @@ fn bindgen_test_layout_nsStyleSides() { * corners of a box (for, e.g., border-radius and outline-radius). */ #[repr(C)] +#[derive(Debug)] pub struct nsStyleCorners { pub mUnits: [nsStyleUnit; 8usize], pub mValues: [nsStyleUnion; 8usize], @@ -3914,6 +4287,7 @@ fn bindgen_test_layout_nsStyleFont() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleGradientStop { pub mLocation: nsStyleCoord, pub mColor: nscolor, @@ -3966,27 +4340,27 @@ pub enum nsStyleImageType { pub struct nsStyleImage { pub mSubImages: u64, pub mType: nsStyleImageType, - pub nsStyleImage_nsStyleStruct_h_unnamed_12: nsStyleImage_nsStyleStruct_h_unnamed_12, + pub nsStyleImage_nsStyleStruct_h_unnamed_13: nsStyleImage_nsStyleStruct_h_unnamed_13, pub mCropRect: nsAutoPtr, pub mImageTracked: bool, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleImage_nsStyleStruct_h_unnamed_12 { +#[derive(Debug, Copy)] +pub struct nsStyleImage_nsStyleStruct_h_unnamed_13 { pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mGradient: __BindgenUnionField<*mut nsStyleGradient>, pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub _bindgen_data_: u64, } -impl nsStyleImage_nsStyleStruct_h_unnamed_12 { } -impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_12 { +impl nsStyleImage_nsStyleStruct_h_unnamed_13 { } +impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_13 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_12() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_13() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -3995,6 +4369,7 @@ fn bindgen_test_layout_nsStyleImage() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleColor { pub mColor: nscolor, } @@ -4004,6 +4379,8 @@ fn bindgen_test_layout_nsStyleColor() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +pub struct nsStyleAutoArray; +#[repr(C)] pub struct nsStyleImageLayers { pub mAttachmentCount: u32, pub mClipCount: u32, @@ -4015,11 +4392,11 @@ pub struct nsStyleImageLayers { pub mMaskModeCount: u32, pub mBlendModeCount: u32, pub mCompositeCount: u32, - pub mLayers: [u64; 16usize], + pub mLayers: [u64; 15usize], } #[repr(u32)] #[derive(Debug, Copy, Clone)] -pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_13 { +pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_14 { shorthand = 0, color = 1, image = 2, @@ -4123,7 +4500,7 @@ fn bindgen_test_layout_nsStyleImageLayers_Layer() { } #[test] fn bindgen_test_layout_nsStyleImageLayers() { - assert_eq!(::std::mem::size_of::() , 168usize); + assert_eq!(::std::mem::size_of::() , 160usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -4133,10 +4510,11 @@ pub struct nsStyleBackground { } #[test] fn bindgen_test_layout_nsStyleBackground() { - assert_eq!(::std::mem::size_of::() , 176usize); + assert_eq!(::std::mem::size_of::() , 168usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleMargin { pub mMargin: nsStyleSides, pub mHasCachedMargin: bool, @@ -4148,6 +4526,7 @@ fn bindgen_test_layout_nsStyleMargin() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStylePadding { pub mPadding: nsStyleSides, pub mHasCachedPadding: bool, @@ -4159,6 +4538,7 @@ fn bindgen_test_layout_nsStylePadding() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsBorderColors { pub mNext: *mut nsBorderColors, pub mColor: nscolor, @@ -4169,6 +4549,7 @@ fn bindgen_test_layout_nsBorderColors() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSShadowItem { pub mXOffset: nscoord, pub mYOffset: nscoord, @@ -4184,6 +4565,7 @@ fn bindgen_test_layout_nsCSSShadowItem() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct nsCSSShadowArray { pub mRefCnt: nsAutoRefCnt, pub _mOwningThread: nsAutoOwningThread, @@ -4220,13 +4602,13 @@ fn bindgen_test_layout_nsStyleBorder() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleOutline { pub mOutlineRadius: nsStyleCorners, pub mOutlineWidth: nsStyleCoord, pub mOutlineOffset: nscoord, pub mCachedOutlineWidth: nscoord, pub mOutlineColor: nscolor, - pub mHasCachedOutline: bool, pub mOutlineStyle: u8, pub mTwipsPerPixel: nscoord, } @@ -4266,6 +4648,7 @@ fn bindgen_test_layout_nsStyleList() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleGridLine { pub mHasSpan: bool, pub mInteger: i32, @@ -4337,6 +4720,7 @@ fn bindgen_test_layout_nsStylePosition() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleTextOverflowSide { pub mString: nsString, pub mType: u8, @@ -4347,6 +4731,7 @@ fn bindgen_test_layout_nsStyleTextOverflowSide() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleTextOverflow { pub mLeft: nsStyleTextOverflowSide, pub mRight: nsStyleTextOverflowSide, @@ -4358,6 +4743,7 @@ fn bindgen_test_layout_nsStyleTextOverflow() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleTextReset { pub mTextOverflow: nsStyleTextOverflow, pub mTextDecorationLine: u8, @@ -4371,6 +4757,7 @@ fn bindgen_test_layout_nsStyleTextReset() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleText { pub mTextAlign: u8, pub mTextAlignLast: u8, @@ -4432,6 +4819,7 @@ fn bindgen_test_layout_nsStyleImageOrientation() { assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleVisibility { pub mImageOrientation: nsStyleImageOrientation, pub mDirection: u8, @@ -4450,7 +4838,7 @@ fn bindgen_test_layout_nsStyleVisibility() { #[derive(Debug, Copy)] pub struct nsTimingFunction { pub mType: nsTimingFunction_Type, - pub nsTimingFunction_nsStyleStruct_h_unnamed_14: nsTimingFunction_nsStyleStruct_h_unnamed_14, + pub nsTimingFunction_nsStyleStruct_h_unnamed_15: nsTimingFunction_nsStyleStruct_h_unnamed_15, } #[repr(i32)] #[derive(Debug, Copy, Clone)] @@ -4476,57 +4864,57 @@ pub enum nsTimingFunction_StepSyntax { #[derive(Debug, Copy, Clone)] pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsTimingFunction_nsStyleStruct_h_unnamed_14 { - pub mFunc: __BindgenUnionField, - pub nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_16: __BindgenUnionField, +#[derive(Debug, Copy)] +pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15 { + pub mFunc: __BindgenUnionField, + pub nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17: __BindgenUnionField, pub _bindgen_data_: [u32; 4usize], } -impl nsTimingFunction_nsStyleStruct_h_unnamed_14 { } -impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_14 { +impl nsTimingFunction_nsStyleStruct_h_unnamed_15 { } +impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_15 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_14() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15() { + assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] #[derive(Debug, Copy)] -pub struct nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_15 { +pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16 { pub mX1: f32, pub mY1: f32, pub mX2: f32, pub mY2: f32, } impl ::std::clone::Clone for - nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_15 { + nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_15() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_16() { + assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] #[derive(Debug, Copy)] -pub struct nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_16 { +pub struct nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17 { pub mStepSyntax: nsTimingFunction_StepSyntax, pub mSteps: u32, } impl ::std::clone::Clone for - nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_16 { + nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_14_nsStyleStruct_h_unnamed_16() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_15_nsStyleStruct_h_unnamed_17() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 4usize); } impl ::std::clone::Clone for nsTimingFunction { @@ -4538,6 +4926,7 @@ fn bindgen_test_layout_nsTimingFunction() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct StyleTransition { pub mTimingFunction: nsTimingFunction, pub mDuration: f32, @@ -4551,6 +4940,7 @@ fn bindgen_test_layout_StyleTransition() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct StyleAnimation { pub mTimingFunction: nsTimingFunction, pub mDuration: f32, @@ -4588,7 +4978,7 @@ pub struct nsStyleDisplay { pub mIsolation: u8, pub mTopLayer: u8, pub mWillChangeBitField: u8, - pub mWillChange: [u64; 4usize], + pub mWillChange: u64, pub mTouchAction: u8, pub mScrollBehavior: u8, pub mScrollSnapTypeX: u8, @@ -4605,12 +4995,12 @@ pub struct nsStyleDisplay { pub mChildPerspective: nsStyleCoord, pub mPerspectiveOrigin: [nsStyleCoord; 2usize], pub mVerticalAlign: nsStyleCoord, - pub mTransitions: [u64; 7usize], + pub mTransitions: [u64; 6usize], pub mTransitionTimingFunctionCount: u32, pub mTransitionDurationCount: u32, pub mTransitionDelayCount: u32, pub mTransitionPropertyCount: u32, - pub mAnimations: [u64; 10usize], + pub mAnimations: [u64; 9usize], pub mAnimationTimingFunctionCount: u32, pub mAnimationDurationCount: u32, pub mAnimationDelayCount: u32, @@ -4622,10 +5012,11 @@ pub struct nsStyleDisplay { } #[test] fn bindgen_test_layout_nsStyleDisplay() { - assert_eq!(::std::mem::size_of::() , 448usize); + assert_eq!(::std::mem::size_of::() , 408usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleTable { pub mLayoutStrategy: u8, pub mSpan: i32, @@ -4636,6 +5027,7 @@ fn bindgen_test_layout_nsStyleTable() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleTableBorder { pub mBorderSpacingCol: nscoord, pub mBorderSpacingRow: nscoord, @@ -4664,28 +5056,29 @@ pub enum nsStyleContentType { eStyleContentType_Uninitialized = 51, } #[repr(C)] +#[derive(Debug)] pub struct nsStyleContentData { pub mType: nsStyleContentType, - pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_17, + pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_18, pub mImageTracked: bool, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleContentData_nsStyleStruct_h_unnamed_17 { +#[derive(Debug, Copy)] +pub struct nsStyleContentData_nsStyleStruct_h_unnamed_18 { pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mCounters: __BindgenUnionField<*mut Array>, pub _bindgen_data_: u64, } -impl nsStyleContentData_nsStyleStruct_h_unnamed_17 { } -impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_17 { +impl nsStyleContentData_nsStyleStruct_h_unnamed_18 { } +impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_18 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_17() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_18() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -4694,6 +5087,7 @@ fn bindgen_test_layout_nsStyleContentData() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleCounterData { pub mCounter: nsString, pub mValue: i32, @@ -4704,6 +5098,7 @@ fn bindgen_test_layout_nsStyleCounterData() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleContent { pub mMarkerOffset: nsStyleCoord, pub mContents: *mut nsStyleContentData, @@ -4719,6 +5114,7 @@ fn bindgen_test_layout_nsStyleContent() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleUIReset { pub mUserSelect: u8, pub mForceBrokenImageIcon: u8, @@ -4744,6 +5140,7 @@ fn bindgen_test_layout_nsCursorImage() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleUserInterface { pub mUserInput: u8, pub mUserModify: u8, @@ -4759,6 +5156,7 @@ fn bindgen_test_layout_nsStyleUserInterface() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleXUL { pub mBoxFlex: f32, pub mBoxOrdinal: u32, @@ -4774,6 +5172,7 @@ fn bindgen_test_layout_nsStyleXUL() { assert_eq!(::std::mem::align_of::() , 4usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleColumn { pub mColumnCount: u32, pub mColumnWidth: nsStyleCoord, @@ -4807,27 +5206,28 @@ pub enum nsStyleSVGOpacitySource { eStyleSVGOpacitySource_ContextStrokeOpacity = 2, } #[repr(C)] +#[derive(Debug)] pub struct nsStyleSVGPaint { - pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_18, + pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_19, pub mType: nsStyleSVGPaintType, pub mFallbackColor: nscolor, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_18 { +#[derive(Debug, Copy)] +pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { pub mColor: __BindgenUnionField, pub mPaintServer: __BindgenUnionField<*mut nsIURI>, pub _bindgen_data_: u64, } -impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_18 { } -impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_18 { +impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { } +impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_19 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_18() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_19() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -4836,6 +5236,7 @@ fn bindgen_test_layout_nsStyleSVGPaint() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleSVG { pub mFill: nsStyleSVGPaint, pub mStroke: nsStyleSVGPaint, @@ -4858,8 +5259,7 @@ pub struct nsStyleSVG { pub mStrokeLinecap: u8, pub mStrokeLinejoin: u8, pub mTextAnchor: u8, - pub _bitfield_1: u8, - pub _bitfield_2: u8, + pub _bitfield_1: u32, } #[test] fn bindgen_test_layout_nsStyleSVG() { @@ -4890,27 +5290,28 @@ fn bindgen_test_layout_nsStyleBasicShape() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleClipPath { pub mType: i32, - pub nsStyleClipPath_nsStyleStruct_h_unnamed_19: nsStyleClipPath_nsStyleStruct_h_unnamed_19, + pub nsStyleClipPath_nsStyleStruct_h_unnamed_20: nsStyleClipPath_nsStyleStruct_h_unnamed_20, pub mSizingBox: u8, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_19 { +#[derive(Debug, Copy)] +pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_20 { pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>, pub mURL: __BindgenUnionField<*mut nsIURI>, pub _bindgen_data_: u64, } -impl nsStyleClipPath_nsStyleStruct_h_unnamed_19 { } -impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_19 { +impl nsStyleClipPath_nsStyleStruct_h_unnamed_20 { } +impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_20 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_19() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_20() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -4919,27 +5320,28 @@ fn bindgen_test_layout_nsStyleClipPath() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] +#[derive(Debug)] pub struct nsStyleFilter { pub mType: i32, pub mFilterParameter: nsStyleCoord, - pub nsStyleFilter_nsStyleStruct_h_unnamed_20: nsStyleFilter_nsStyleStruct_h_unnamed_20, + pub nsStyleFilter_nsStyleStruct_h_unnamed_21: nsStyleFilter_nsStyleStruct_h_unnamed_21, } #[repr(C)] -#[derive(Copy, Debug)] -pub struct nsStyleFilter_nsStyleStruct_h_unnamed_20 { +#[derive(Debug, Copy)] +pub struct nsStyleFilter_nsStyleStruct_h_unnamed_21 { pub mURL: __BindgenUnionField<*mut nsIURI>, pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>, pub _bindgen_data_: u64, } -impl nsStyleFilter_nsStyleStruct_h_unnamed_20 { } -impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_20 { +impl nsStyleFilter_nsStyleStruct_h_unnamed_21 { } +impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_21 { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_20() { - assert_eq!(::std::mem::size_of::() +fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_21() { + assert_eq!(::std::mem::size_of::() , 8usize); - assert_eq!(::std::mem::align_of::() + assert_eq!(::std::mem::align_of::() , 8usize); } #[test] @@ -4968,7 +5370,7 @@ pub struct nsStyleSVGReset { } #[test] fn bindgen_test_layout_nsStyleSVGReset() { - assert_eq!(::std::mem::size_of::() , 216usize); + assert_eq!(::std::mem::size_of::() , 208usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 422b7116b29..f3827bcc6c1 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -6,6 +6,7 @@ <%! from data import to_rust_ident + from data import Keyword %> use app_units::Au; @@ -20,7 +21,7 @@ use bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; use gecko_style_structs; use heapsize::HeapSizeOf; use std::fmt::{self, Debug}; -use std::mem::zeroed; +use std::mem::{transmute, zeroed}; use std::sync::Arc; use style::custom_properties::ComputedValuesMap; use style::logical_geometry::WritingMode; @@ -95,13 +96,13 @@ impl ComputedValues for GeckoComputedValues { fn set_root_font_size(&mut self, s: Au) { self.root_font_size = s; } fn set_writing_mode(&mut self, mode: WritingMode) { self.writing_mode = mode; } + // FIXME(bholley): Implement this properly. #[inline] - fn is_multicol(&self) -> bool { unimplemented!() } + fn is_multicol(&self) -> bool { false } } <%def name="declare_style_struct(style_struct)"> #[derive(Clone, HeapSizeOf, Debug)] -#[no_move] % if style_struct.gecko_ffi_name: pub struct ${style_struct.gecko_struct_name} { gecko: ${style_struct.gecko_ffi_name}, @@ -111,21 +112,82 @@ pub struct ${style_struct.gecko_struct_name}; % endif +<%def name="impl_simple_copy(ident, gecko_ffi_name)"> + fn copy_${ident}_from(&mut self, other: &Self) { + self.gecko.${gecko_ffi_name} = other.gecko.${gecko_ffi_name}; + } + + +<%! +def is_border_style_masked(ffi_name): + return ffi_name.split("[")[0] in ["mBorderStyle", "mOutlineStyle", "mTextDecorationStyle"] + +def get_gecko_property(ffi_name): + if is_border_style_masked(ffi_name): + return "(self.gecko.%s & (gecko_style_structs::BORDER_STYLE_MASK as u8))" % ffi_name + else: + return "self.gecko.%s" % ffi_name + +def set_gecko_property(ffi_name, expr): + if is_border_style_masked(ffi_name): + return "self.gecko.%s &= !(gecko_style_structs::BORDER_STYLE_MASK as u8);" % ffi_name + \ + "self.gecko.%s |= %s as u8;" % (ffi_name, expr) + else: + return "self.gecko.%s = %s;" % (ffi_name, expr) +%> + +<%def name="impl_keyword_setter(ident, gecko_ffi_name, keyword)"> + fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { + use gecko_style_structs as gss; + use style::properties::longhands::${ident}::computed_value::T as Keyword; + // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts + let result = match v { + % for value in keyword.values_for('gecko'): + Keyword::${to_rust_ident(value)} => gss::${keyword.gecko_constant(value)} as u8, + % endfor + }; + ${set_gecko_property(gecko_ffi_name, "result")} + } + + +<%def name="impl_keyword_clone(ident, gecko_ffi_name, keyword)"> + fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { + use gecko_style_structs as gss; + use style::properties::longhands::${ident}::computed_value::T as Keyword; + // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts + match ${get_gecko_property(gecko_ffi_name)} as u32 { + % for value in keyword.values_for('gecko'): + gss::${keyword.gecko_constant(value)} => Keyword::${to_rust_ident(value)}, + % endfor + x => panic!("Found unexpected value in style struct for ${ident} property: {}", x), + } + } + + +<%def name="impl_keyword(ident, gecko_ffi_name, keyword, need_clone)"> +<%call expr="impl_keyword_setter(ident, gecko_ffi_name, keyword)"> +<%call expr="impl_simple_copy(ident, gecko_ffi_name)"> +%if need_clone: +<%call expr="impl_keyword_clone(ident, gecko_ffi_name, keyword)"> +% endif + + +<%def name="impl_app_units(ident, gecko_ffi_name, need_clone)"> + fn set_${ident}(&mut self, v: longhands::${ident}::computed_value::T) { + self.gecko.${gecko_ffi_name} = v.0; + } +<%call expr="impl_simple_copy(ident, gecko_ffi_name)"> +%if need_clone: + fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { + Au(self.gecko.${gecko_ffi_name}) + } +% endif + + <%def name="impl_style_struct(style_struct)"> impl ${style_struct.gecko_struct_name} { #[allow(dead_code, unused_variables)] fn initial() -> Arc { - // Some Gecko style structs have AutoTArray members, which have internal pointers and are - // thus MOZ_NON_MEMMOVABLE. Since Rust is generally a very move-happy language, we need to - // be very careful that nsStyle* structs are never moved after they are constructed. - // - // By annotating the structs [no_move], we can get the |rust-tenacious| linter to trigger - // an error on any semantic moves. But we don't have a great way of telling LLVM to - // allocate our new object directly on the heap without using a temporary. So to do that - // (and also please tenacious), we pass zeroed memory into the Arc constructor, and _then_ - // use make_mut to get a reference to pass to the Gecko constructor. Since the refcount is - // guaranteed to be 1, make_mut will always pass us a direct reference instead of taking - // the copy-on-write path. let mut result = Arc::new(${style_struct.gecko_struct_name} { gecko: unsafe { zeroed() } }); unsafe { Gecko_Construct_${style_struct.gecko_ffi_name}(&mut Arc::make_mut(&mut result).gecko); @@ -156,6 +218,10 @@ impl HeapSizeOf for ${style_struct.gecko_ffi_name} { // Not entirely accurate, but good enough for now. fn heap_size_of_children(&self) -> usize { 0 } } + +// FIXME(bholley): Make bindgen generate Debug for all types. +%if style_struct.gecko_ffi_name in "nsStyleBorder nsStylePosition nsStyleDisplay nsStyleList nsStyleBackground "\ + "nsStyleFont nsStyleEffects nsStyleSVGReset".split(): impl Debug for ${style_struct.gecko_ffi_name} { // FIXME(bholley): Generate this. fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -163,12 +229,12 @@ impl Debug for ${style_struct.gecko_ffi_name} { } } %endif +%endif -<%def name="raw_impl_trait(style_struct, skip_longhands=None, skip_additionals=None)"> +<%def name="raw_impl_trait(style_struct, skip_longhands='', skip_additionals='')"> <% - longhands = [x for x in style_struct.longhands - if not (skip_longhands and x.name in skip_longhands)] + longhands = [x for x in style_struct.longhands if not x.name in skip_longhands.split()] # # Make a list of types we can't auto-generate. @@ -186,11 +252,6 @@ impl Debug for ${style_struct.gecko_ffi_name} { force_stub += ["box-sizing"] # Inconsistent constant naming in gecko force_stub += ["unicode-bidi", "text-transform"] - # Need to figure out why servo has sideways-left computed value and gecko doesn't - force_stub += ["text-orientation"] - # Automatic mapping generates NS_STYLE_TEXT_DECORATION_STYLE__MOZ_NONE instead of - # NS_STYLE_TEXT_DECORATION_STYLE__NONE - force_stub += ["text-decoration-style"] # These are booleans. force_stub += ["page-break-after", "page-break-before"] @@ -207,19 +268,7 @@ impl ${style_struct.trait_name} for ${style_struct.gecko_struct_name} { * Auto-Generated Methods. */ % for longhand in keyword_longhands: - fn set_${longhand.ident}(&mut self, v: longhands::${longhand.ident}::computed_value::T) { - use gecko_style_structs as gss; - use style::properties::longhands::${longhand.ident}::computed_value::T as Keyword; - // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts - self.gecko.${longhand.gecko_ffi_name} = match v { - % for value in longhand.keyword.values_for('gecko'): - Keyword::${to_rust_ident(value)} => gss::${longhand.keyword.gecko_constant(value)} as u8, - % endfor - }; - } - fn copy_${longhand.ident}_from(&mut self, other: &Self) { - self.gecko.${longhand.gecko_ffi_name} = other.gecko.${longhand.gecko_ffi_name}; - } + <%call expr="impl_keyword(longhand.ident, longhand.gecko_ffi_name, longhand.keyword, longhand.need_clone)"> % endfor /* @@ -227,14 +276,19 @@ impl ${style_struct.trait_name} for ${style_struct.gecko_struct_name} { */ % for longhand in stub_longhands: fn set_${longhand.ident}(&mut self, _: longhands::${longhand.ident}::computed_value::T) { - unimplemented!() + println!("stylo: Unimplemented property setter: ${longhand.name}"); } fn copy_${longhand.ident}_from(&mut self, _: &Self) { + println!("stylo: Unimplemented property setter: ${longhand.name}"); + } + % if longhand.need_clone: + fn clone_${longhand.ident}(&self) -> longhands::${longhand.ident}::computed_value::T { unimplemented!() } + % endif % endfor <% additionals = [x for x in style_struct.additional_methods - if not (skip_additionals and x.name in skip_additionals)] %> + if skip_additionals != "*" and not x.name in skip_additionals.split()] %> % for additional in additionals: ${additional.stub()} % endfor @@ -242,7 +296,7 @@ impl ${style_struct.trait_name} for ${style_struct.gecko_struct_name} { <% data.manual_style_structs = [] %> -<%def name="impl_trait(style_struct_name, skip_longhands=None, skip_additionals=None)"> +<%def name="impl_trait(style_struct_name, skip_longhands='', skip_additionals='')"> <%self:raw_impl_trait style_struct="${next(x for x in data.style_structs if x.trait_name == style_struct_name)}" skip_longhands="${skip_longhands}" skip_additionals="${skip_additionals}"> ${caller.body()} @@ -250,28 +304,104 @@ ${caller.body()} <% data.manual_style_structs.append(style_struct_name) %> -// Proof-of-concept for a style struct with some manually-implemented methods. We add -// the manually-implemented methods to skip_longhands and skip_additionals, and the -// infrastructure auto-generates everything not in those lists. This allows us to -// iteratively implement more and more methods. +<%! +class Side(object): + def __init__(self, name, index): + self.name = name + self.ident = name.lower() + self.index = index + +SIDES = [Side("Top", 0), Side("Right", 1), Side("Bottom", 2), Side("Left", 3)] + +%> + +#[allow(dead_code)] +fn static_assert() { + unsafe { + % for side in SIDES: + transmute::<_, [u32; ${side.index}]>([1; gecko_style_structs::Side::eSide${side.name} as usize]); + % endfor + } +} + +<% border_style_keyword = Keyword("border-style", + "none solid double dotted dashed hidden groove ridge inset outset") %> + +<% +skip_border_longhands = "" +for side in SIDES: + skip_border_longhands += "border-{0}-style border-{0}-width ".format(side.ident) +%> + <%self:impl_trait style_struct_name="Border" - skip_longhands="${['border-left-color', 'border-left-style']}" - skip_additionals="${['border_bottom_is_none_or_hidden_and_has_nonzero_width']}"> - fn set_border_left_color(&mut self, _: longhands::border_left_color::computed_value::T) { - unimplemented!() + skip_longhands="${skip_border_longhands}" + skip_additionals="*"> + + % for side in SIDES: + <% impl_keyword("border_%s_style" % side.ident, "mBorderStyle[%s]" % side.index, border_style_keyword, + need_clone=True) %> + + <% impl_app_units("border_%s_width" % side.ident, "mComputedBorder.%s" % side.ident, need_clone=False) %> + + fn border_${side.ident}_has_nonzero_width(&self) -> bool { + self.gecko.mComputedBorder.${side.ident} != 0 } - fn copy_border_left_color_from(&mut self, _: &Self) { - unimplemented!() + % endfor + + +<%self:impl_trait style_struct_name="Outline" + skip_longhands="outline-style" + skip_additionals="*"> + + <% impl_keyword("outline_style", "mOutlineStyle", border_style_keyword, need_clone=True) %> + + fn outline_has_nonzero_width(&self) -> bool { + self.gecko.mCachedOutlineWidth != 0 } - fn set_border_left_style(&mut self, _: longhands::border_left_style::computed_value::T) { - unimplemented!() + + +<%self:impl_trait style_struct_name="Font" skip_longhands="font-size"> + + // FIXME(bholley): This doesn't handle zooming properly. + <% impl_app_units("font_size", "mSize", need_clone=True) %> + + +<%self:impl_trait style_struct_name="Box" skip_longhands="display overflow-y"> + + // We manually-implement the |display| property until we get general + // infrastructure for preffing certain values. + <% display_keyword = Keyword("display", "inline block inline-block table inline-table table-row-group " + + "table-header-group table-footer-group table-row table-column-group " + + "table-column table-cell table-caption list-item flex none") %> + <%call expr="impl_keyword('display', 'mDisplay', display_keyword, True)"> + + // overflow-y is implemented as a newtype of overflow-x, so we need special handling. + // We could generalize this if we run into other newtype keywords. + <% overflow_x = data.longhands_by_name["overflow-x"] %> + fn set_overflow_y(&mut self, v: longhands::overflow_y::computed_value::T) { + use gecko_style_structs as gss; + use style::properties::longhands::overflow_x::computed_value::T as BaseType; + // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts + self.gecko.mOverflowY = match v.0 { + % for value in overflow_x.keyword.values_for('gecko'): + BaseType::${to_rust_ident(value)} => gss::${overflow_x.keyword.gecko_constant(value)} as u8, + % endfor + }; } - fn copy_border_left_style_from(&mut self, _: &Self) { - unimplemented!() - } - fn border_bottom_is_none_or_hidden_and_has_nonzero_width(&self) -> bool { - unimplemented!() + <%call expr="impl_simple_copy('overflow_y', 'mOverflowY')"> + fn clone_overflow_y(&self) -> longhands::overflow_y::computed_value::T { + use gecko_style_structs as gss; + use style::properties::longhands::overflow_x::computed_value::T as BaseType; + use style::properties::longhands::overflow_y::computed_value::T as NewType; + // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts + match self.gecko.mOverflowY as u32 { + % for value in overflow_x.keyword.values_for('gecko'): + gss::${overflow_x.keyword.gecko_constant(value)} => NewType(BaseType::${to_rust_ident(value)}), + % endfor + x => panic!("Found unexpected value in style struct for overflow_y property: {}", x), + } } + % for style_struct in data.style_structs: diff --git a/ports/geckolib/tools/regen_style_structs.sh b/ports/geckolib/tools/regen_style_structs.sh index d4f3b822415..a00f8df9750 100755 --- a/ports/geckolib/tools/regen_style_structs.sh +++ b/ports/geckolib/tools/regen_style_structs.sh @@ -109,12 +109,14 @@ fi -match "nsIPrincipal.h" \ -match "nsDataHashtable.h" \ -match "nsCSSScanner.h" \ + -match "Types.h" \ -blacklist-type "IsDestructibleFallbackImpl" \ -blacklist-type "IsDestructibleFallback" \ -opaque-type "nsIntMargin" \ -opaque-type "nsIntPoint" \ -opaque-type "nsIntRect" \ -opaque-type "nsTArray" \ + -opaque-type "nsStyleAutoArray" \ -opaque-type "nsCOMArray" \ -opaque-type "nsDependentString" \ -opaque-type "EntryStore" \