diff options
-rw-r--r-- | components/style/properties/data.py | 17 | ||||
-rw-r--r-- | components/style/properties/gecko.mako.rs | 6 | ||||
-rw-r--r-- | components/style/properties/helpers.mako.rs | 6 | ||||
-rw-r--r-- | components/style/properties/longhand/border.mako.rs | 2 | ||||
-rw-r--r-- | components/style/properties/longhand/pointing.mako.rs | 2 | ||||
-rw-r--r-- | ports/geckolib/gecko_bindings/bindings.rs | 2 | ||||
-rw-r--r-- | ports/geckolib/gecko_bindings/structs_debug.rs | 92 | ||||
-rw-r--r-- | ports/geckolib/gecko_bindings/structs_release.rs | 92 | ||||
-rwxr-xr-x | ports/geckolib/gecko_bindings/tools/regen.py | 6 |
9 files changed, 118 insertions, 107 deletions
diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 1386d6486dd..7c63356ca22 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -18,11 +18,15 @@ def to_camel_case(ident): class Keyword(object): def __init__(self, name, values, gecko_constant_prefix=None, + gecko_enum_prefix=None, extra_gecko_values=None, extra_servo_values=None): self.name = name self.values = values.split() + if gecko_constant_prefix and gecko_enum_prefix: + raise TypeError("Only one of gecko_constant_prefix and gecko_enum_prefix can be specified") self.gecko_constant_prefix = gecko_constant_prefix or \ "NS_STYLE_" + self.name.upper().replace("-", "_") + self.gecko_enum_prefix = gecko_enum_prefix self.extra_gecko_values = (extra_gecko_values or "").split() self.extra_servo_values = (extra_servo_values or "").split() @@ -41,7 +45,18 @@ class Keyword(object): raise Exception("Bad product: " + product) def gecko_constant(self, value): - return self.gecko_constant_prefix + "_" + value.replace("-moz-", "").replace("-", "_").upper() + if self.gecko_enum_prefix: + if value == "none": + return self.gecko_enum_prefix + "::None_" + else: + parts = value.replace("-moz-", "").split("-") + parts = [p.title() for p in parts] + return self.gecko_enum_prefix + "::" + "".join(parts) + else: + return self.gecko_constant_prefix + "_" + value.replace("-moz-", "").replace("-", "_").upper() + + def needs_cast(self): + return self.gecko_enum_prefix is None class Longhand(object): diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 2209651b18b..56aa317d5ee 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -194,7 +194,11 @@ def set_gecko_property(ffi_name, expr): // 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)} => structs::${keyword.gecko_constant(value)} as u8, + % if keyword.needs_cast(): + Keyword::${to_rust_ident(value)} => structs::${keyword.gecko_constant(value)} as u8, + % else: + Keyword::${to_rust_ident(value)} => structs::${keyword.gecko_constant(value)}, + % endif % endfor }; ${set_gecko_property(gecko_ffi_name, "result")} diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 40bef518de9..fc6caa1cda3 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -289,7 +289,8 @@ <%def name="single_keyword_computed(name, values, **kwargs)"> <% keyword_kwargs = {a: kwargs.pop(a, None) for a in [ - 'gecko_constant_prefix', 'extra_gecko_values', 'extra_servo_values' + 'gecko_constant_prefix', 'gecko_enum_prefix', + 'extra_gecko_values', 'extra_servo_values', ]} %> <%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)"> @@ -317,7 +318,8 @@ <%def name="keyword_list(name, values, **kwargs)"> <% keyword_kwargs = {a: kwargs.pop(a, None) for a in [ - 'gecko_constant_prefix', 'extra_gecko_values', 'extra_servo_values' + 'gecko_constant_prefix', 'gecko_enum_prefix', + 'extra_gecko_values', 'extra_servo_values', ]} %> <%call expr="longhand(name, keyword=Keyword(name, values, **keyword_kwargs), **kwargs)"> diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index cbf97ecc0be..da34a5f8425 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -82,6 +82,6 @@ ${helpers.single_keyword("box-decoration-break", "slice clone", ${helpers.single_keyword("-moz-float-edge", "content-box margin-box", gecko_ffi_name="mFloatEdge", - gecko_constant_prefix="NS_STYLE_FLOAT_EDGE", + gecko_enum_prefix="StyleFloatEdge", products="gecko", animatable=False)} diff --git a/components/style/properties/longhand/pointing.mako.rs b/components/style/properties/longhand/pointing.mako.rs index 3bdb71d2392..859a71527ba 100644 --- a/components/style/properties/longhand/pointing.mako.rs +++ b/components/style/properties/longhand/pointing.mako.rs @@ -71,5 +71,5 @@ ${helpers.single_keyword("-moz-user-modify", "read-only read-write write-only", ${helpers.single_keyword("-moz-user-focus", "ignore normal select-after select-before select-menu select-same select-all none", products="gecko", gecko_ffi_name="mUserFocus", - gecko_constant_prefix="NS_STYLE_USER_FOCUS", + gecko_enum_prefix="StyleUserFocus", animatable=False)} diff --git a/ports/geckolib/gecko_bindings/bindings.rs b/ports/geckolib/gecko_bindings/bindings.rs index 2b861dc7069..e2bce737e7d 100644 --- a/ports/geckolib/gecko_bindings/bindings.rs +++ b/ports/geckolib/gecko_bindings/bindings.rs @@ -365,11 +365,11 @@ extern "C" { set: *mut RawServoStyleSet); pub fn Servo_RestyleSubtree(node: *mut RawGeckoNode, set: *mut RawServoStyleSet); + pub fn Servo_StyleWorkerThreadCount() -> u32; pub fn Servo_ComputeRestyleHint(element: *mut RawGeckoElement, snapshot: *mut ServoElementSnapshot, set: *mut RawServoStyleSet) -> nsRestyleHint; - pub fn Servo_StyleWorkerThreadCount() -> u32; pub fn Gecko_Construct_nsStyleFont(ptr: *mut nsStyleFont); pub fn Gecko_CopyConstruct_nsStyleFont(ptr: *mut nsStyleFont, other: *const nsStyleFont); diff --git a/ports/geckolib/gecko_bindings/structs_debug.rs b/ports/geckolib/gecko_bindings/structs_debug.rs index 91731e2e941..4b5ab65726f 100644 --- a/ports/geckolib/gecko_bindings/structs_debug.rs +++ b/ports/geckolib/gecko_bindings/structs_debug.rs @@ -188,12 +188,6 @@ pub const NS_ERROR_MODULE_BASE_OFFSET: ::std::os::raw::c_uint = 69; pub const MOZ_STRING_WITH_OBSOLETE_API: ::std::os::raw::c_uint = 1; pub const NSID_LENGTH: ::std::os::raw::c_uint = 39; pub const NS_NUMBER_OF_FLAGS_IN_REFCNT: ::std::os::raw::c_uint = 2; -pub const _STL_PAIR_H: ::std::os::raw::c_uint = 1; -pub const _GLIBCXX_UTILITY: ::std::os::raw::c_uint = 1; -pub const __cpp_lib_tuple_element_t: ::std::os::raw::c_uint = 201402; -pub const __cpp_lib_tuples_by_type: ::std::os::raw::c_uint = 201304; -pub const __cpp_lib_exchange_function: ::std::os::raw::c_uint = 201304; -pub const __cpp_lib_integer_sequence: ::std::os::raw::c_uint = 201304; pub const NS_EVENT_STATE_HIGHEST_SERVO_BIT: ::std::os::raw::c_uint = 6; pub const DOM_USER_DATA: ::std::os::raw::c_uint = 1; pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2; @@ -212,29 +206,6 @@ pub const NS_CORNER_BOTTOM_RIGHT_X: ::std::os::raw::c_uint = 4; pub const NS_CORNER_BOTTOM_RIGHT_Y: ::std::os::raw::c_uint = 5; pub const NS_CORNER_BOTTOM_LEFT_X: ::std::os::raw::c_uint = 6; pub const NS_CORNER_BOTTOM_LEFT_Y: ::std::os::raw::c_uint = 7; -pub const NS_STYLE_CLIP_SHAPE_SIZING_NOBOX: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_CLIP_SHAPE_SIZING_CONTENT: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_CLIP_SHAPE_SIZING_PADDING: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_CLIP_SHAPE_SIZING_BORDER: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_CLIP_SHAPE_SIZING_MARGIN: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_CLIP_SHAPE_SIZING_FILL: ::std::os::raw::c_uint = 5; -pub const NS_STYLE_CLIP_SHAPE_SIZING_STROKE: ::std::os::raw::c_uint = 6; -pub const NS_STYLE_CLIP_SHAPE_SIZING_VIEW: ::std::os::raw::c_uint = 7; -pub const NS_STYLE_BASIC_SHAPE_POLYGON: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_BASIC_SHAPE_CIRCLE: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_BASIC_SHAPE_ELLIPSE: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_BASIC_SHAPE_INSET: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_BOX_SHADOW_INSET: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_FLOAT_EDGE_CONTENT_BOX: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_FLOAT_EDGE_MARGIN_BOX: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_USER_FOCUS_NONE: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_USER_FOCUS_IGNORE: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_USER_FOCUS_NORMAL: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_USER_FOCUS_SELECT_ALL: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_USER_FOCUS_SELECT_BEFORE: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_USER_FOCUS_SELECT_AFTER: ::std::os::raw::c_uint = 5; -pub const NS_STYLE_USER_FOCUS_SELECT_SAME: ::std::os::raw::c_uint = 6; -pub const NS_STYLE_USER_FOCUS_SELECT_MENU: ::std::os::raw::c_uint = 7; pub const NS_STYLE_USER_SELECT_NONE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_USER_SELECT_TEXT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_USER_SELECT_ELEMENT: ::std::os::raw::c_uint = 2; @@ -511,10 +482,6 @@ pub const NS_STYLE_FLOAT_LEFT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_FLOAT_RIGHT: ::std::os::raw::c_uint = 2; pub const NS_STYLE_FLOAT_INLINE_START: ::std::os::raw::c_uint = 3; pub const NS_STYLE_FLOAT_INLINE_END: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_CLIP_PATH_NONE: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_CLIP_PATH_URL: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_CLIP_PATH_SHAPE: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_CLIP_PATH_BOX: ::std::os::raw::c_uint = 3; pub const NS_STYLE_FILTER_NONE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_FILTER_URL: ::std::os::raw::c_uint = 1; pub const NS_STYLE_FILTER_BLUR: ::std::os::raw::c_uint = 2; @@ -2735,12 +2702,6 @@ impl ::std::clone::Clone for nsIExpandedPrincipal { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _Make_integer_sequence<_Tp, _ISeq> { - pub _phantom0: ::std::marker::PhantomData<_Tp>, - pub _phantom1: ::std::marker::PhantomData<_ISeq>, -} -#[repr(C)] #[derive(Debug, Copy)] pub struct nsIURI { pub _base: nsISupports, @@ -2792,7 +2753,7 @@ impl ::std::clone::Clone for nsIRequest { #[repr(C)] #[derive(Debug, Copy)] pub struct EventStates { - pub mStates: ::std::os::raw::c_ulong, + pub mStates: ::std::os::raw::c_ulonglong, } impl ::std::clone::Clone for EventStates { fn clone(&self) -> Self { *self } @@ -2922,7 +2883,7 @@ fn bindgen_test_layout_nsMutationGuard() { extern "C" { #[link_name = "_ZN15nsMutationGuard11sGenerationE"] pub static mut nsMutationGuard_consts_sGeneration: - ::std::os::raw::c_ulong; + ::std::os::raw::c_ulonglong; } pub type Float = f32; #[repr(i8)] @@ -3022,6 +2983,7 @@ pub enum FontType { SKIA = 3, CAIRO = 4, COREGRAPHICS = 5, + FONTCONFIG = 6, } #[repr(i8)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -3918,7 +3880,43 @@ fn bindgen_test_layout_nsFont() { } #[repr(i8)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleBasicShape { Polygon = 0, Circle = 1, Ellipse = 2, Inset = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum StyleBoxSizing { Content = 0, Border = 1, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleBoxShadowType { Inset = 0, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleClipPathType { None_ = 0, URL = 1, Shape = 2, Box = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleClipShapeSizing { + NoBox = 0, + Content = 1, + Padding = 2, + Border = 3, + Margin = 4, + Fill = 5, + Stroke = 6, + View = 7, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleFloatEdge { ContentBox = 0, MarginBox = 1, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleUserFocus { + None_ = 0, + Ignore = 1, + Normal = 2, + SelectAll = 3, + SelectBefore = 4, + SelectAfter = 5, + SelectSame = 6, + SelectMenu = 7, +} pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty = nsCSSProperty::eCSSProperty_z_index; pub const eCSSProperty_all: nsCSSProperty = @@ -5598,7 +5596,7 @@ pub struct nsStyleBorder { pub mBorderImageFill: u8, pub mBorderImageRepeatH: u8, pub mBorderImageRepeatV: u8, - pub mFloatEdge: u8, + pub mFloatEdge: StyleFloatEdge, pub mBoxDecorationBreak: u8, pub mComputedBorder: nsMargin, pub mBorder: nsMargin, @@ -6171,7 +6169,7 @@ fn bindgen_test_layout_nsCursorImage() { pub struct nsStyleUserInterface { pub mUserInput: u8, pub mUserModify: u8, - pub mUserFocus: u8, + pub mUserFocus: StyleUserFocus, pub mPointerEvents: u8, pub mCursor: u8, pub mCursorArrayLength: u32, @@ -6334,9 +6332,9 @@ fn bindgen_test_layout_nsStyleBasicShape() { #[repr(C)] #[derive(Debug)] pub struct nsStyleClipPath { - pub mType: i32, pub nsStyleClipPath_nsStyleStruct_h_unnamed_29: nsStyleClipPath_nsStyleStruct_h_unnamed_29, - pub mSizingBox: u8, + pub mType: StyleClipPathType, + pub mSizingBox: StyleClipShapeSizing, } #[repr(C)] #[derive(Debug, Copy)] @@ -6358,7 +6356,7 @@ fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_29() { } #[test] fn bindgen_test_layout_nsStyleClipPath() { - assert_eq!(::std::mem::size_of::<nsStyleClipPath>() , 24usize); + assert_eq!(::std::mem::size_of::<nsStyleClipPath>() , 16usize); assert_eq!(::std::mem::align_of::<nsStyleClipPath>() , 8usize); } #[repr(C)] @@ -6406,7 +6404,7 @@ pub struct nsStyleSVGReset { } #[test] fn bindgen_test_layout_nsStyleSVGReset() { - assert_eq!(::std::mem::size_of::<nsStyleSVGReset>() , 216usize); + assert_eq!(::std::mem::size_of::<nsStyleSVGReset>() , 208usize); assert_eq!(::std::mem::align_of::<nsStyleSVGReset>() , 8usize); } #[repr(C)] diff --git a/ports/geckolib/gecko_bindings/structs_release.rs b/ports/geckolib/gecko_bindings/structs_release.rs index 75b061eb9bb..4d23f96ff80 100644 --- a/ports/geckolib/gecko_bindings/structs_release.rs +++ b/ports/geckolib/gecko_bindings/structs_release.rs @@ -188,12 +188,6 @@ pub const NS_ERROR_MODULE_BASE_OFFSET: ::std::os::raw::c_uint = 69; pub const MOZ_STRING_WITH_OBSOLETE_API: ::std::os::raw::c_uint = 1; pub const NSID_LENGTH: ::std::os::raw::c_uint = 39; pub const NS_NUMBER_OF_FLAGS_IN_REFCNT: ::std::os::raw::c_uint = 2; -pub const _STL_PAIR_H: ::std::os::raw::c_uint = 1; -pub const _GLIBCXX_UTILITY: ::std::os::raw::c_uint = 1; -pub const __cpp_lib_tuple_element_t: ::std::os::raw::c_uint = 201402; -pub const __cpp_lib_tuples_by_type: ::std::os::raw::c_uint = 201304; -pub const __cpp_lib_exchange_function: ::std::os::raw::c_uint = 201304; -pub const __cpp_lib_integer_sequence: ::std::os::raw::c_uint = 201304; pub const NS_EVENT_STATE_HIGHEST_SERVO_BIT: ::std::os::raw::c_uint = 6; pub const DOM_USER_DATA: ::std::os::raw::c_uint = 1; pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2; @@ -212,29 +206,6 @@ pub const NS_CORNER_BOTTOM_RIGHT_X: ::std::os::raw::c_uint = 4; pub const NS_CORNER_BOTTOM_RIGHT_Y: ::std::os::raw::c_uint = 5; pub const NS_CORNER_BOTTOM_LEFT_X: ::std::os::raw::c_uint = 6; pub const NS_CORNER_BOTTOM_LEFT_Y: ::std::os::raw::c_uint = 7; -pub const NS_STYLE_CLIP_SHAPE_SIZING_NOBOX: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_CLIP_SHAPE_SIZING_CONTENT: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_CLIP_SHAPE_SIZING_PADDING: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_CLIP_SHAPE_SIZING_BORDER: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_CLIP_SHAPE_SIZING_MARGIN: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_CLIP_SHAPE_SIZING_FILL: ::std::os::raw::c_uint = 5; -pub const NS_STYLE_CLIP_SHAPE_SIZING_STROKE: ::std::os::raw::c_uint = 6; -pub const NS_STYLE_CLIP_SHAPE_SIZING_VIEW: ::std::os::raw::c_uint = 7; -pub const NS_STYLE_BASIC_SHAPE_POLYGON: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_BASIC_SHAPE_CIRCLE: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_BASIC_SHAPE_ELLIPSE: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_BASIC_SHAPE_INSET: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_BOX_SHADOW_INSET: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_FLOAT_EDGE_CONTENT_BOX: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_FLOAT_EDGE_MARGIN_BOX: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_USER_FOCUS_NONE: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_USER_FOCUS_IGNORE: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_USER_FOCUS_NORMAL: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_USER_FOCUS_SELECT_ALL: ::std::os::raw::c_uint = 3; -pub const NS_STYLE_USER_FOCUS_SELECT_BEFORE: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_USER_FOCUS_SELECT_AFTER: ::std::os::raw::c_uint = 5; -pub const NS_STYLE_USER_FOCUS_SELECT_SAME: ::std::os::raw::c_uint = 6; -pub const NS_STYLE_USER_FOCUS_SELECT_MENU: ::std::os::raw::c_uint = 7; pub const NS_STYLE_USER_SELECT_NONE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_USER_SELECT_TEXT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_USER_SELECT_ELEMENT: ::std::os::raw::c_uint = 2; @@ -511,10 +482,6 @@ pub const NS_STYLE_FLOAT_LEFT: ::std::os::raw::c_uint = 1; pub const NS_STYLE_FLOAT_RIGHT: ::std::os::raw::c_uint = 2; pub const NS_STYLE_FLOAT_INLINE_START: ::std::os::raw::c_uint = 3; pub const NS_STYLE_FLOAT_INLINE_END: ::std::os::raw::c_uint = 4; -pub const NS_STYLE_CLIP_PATH_NONE: ::std::os::raw::c_uint = 0; -pub const NS_STYLE_CLIP_PATH_URL: ::std::os::raw::c_uint = 1; -pub const NS_STYLE_CLIP_PATH_SHAPE: ::std::os::raw::c_uint = 2; -pub const NS_STYLE_CLIP_PATH_BOX: ::std::os::raw::c_uint = 3; pub const NS_STYLE_FILTER_NONE: ::std::os::raw::c_uint = 0; pub const NS_STYLE_FILTER_URL: ::std::os::raw::c_uint = 1; pub const NS_STYLE_FILTER_BLUR: ::std::os::raw::c_uint = 2; @@ -2714,12 +2681,6 @@ impl ::std::clone::Clone for nsIExpandedPrincipal { fn clone(&self) -> Self { *self } } #[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _Make_integer_sequence<_Tp, _ISeq> { - pub _phantom0: ::std::marker::PhantomData<_Tp>, - pub _phantom1: ::std::marker::PhantomData<_ISeq>, -} -#[repr(C)] #[derive(Debug, Copy)] pub struct nsIURI { pub _base: nsISupports, @@ -2771,7 +2732,7 @@ impl ::std::clone::Clone for nsIRequest { #[repr(C)] #[derive(Debug, Copy)] pub struct EventStates { - pub mStates: ::std::os::raw::c_ulong, + pub mStates: ::std::os::raw::c_ulonglong, } impl ::std::clone::Clone for EventStates { fn clone(&self) -> Self { *self } @@ -2901,7 +2862,7 @@ fn bindgen_test_layout_nsMutationGuard() { extern "C" { #[link_name = "_ZN15nsMutationGuard11sGenerationE"] pub static mut nsMutationGuard_consts_sGeneration: - ::std::os::raw::c_ulong; + ::std::os::raw::c_ulonglong; } pub type Float = f32; #[repr(i8)] @@ -3001,6 +2962,7 @@ pub enum FontType { SKIA = 3, CAIRO = 4, COREGRAPHICS = 5, + FONTCONFIG = 6, } #[repr(i8)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -3897,7 +3859,43 @@ fn bindgen_test_layout_nsFont() { } #[repr(i8)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleBasicShape { Polygon = 0, Circle = 1, Ellipse = 2, Inset = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum StyleBoxSizing { Content = 0, Border = 1, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleBoxShadowType { Inset = 0, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleClipPathType { None_ = 0, URL = 1, Shape = 2, Box = 3, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleClipShapeSizing { + NoBox = 0, + Content = 1, + Padding = 2, + Border = 3, + Margin = 4, + Fill = 5, + Stroke = 6, + View = 7, +} +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleFloatEdge { ContentBox = 0, MarginBox = 1, } +#[repr(i8)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StyleUserFocus { + None_ = 0, + Ignore = 1, + Normal = 2, + SelectAll = 3, + SelectBefore = 4, + SelectAfter = 5, + SelectSame = 6, + SelectMenu = 7, +} pub const eCSSProperty_COUNT_DUMMY: nsCSSProperty = nsCSSProperty::eCSSProperty_z_index; pub const eCSSProperty_all: nsCSSProperty = @@ -5576,7 +5574,7 @@ pub struct nsStyleBorder { pub mBorderImageFill: u8, pub mBorderImageRepeatH: u8, pub mBorderImageRepeatV: u8, - pub mFloatEdge: u8, + pub mFloatEdge: StyleFloatEdge, pub mBoxDecorationBreak: u8, pub mComputedBorder: nsMargin, pub mBorder: nsMargin, @@ -6148,7 +6146,7 @@ fn bindgen_test_layout_nsCursorImage() { pub struct nsStyleUserInterface { pub mUserInput: u8, pub mUserModify: u8, - pub mUserFocus: u8, + pub mUserFocus: StyleUserFocus, pub mPointerEvents: u8, pub mCursor: u8, pub mCursorArrayLength: u32, @@ -6311,9 +6309,9 @@ fn bindgen_test_layout_nsStyleBasicShape() { #[repr(C)] #[derive(Debug)] pub struct nsStyleClipPath { - pub mType: i32, pub nsStyleClipPath_nsStyleStruct_h_unnamed_29: nsStyleClipPath_nsStyleStruct_h_unnamed_29, - pub mSizingBox: u8, + pub mType: StyleClipPathType, + pub mSizingBox: StyleClipShapeSizing, } #[repr(C)] #[derive(Debug, Copy)] @@ -6335,7 +6333,7 @@ fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_29() { } #[test] fn bindgen_test_layout_nsStyleClipPath() { - assert_eq!(::std::mem::size_of::<nsStyleClipPath>() , 24usize); + assert_eq!(::std::mem::size_of::<nsStyleClipPath>() , 16usize); assert_eq!(::std::mem::align_of::<nsStyleClipPath>() , 8usize); } #[repr(C)] @@ -6383,7 +6381,7 @@ pub struct nsStyleSVGReset { } #[test] fn bindgen_test_layout_nsStyleSVGReset() { - assert_eq!(::std::mem::size_of::<nsStyleSVGReset>() , 208usize); + assert_eq!(::std::mem::size_of::<nsStyleSVGReset>() , 200usize); assert_eq!(::std::mem::align_of::<nsStyleSVGReset>() , 8usize); } #[repr(C)] diff --git a/ports/geckolib/gecko_bindings/tools/regen.py b/ports/geckolib/gecko_bindings/tools/regen.py index 74fd3beb8ff..434de5fa024 100755 --- a/ports/geckolib/gecko_bindings/tools/regen.py +++ b/ports/geckolib/gecko_bindings/tools/regen.py @@ -98,7 +98,6 @@ COMPILATION_TARGETS = { "ImageValue", "URLValue", "URLValueData", "nsIPrincipal", "nsDataHashtable", "imgIRequest" ], - "unsafe_field_types": ["nsStyleUnion", "nsStyleUnit"], }, # Generation of the ffi bindings. "bindings": { @@ -257,11 +256,6 @@ def build(objdir, target_name, kind_name=None, flags.append("-match") flags.append(header.format(objdir)) - if "unsafe_field_types" in current_target: - for ty in current_target["unsafe_field_types"]: - flags.append("-unsafe-field-type") - flags.append(ty.format(objdir)) - if "blacklist" in current_target: for ty in current_target["blacklist"]: flags.append("-blacklist-type") |