Auto merge of #11851 - Manishearth:stylo-autoarray, r=emilio

Add support for gecko-only array values; use for stylo

Doesn't yet work, because I can't grow nsTArrays from Rust. If anyone knows how to add bindings for that, let me know!

Thoughts on the design so far? Once this PR lands, all of the array-accepting background- properties can just use gecko_autoarray_longhand and some iterators in the geckolib implementation without changing much other code to work with arrays.

cc @emilio @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11851)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-14 02:32:49 -07:00 committed by GitHub
commit ed985f75ec
11 changed files with 413 additions and 242 deletions

View file

@ -33,6 +33,85 @@
</%call> </%call>
</%def> </%def>
// FIXME (Manishearth): Add computed_value_as_specified argument
// and handle the empty case correctly
<%doc>
To be used in cases where we have a grammar like
"<thing> [ , <thing> ]*", but only support a single value
in servo
</%doc>
<%def name="gecko_autoarray_longhand(name, **kwargs)">
<%call expr="longhand(name, **kwargs)">
% if product == "gecko":
use cssparser::ToCss;
use std::fmt;
pub mod single_value {
use cssparser::Parser;
use parser::{ParserContext, ParserContextExtraData};
use properties::{CSSWideKeyword, DeclaredValue, Shorthand};
use values::computed::{TContext, ToComputedValue};
use values::{computed, specified};
${caller.body()}
}
pub mod computed_value {
use super::single_value;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Vec<single_value::computed_value::T>);
}
impl ToCss for computed_value::T {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
if !self.0.is_empty() {
try!(self.0[0].to_css(dest));
}
for i in self.0.iter().skip(1) {
try!(dest.write_str(", "));
try!(i.to_css(dest));
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct SpecifiedValue(pub Vec<single_value::SpecifiedValue>);
impl ToCss for SpecifiedValue {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
if !self.0.is_empty() {
try!(self.0[0].to_css(dest))
}
for i in self.0.iter().skip(1) {
try!(dest.write_str(", "));
try!(i.to_css(dest));
}
Ok(())
}
}
pub fn get_initial_value() -> computed_value::T {
computed_value::T(vec![single_value::get_initial_value()])
}
pub fn parse(context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
input.parse_comma_separated(|parser| {
single_value::parse(context, parser)
}).map(|ok| SpecifiedValue(ok))
}
impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T;
#[inline]
fn to_computed_value<Cx: TContext>(&self, context: &Cx) -> computed_value::T {
computed_value::T(self.0.iter().map(|x| x.to_computed_value(context)).collect())
}
}
% else:
${caller.body()}
% endif
</%call>
</%def>
<%def name="raw_longhand(*args, **kwargs)"> <%def name="raw_longhand(*args, **kwargs)">
<% <%
property = data.declare_longhand(*args, **kwargs) property = data.declare_longhand(*args, **kwargs)

View file

@ -10,7 +10,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
"::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */", "::cssparser::Color::RGBA(::cssparser::RGBA { red: 0., green: 0., blue: 0., alpha: 0. }) /* transparent */",
animatable=True)} animatable=True)}
<%helpers:longhand name="background-image" animatable="False"> <%helpers:gecko_autoarray_longhand name="background-image" animatable="False">
use cssparser::ToCss; use cssparser::ToCss;
use std::fmt; use std::fmt;
use values::specified::Image; use values::specified::Image;
@ -70,7 +70,7 @@ ${helpers.predefined_type("background-color", "CSSColor",
} }
} }
} }
</%helpers:longhand> </%helpers:gecko_autoarray_longhand>
<%helpers:longhand name="background-position" animatable="True"> <%helpers:longhand name="background-position" animatable="True">
use cssparser::ToCss; use cssparser::ToCss;

View file

@ -1,6 +1,10 @@
/* automatically generated by rust-bindgen */ /* automatically generated by rust-bindgen */
use heapsize::HeapSizeOf; use heapsize::HeapSizeOf;
pub enum nsINode {}
pub enum nsIDocument {}
pub enum nsIPrincipal {}
pub enum nsIURI {}
use structs::nsStyleFont; use structs::nsStyleFont;
unsafe impl Send for nsStyleFont {} unsafe impl Send for nsStyleFont {}
unsafe impl Sync for nsStyleFont {} unsafe impl Sync for nsStyleFont {}
@ -113,6 +117,12 @@ use structs::nsStyleGradientStop;
unsafe impl Send for nsStyleGradientStop {} unsafe impl Send for nsStyleGradientStop {}
unsafe impl Sync for nsStyleGradientStop {} unsafe impl Sync for nsStyleGradientStop {}
impl HeapSizeOf for nsStyleGradientStop { fn heap_size_of_children(&self) -> usize { 0 } } impl HeapSizeOf for nsStyleGradientStop { fn heap_size_of_children(&self) -> usize { 0 } }
use structs::nsStyleImageLayers;
unsafe impl Send for nsStyleImageLayers {}
unsafe impl Sync for nsStyleImageLayers {}
impl HeapSizeOf for nsStyleImageLayers { fn heap_size_of_children(&self) -> usize { 0 } }
use structs::nsStyleImageLayers_Layer as Layer;
use structs::nsStyleImageLayers_LayerType as LayerType;
use structs::SheetParsingMode; use structs::SheetParsingMode;
use structs::nsMainThreadPtrHandle; use structs::nsMainThreadPtrHandle;
use structs::nsMainThreadPtrHolder; use structs::nsMainThreadPtrHolder;
@ -122,13 +132,9 @@ use structs::FontFamilyList;
use structs::FontFamilyType; use structs::FontFamilyType;
use structs::nsIAtom; use structs::nsIAtom;
pub enum nsINode { }
pub type RawGeckoNode = nsINode; pub type RawGeckoNode = nsINode;
pub enum nsIPrincipal { }
pub enum nsIURI { }
pub enum Element { } pub enum Element { }
pub type RawGeckoElement = Element; pub type RawGeckoElement = Element;
pub enum nsIDocument { }
pub type RawGeckoDocument = nsIDocument; pub type RawGeckoDocument = nsIDocument;
pub enum ServoNodeData { } pub enum ServoNodeData { }
pub enum ServoComputedValues { } pub enum ServoComputedValues { }
@ -243,6 +249,12 @@ extern "C" {
pub fn Gecko_GetNodeFlags(node: *mut RawGeckoNode) -> u32; pub fn Gecko_GetNodeFlags(node: *mut RawGeckoNode) -> u32;
pub fn Gecko_SetNodeFlags(node: *mut RawGeckoNode, flags: u32); pub fn Gecko_SetNodeFlags(node: *mut RawGeckoNode, flags: u32);
pub fn Gecko_UnsetNodeFlags(node: *mut RawGeckoNode, flags: u32); pub fn Gecko_UnsetNodeFlags(node: *mut RawGeckoNode, flags: u32);
pub fn Gecko_EnsureTArrayCapacity(array: *mut ::std::os::raw::c_void,
capacity: usize, elem_size: usize);
pub fn Gecko_EnsureImageLayersLength(layers: *mut nsStyleImageLayers,
len: usize);
pub fn Gecko_InitializeImageLayer(layer: *mut Layer,
layer_type: LayerType);
pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32, pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32,
parsing_mode: SheetParsingMode, parsing_mode: SheetParsingMode,
base: *mut ThreadSafeURIHolder, base: *mut ThreadSafeURIHolder,

View file

@ -188,8 +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 MOZ_STRING_WITH_OBSOLETE_API: ::std::os::raw::c_uint = 1;
pub const NSID_LENGTH: ::std::os::raw::c_uint = 39; 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 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 DOM_USER_DATA: ::std::os::raw::c_uint = 1; pub const DOM_USER_DATA: ::std::os::raw::c_uint = 1;
pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2; pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2;
pub const TWIPS_PER_POINT_INT: ::std::os::raw::c_uint = 20; pub const TWIPS_PER_POINT_INT: ::std::os::raw::c_uint = 20;
@ -1381,7 +1379,6 @@ pub enum nsresult {
NS_ERROR_PHISHING_URI = -2141388769, NS_ERROR_PHISHING_URI = -2141388769,
NS_ERROR_TRACKING_URI = -2141388766, NS_ERROR_TRACKING_URI = -2141388766,
NS_ERROR_UNWANTED_URI = -2141388765, NS_ERROR_UNWANTED_URI = -2141388765,
NS_ERROR_FORBIDDEN_URI = -2141388764,
NS_ERROR_BLOCKED_URI = -2141388763, NS_ERROR_BLOCKED_URI = -2141388763,
NS_ERROR_SAVE_LINK_AS_TIMEOUT = -2141388768, NS_ERROR_SAVE_LINK_AS_TIMEOUT = -2141388768,
NS_ERROR_PARSED_DATA_CACHED = -2141388767, NS_ERROR_PARSED_DATA_CACHED = -2141388767,
@ -2788,9 +2785,13 @@ pub enum Element { }
pub enum Text { } pub enum Text { }
pub enum TextOrElementOrDocument { } pub enum TextOrElementOrDocument { }
pub enum DOMPointInit { } pub enum DOMPointInit { }
pub const NODE_IS_DIRTY_FOR_SERVO: nsINode_h_unnamed_8 =
nsINode_h_unnamed_8::NODE_SHARED_RESTYLE_BIT_1;
pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: nsINode_h_unnamed_8 =
nsINode_h_unnamed_8::NODE_SHARED_RESTYLE_BIT_2;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum NodeFlags { pub enum nsINode_h_unnamed_8 {
NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_LISTENERMANAGER = 4,
NODE_HAS_PROPERTIES = 8, NODE_HAS_PROPERTIES = 8,
NODE_IS_ANONYMOUS_ROOT = 16, NODE_IS_ANONYMOUS_ROOT = 16,
@ -2814,8 +2815,8 @@ pub enum NodeFlags {
NODE_ALL_DIRECTION_FLAGS = 1572864, NODE_ALL_DIRECTION_FLAGS = 1572864,
NODE_CHROME_ONLY_ACCESS = 2097152, NODE_CHROME_ONLY_ACCESS = 2097152,
NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = 4194304, NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = 4194304,
NODE_IS_DIRTY_FOR_SERVO = 8388608, NODE_SHARED_RESTYLE_BIT_1 = 8388608,
NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO = 16777216, NODE_SHARED_RESTYLE_BIT_2 = 16777216,
NODE_TYPE_SPECIFIC_BITS_OFFSET = 23, NODE_TYPE_SPECIFIC_BITS_OFFSET = 23,
} }
/** /**
@ -2840,7 +2841,7 @@ fn bindgen_test_layout_nsMutationGuard() {
extern "C" { extern "C" {
#[link_name = "_ZN15nsMutationGuard11sGenerationE"] #[link_name = "_ZN15nsMutationGuard11sGenerationE"]
pub static mut nsMutationGuard_consts_sGeneration: pub static mut nsMutationGuard_consts_sGeneration:
::std::os::raw::c_ulong; ::std::os::raw::c_ulonglong;
} }
pub type Float = f32; pub type Float = f32;
#[repr(i8)] #[repr(i8)]
@ -3073,7 +3074,7 @@ pub type gfxImageFormat = SurfaceFormat;
pub struct RectCorner; pub struct RectCorner;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum RectCorner_Types_h_unnamed_10 { pub enum RectCorner_Types_h_unnamed_11 {
TopLeft = 0, TopLeft = 0,
TopRight = 1, TopRight = 1,
BottomRight = 2, BottomRight = 2,
@ -4304,14 +4305,14 @@ pub enum nsCSSUnit {
#[derive(Debug)] #[derive(Debug)]
pub struct nsCSSValue { pub struct nsCSSValue {
pub mUnit: nsCSSUnit, pub mUnit: nsCSSUnit,
pub mValue: nsCSSValue_nsCSSValue_h_unnamed_12, pub mValue: nsCSSValue_nsCSSValue_h_unnamed_13,
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsCSSValue_Serialization { eNormalized = 0, eAuthorSpecified = 1, } pub enum nsCSSValue_Serialization { eNormalized = 0, eAuthorSpecified = 1, }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsCSSValue_nsCSSValue_h_unnamed_12 { pub struct nsCSSValue_nsCSSValue_h_unnamed_13 {
pub mInt: __BindgenUnionField<i32>, pub mInt: __BindgenUnionField<i32>,
pub mFloat: __BindgenUnionField<f32>, pub mFloat: __BindgenUnionField<f32>,
pub mString: __BindgenUnionField<*mut nsStringBuffer>, pub mString: __BindgenUnionField<*mut nsStringBuffer>,
@ -4334,15 +4335,15 @@ pub struct nsCSSValue_nsCSSValue_h_unnamed_12 {
pub mFontFamilyList: __BindgenUnionField<*mut FontFamilyListRefCnt>, pub mFontFamilyList: __BindgenUnionField<*mut FontFamilyListRefCnt>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsCSSValue_nsCSSValue_h_unnamed_12 { } impl nsCSSValue_nsCSSValue_h_unnamed_13 { }
impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_12 { impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_13 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_12() { fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_13() {
assert_eq!(::std::mem::size_of::<nsCSSValue_nsCSSValue_h_unnamed_12>() , assert_eq!(::std::mem::size_of::<nsCSSValue_nsCSSValue_h_unnamed_13>() ,
8usize); 8usize);
assert_eq!(::std::mem::align_of::<nsCSSValue_nsCSSValue_h_unnamed_12>() , assert_eq!(::std::mem::align_of::<nsCSSValue_nsCSSValue_h_unnamed_13>() ,
8usize); 8usize);
} }
#[test] #[test]
@ -4663,7 +4664,7 @@ pub struct ArenaRefPtr<T> {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_13 { pub enum gfxFontConstants_h_unnamed_14 {
eFeatureAlternates_historical = 0, eFeatureAlternates_historical = 0,
eFeatureAlternates_stylistic = 1, eFeatureAlternates_stylistic = 1,
eFeatureAlternates_styleset = 2, eFeatureAlternates_styleset = 2,
@ -4675,7 +4676,7 @@ pub enum gfxFontConstants_h_unnamed_13 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_14 { pub enum gfxFontConstants_h_unnamed_15 {
eFeatureEastAsian_jis78 = 0, eFeatureEastAsian_jis78 = 0,
eFeatureEastAsian_jis83 = 1, eFeatureEastAsian_jis83 = 1,
eFeatureEastAsian_jis90 = 2, eFeatureEastAsian_jis90 = 2,
@ -4689,7 +4690,7 @@ pub enum gfxFontConstants_h_unnamed_14 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_15 { pub enum gfxFontConstants_h_unnamed_16 {
eFeatureLigatures_none = 0, eFeatureLigatures_none = 0,
eFeatureLigatures_common = 1, eFeatureLigatures_common = 1,
eFeatureLigatures_no_common = 2, eFeatureLigatures_no_common = 2,
@ -4703,7 +4704,7 @@ pub enum gfxFontConstants_h_unnamed_15 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_16 { pub enum gfxFontConstants_h_unnamed_17 {
eFeatureNumeric_lining = 0, eFeatureNumeric_lining = 0,
eFeatureNumeric_oldstyle = 1, eFeatureNumeric_oldstyle = 1,
eFeatureNumeric_proportional = 2, eFeatureNumeric_proportional = 2,
@ -4790,22 +4791,22 @@ pub enum nsStyleUnit {
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleCoord_h_unnamed_17 { pub struct nsStyleCoord_h_unnamed_18 {
pub mInt: __BindgenUnionField<i32>, pub mInt: __BindgenUnionField<i32>,
pub mFloat: __BindgenUnionField<f32>, pub mFloat: __BindgenUnionField<f32>,
pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>, pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleCoord_h_unnamed_17 { } impl nsStyleCoord_h_unnamed_18 { }
impl ::std::clone::Clone for nsStyleCoord_h_unnamed_17 { impl ::std::clone::Clone for nsStyleCoord_h_unnamed_18 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleCoord_h_unnamed_17() { fn bindgen_test_layout_nsStyleCoord_h_unnamed_18() {
assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_17>() , 8usize); assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_18>() , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_17>() , 8usize); assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_18>() , 8usize);
} }
pub type nsStyleUnion = nsStyleCoord_h_unnamed_17; pub type nsStyleUnion = nsStyleCoord_h_unnamed_18;
/** /**
* Class that hold a single size specification used by the style * Class that hold a single size specification used by the style
* system. The size specification consists of two parts -- a number * system. The size specification consists of two parts -- a number
@ -4998,27 +4999,27 @@ pub enum nsStyleImageType {
pub struct nsStyleImage { pub struct nsStyleImage {
pub mSubImages: u64, pub mSubImages: u64,
pub mType: nsStyleImageType, pub mType: nsStyleImageType,
pub nsStyleImage_nsStyleStruct_h_unnamed_20: nsStyleImage_nsStyleStruct_h_unnamed_20, pub nsStyleImage_nsStyleStruct_h_unnamed_21: nsStyleImage_nsStyleStruct_h_unnamed_21,
pub mCropRect: nsAutoPtr<nsStyleSides>, pub mCropRect: nsAutoPtr<nsStyleSides>,
pub mImageTracked: bool, pub mImageTracked: bool,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleImage_nsStyleStruct_h_unnamed_20 { pub struct nsStyleImage_nsStyleStruct_h_unnamed_21 {
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mGradient: __BindgenUnionField<*mut nsStyleGradient>, pub mGradient: __BindgenUnionField<*mut nsStyleGradient>,
pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleImage_nsStyleStruct_h_unnamed_20 { } impl nsStyleImage_nsStyleStruct_h_unnamed_21 { }
impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_20 { impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_21 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_20() { fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_21() {
assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_21>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_21>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5068,7 +5069,7 @@ pub struct nsStyleImageLayers {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_21 { pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_22 {
shorthand = 0, shorthand = 0,
color = 1, color = 1,
image = 2, image = 2,
@ -5535,7 +5536,7 @@ fn bindgen_test_layout_nsStyleVisibility() {
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction { pub struct nsTimingFunction {
pub mType: nsTimingFunction_Type, pub mType: nsTimingFunction_Type,
pub nsTimingFunction_nsStyleStruct_h_unnamed_22: nsTimingFunction_nsStyleStruct_h_unnamed_22, pub nsTimingFunction_nsStyleStruct_h_unnamed_23: nsTimingFunction_nsStyleStruct_h_unnamed_23,
} }
#[repr(i32)] #[repr(i32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
@ -5562,56 +5563,56 @@ pub enum nsTimingFunction_StepSyntax {
pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, } pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23 {
pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>, pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>,
pub nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>, pub nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>,
pub _bindgen_data_: [u32; 4usize], pub _bindgen_data_: [u32; 4usize],
} }
impl nsTimingFunction_nsStyleStruct_h_unnamed_22 { } impl nsTimingFunction_nsStyleStruct_h_unnamed_23 { }
impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_22 { impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_23 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24 {
pub mX1: f32, pub mX1: f32,
pub mY1: f32, pub mY1: f32,
pub mX2: f32, pub mX2: f32,
pub mY2: f32, pub mY2: f32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23 { nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25 {
pub mStepSyntax: nsTimingFunction_StepSyntax, pub mStepSyntax: nsTimingFunction_StepSyntax,
pub mSteps: u32, pub mSteps: u32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24 { nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>()
, 4usize); , 4usize);
} }
impl ::std::clone::Clone for nsTimingFunction { impl ::std::clone::Clone for nsTimingFunction {
@ -5756,26 +5757,26 @@ pub enum nsStyleContentType {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleContentData { pub struct nsStyleContentData {
pub mType: nsStyleContentType, pub mType: nsStyleContentType,
pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_25, pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_26,
pub mImageTracked: bool, pub mImageTracked: bool,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleContentData_nsStyleStruct_h_unnamed_25 { pub struct nsStyleContentData_nsStyleStruct_h_unnamed_26 {
pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mCounters: __BindgenUnionField<*mut Array>, pub mCounters: __BindgenUnionField<*mut Array>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleContentData_nsStyleStruct_h_unnamed_25 { } impl nsStyleContentData_nsStyleStruct_h_unnamed_26 { }
impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_25 { impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_26 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_25() { fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_26() {
assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_25>() assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_26>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_25>() assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_26>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5909,26 +5910,26 @@ pub enum nsStyleSVGOpacitySource {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleSVGPaint { pub struct nsStyleSVGPaint {
pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_26, pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_27,
pub mType: nsStyleSVGPaintType, pub mType: nsStyleSVGPaintType,
pub mFallbackColor: nscolor, pub mFallbackColor: nscolor,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 {
pub mColor: __BindgenUnionField<nscolor>, pub mColor: __BindgenUnionField<nscolor>,
pub mPaintServer: __BindgenUnionField<*mut nsIURI>, pub mPaintServer: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { } impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 { }
impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_26() { fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_27() {
assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_26>() assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_27>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_26>() assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_27>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5963,7 +5964,7 @@ pub struct nsStyleSVG {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsStyleSVG_nsStyleStruct_h_unnamed_27 { pub enum nsStyleSVG_nsStyleStruct_h_unnamed_28 {
FILL_OPACITY_SOURCE_MASK = 3, FILL_OPACITY_SOURCE_MASK = 3,
STROKE_OPACITY_SOURCE_MASK = 12, STROKE_OPACITY_SOURCE_MASK = 12,
STROKE_DASHARRAY_CONTEXT = 16, STROKE_DASHARRAY_CONTEXT = 16,
@ -6005,25 +6006,25 @@ fn bindgen_test_layout_nsStyleBasicShape() {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleClipPath { pub struct nsStyleClipPath {
pub mType: i32, pub mType: i32,
pub nsStyleClipPath_nsStyleStruct_h_unnamed_28: nsStyleClipPath_nsStyleStruct_h_unnamed_28, pub nsStyleClipPath_nsStyleStruct_h_unnamed_29: nsStyleClipPath_nsStyleStruct_h_unnamed_29,
pub mSizingBox: u8, pub mSizingBox: u8,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_28 { pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_29 {
pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>, pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>,
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleClipPath_nsStyleStruct_h_unnamed_28 { } impl nsStyleClipPath_nsStyleStruct_h_unnamed_29 { }
impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_28 { impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_29 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_28() { fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_29() {
assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_28>() assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_29>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_28>() assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_29>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -6036,24 +6037,24 @@ fn bindgen_test_layout_nsStyleClipPath() {
pub struct nsStyleFilter { pub struct nsStyleFilter {
pub mType: i32, pub mType: i32,
pub mFilterParameter: nsStyleCoord, pub mFilterParameter: nsStyleCoord,
pub nsStyleFilter_nsStyleStruct_h_unnamed_29: nsStyleFilter_nsStyleStruct_h_unnamed_29, pub nsStyleFilter_nsStyleStruct_h_unnamed_30: nsStyleFilter_nsStyleStruct_h_unnamed_30,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleFilter_nsStyleStruct_h_unnamed_29 { pub struct nsStyleFilter_nsStyleStruct_h_unnamed_30 {
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>, pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleFilter_nsStyleStruct_h_unnamed_29 { } impl nsStyleFilter_nsStyleStruct_h_unnamed_30 { }
impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_29 { impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_30 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_29() { fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_30() {
assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_29>() assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_30>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_29>() assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_30>()
, 8usize); , 8usize);
} }
#[test] #[test]

View file

@ -188,8 +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 MOZ_STRING_WITH_OBSOLETE_API: ::std::os::raw::c_uint = 1;
pub const NSID_LENGTH: ::std::os::raw::c_uint = 39; 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 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 DOM_USER_DATA: ::std::os::raw::c_uint = 1; pub const DOM_USER_DATA: ::std::os::raw::c_uint = 1;
pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2; pub const SMIL_MAPPED_ATTR_ANIMVAL: ::std::os::raw::c_uint = 2;
pub const TWIPS_PER_POINT_INT: ::std::os::raw::c_uint = 20; pub const TWIPS_PER_POINT_INT: ::std::os::raw::c_uint = 20;
@ -1381,7 +1379,6 @@ pub enum nsresult {
NS_ERROR_PHISHING_URI = -2141388769, NS_ERROR_PHISHING_URI = -2141388769,
NS_ERROR_TRACKING_URI = -2141388766, NS_ERROR_TRACKING_URI = -2141388766,
NS_ERROR_UNWANTED_URI = -2141388765, NS_ERROR_UNWANTED_URI = -2141388765,
NS_ERROR_FORBIDDEN_URI = -2141388764,
NS_ERROR_BLOCKED_URI = -2141388763, NS_ERROR_BLOCKED_URI = -2141388763,
NS_ERROR_SAVE_LINK_AS_TIMEOUT = -2141388768, NS_ERROR_SAVE_LINK_AS_TIMEOUT = -2141388768,
NS_ERROR_PARSED_DATA_CACHED = -2141388767, NS_ERROR_PARSED_DATA_CACHED = -2141388767,
@ -2767,9 +2764,13 @@ pub enum Element { }
pub enum Text { } pub enum Text { }
pub enum TextOrElementOrDocument { } pub enum TextOrElementOrDocument { }
pub enum DOMPointInit { } pub enum DOMPointInit { }
pub const NODE_IS_DIRTY_FOR_SERVO: nsINode_h_unnamed_8 =
nsINode_h_unnamed_8::NODE_SHARED_RESTYLE_BIT_1;
pub const NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO: nsINode_h_unnamed_8 =
nsINode_h_unnamed_8::NODE_SHARED_RESTYLE_BIT_2;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum NodeFlags { pub enum nsINode_h_unnamed_8 {
NODE_HAS_LISTENERMANAGER = 4, NODE_HAS_LISTENERMANAGER = 4,
NODE_HAS_PROPERTIES = 8, NODE_HAS_PROPERTIES = 8,
NODE_IS_ANONYMOUS_ROOT = 16, NODE_IS_ANONYMOUS_ROOT = 16,
@ -2793,8 +2794,8 @@ pub enum NodeFlags {
NODE_ALL_DIRECTION_FLAGS = 1572864, NODE_ALL_DIRECTION_FLAGS = 1572864,
NODE_CHROME_ONLY_ACCESS = 2097152, NODE_CHROME_ONLY_ACCESS = 2097152,
NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = 4194304, NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS = 4194304,
NODE_IS_DIRTY_FOR_SERVO = 8388608, NODE_SHARED_RESTYLE_BIT_1 = 8388608,
NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO = 16777216, NODE_SHARED_RESTYLE_BIT_2 = 16777216,
NODE_TYPE_SPECIFIC_BITS_OFFSET = 23, NODE_TYPE_SPECIFIC_BITS_OFFSET = 23,
} }
/** /**
@ -2819,7 +2820,7 @@ fn bindgen_test_layout_nsMutationGuard() {
extern "C" { extern "C" {
#[link_name = "_ZN15nsMutationGuard11sGenerationE"] #[link_name = "_ZN15nsMutationGuard11sGenerationE"]
pub static mut nsMutationGuard_consts_sGeneration: pub static mut nsMutationGuard_consts_sGeneration:
::std::os::raw::c_ulong; ::std::os::raw::c_ulonglong;
} }
pub type Float = f32; pub type Float = f32;
#[repr(i8)] #[repr(i8)]
@ -3052,7 +3053,7 @@ pub type gfxImageFormat = SurfaceFormat;
pub struct RectCorner; pub struct RectCorner;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum RectCorner_Types_h_unnamed_10 { pub enum RectCorner_Types_h_unnamed_11 {
TopLeft = 0, TopLeft = 0,
TopRight = 1, TopRight = 1,
BottomRight = 2, BottomRight = 2,
@ -4283,14 +4284,14 @@ pub enum nsCSSUnit {
#[derive(Debug)] #[derive(Debug)]
pub struct nsCSSValue { pub struct nsCSSValue {
pub mUnit: nsCSSUnit, pub mUnit: nsCSSUnit,
pub mValue: nsCSSValue_nsCSSValue_h_unnamed_12, pub mValue: nsCSSValue_nsCSSValue_h_unnamed_13,
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsCSSValue_Serialization { eNormalized = 0, eAuthorSpecified = 1, } pub enum nsCSSValue_Serialization { eNormalized = 0, eAuthorSpecified = 1, }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsCSSValue_nsCSSValue_h_unnamed_12 { pub struct nsCSSValue_nsCSSValue_h_unnamed_13 {
pub mInt: __BindgenUnionField<i32>, pub mInt: __BindgenUnionField<i32>,
pub mFloat: __BindgenUnionField<f32>, pub mFloat: __BindgenUnionField<f32>,
pub mString: __BindgenUnionField<*mut nsStringBuffer>, pub mString: __BindgenUnionField<*mut nsStringBuffer>,
@ -4313,15 +4314,15 @@ pub struct nsCSSValue_nsCSSValue_h_unnamed_12 {
pub mFontFamilyList: __BindgenUnionField<*mut FontFamilyListRefCnt>, pub mFontFamilyList: __BindgenUnionField<*mut FontFamilyListRefCnt>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsCSSValue_nsCSSValue_h_unnamed_12 { } impl nsCSSValue_nsCSSValue_h_unnamed_13 { }
impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_12 { impl ::std::clone::Clone for nsCSSValue_nsCSSValue_h_unnamed_13 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_12() { fn bindgen_test_layout_nsCSSValue_nsCSSValue_h_unnamed_13() {
assert_eq!(::std::mem::size_of::<nsCSSValue_nsCSSValue_h_unnamed_12>() , assert_eq!(::std::mem::size_of::<nsCSSValue_nsCSSValue_h_unnamed_13>() ,
8usize); 8usize);
assert_eq!(::std::mem::align_of::<nsCSSValue_nsCSSValue_h_unnamed_12>() , assert_eq!(::std::mem::align_of::<nsCSSValue_nsCSSValue_h_unnamed_13>() ,
8usize); 8usize);
} }
#[test] #[test]
@ -4642,7 +4643,7 @@ pub struct ArenaRefPtr<T> {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_13 { pub enum gfxFontConstants_h_unnamed_14 {
eFeatureAlternates_historical = 0, eFeatureAlternates_historical = 0,
eFeatureAlternates_stylistic = 1, eFeatureAlternates_stylistic = 1,
eFeatureAlternates_styleset = 2, eFeatureAlternates_styleset = 2,
@ -4654,7 +4655,7 @@ pub enum gfxFontConstants_h_unnamed_13 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_14 { pub enum gfxFontConstants_h_unnamed_15 {
eFeatureEastAsian_jis78 = 0, eFeatureEastAsian_jis78 = 0,
eFeatureEastAsian_jis83 = 1, eFeatureEastAsian_jis83 = 1,
eFeatureEastAsian_jis90 = 2, eFeatureEastAsian_jis90 = 2,
@ -4668,7 +4669,7 @@ pub enum gfxFontConstants_h_unnamed_14 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_15 { pub enum gfxFontConstants_h_unnamed_16 {
eFeatureLigatures_none = 0, eFeatureLigatures_none = 0,
eFeatureLigatures_common = 1, eFeatureLigatures_common = 1,
eFeatureLigatures_no_common = 2, eFeatureLigatures_no_common = 2,
@ -4682,7 +4683,7 @@ pub enum gfxFontConstants_h_unnamed_15 {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum gfxFontConstants_h_unnamed_16 { pub enum gfxFontConstants_h_unnamed_17 {
eFeatureNumeric_lining = 0, eFeatureNumeric_lining = 0,
eFeatureNumeric_oldstyle = 1, eFeatureNumeric_oldstyle = 1,
eFeatureNumeric_proportional = 2, eFeatureNumeric_proportional = 2,
@ -4769,22 +4770,22 @@ pub enum nsStyleUnit {
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleCoord_h_unnamed_17 { pub struct nsStyleCoord_h_unnamed_18 {
pub mInt: __BindgenUnionField<i32>, pub mInt: __BindgenUnionField<i32>,
pub mFloat: __BindgenUnionField<f32>, pub mFloat: __BindgenUnionField<f32>,
pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>, pub mPointer: __BindgenUnionField<*mut ::std::os::raw::c_void>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleCoord_h_unnamed_17 { } impl nsStyleCoord_h_unnamed_18 { }
impl ::std::clone::Clone for nsStyleCoord_h_unnamed_17 { impl ::std::clone::Clone for nsStyleCoord_h_unnamed_18 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleCoord_h_unnamed_17() { fn bindgen_test_layout_nsStyleCoord_h_unnamed_18() {
assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_17>() , 8usize); assert_eq!(::std::mem::size_of::<nsStyleCoord_h_unnamed_18>() , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_17>() , 8usize); assert_eq!(::std::mem::align_of::<nsStyleCoord_h_unnamed_18>() , 8usize);
} }
pub type nsStyleUnion = nsStyleCoord_h_unnamed_17; pub type nsStyleUnion = nsStyleCoord_h_unnamed_18;
/** /**
* Class that hold a single size specification used by the style * Class that hold a single size specification used by the style
* system. The size specification consists of two parts -- a number * system. The size specification consists of two parts -- a number
@ -4977,26 +4978,26 @@ pub enum nsStyleImageType {
pub struct nsStyleImage { pub struct nsStyleImage {
pub mSubImages: u64, pub mSubImages: u64,
pub mType: nsStyleImageType, pub mType: nsStyleImageType,
pub nsStyleImage_nsStyleStruct_h_unnamed_20: nsStyleImage_nsStyleStruct_h_unnamed_20, pub nsStyleImage_nsStyleStruct_h_unnamed_21: nsStyleImage_nsStyleStruct_h_unnamed_21,
pub mCropRect: nsAutoPtr<nsStyleSides>, pub mCropRect: nsAutoPtr<nsStyleSides>,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleImage_nsStyleStruct_h_unnamed_20 { pub struct nsStyleImage_nsStyleStruct_h_unnamed_21 {
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mGradient: __BindgenUnionField<*mut nsStyleGradient>, pub mGradient: __BindgenUnionField<*mut nsStyleGradient>,
pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mElementId: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleImage_nsStyleStruct_h_unnamed_20 { } impl nsStyleImage_nsStyleStruct_h_unnamed_21 { }
impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_20 { impl ::std::clone::Clone for nsStyleImage_nsStyleStruct_h_unnamed_21 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_20() { fn bindgen_test_layout_nsStyleImage_nsStyleStruct_h_unnamed_21() {
assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::size_of::<nsStyleImage_nsStyleStruct_h_unnamed_21>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_20>() assert_eq!(::std::mem::align_of::<nsStyleImage_nsStyleStruct_h_unnamed_21>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5046,7 +5047,7 @@ pub struct nsStyleImageLayers {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_21 { pub enum nsStyleImageLayers_nsStyleStruct_h_unnamed_22 {
shorthand = 0, shorthand = 0,
color = 1, color = 1,
image = 2, image = 2,
@ -5513,7 +5514,7 @@ fn bindgen_test_layout_nsStyleVisibility() {
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction { pub struct nsTimingFunction {
pub mType: nsTimingFunction_Type, pub mType: nsTimingFunction_Type,
pub nsTimingFunction_nsStyleStruct_h_unnamed_22: nsTimingFunction_nsStyleStruct_h_unnamed_22, pub nsTimingFunction_nsStyleStruct_h_unnamed_23: nsTimingFunction_nsStyleStruct_h_unnamed_23,
} }
#[repr(i32)] #[repr(i32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
@ -5540,56 +5541,56 @@ pub enum nsTimingFunction_StepSyntax {
pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, } pub enum nsTimingFunction_Keyword { Implicit = 0, Explicit = 1, }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23 {
pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>, pub mFunc: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>,
pub nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>, pub nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25: __BindgenUnionField<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>,
pub _bindgen_data_: [u32; 4usize], pub _bindgen_data_: [u32; 4usize],
} }
impl nsTimingFunction_nsStyleStruct_h_unnamed_22 { } impl nsTimingFunction_nsStyleStruct_h_unnamed_23 { }
impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_22 { impl ::std::clone::Clone for nsTimingFunction_nsStyleStruct_h_unnamed_23 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24 {
pub mX1: f32, pub mX1: f32,
pub mY1: f32, pub mY1: f32,
pub mX2: f32, pub mX2: f32,
pub mY2: f32, pub mY2: f32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23 { nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>()
, 16usize); , 16usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_23>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_24>()
, 4usize); , 4usize);
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24 { pub struct nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25 {
pub mStepSyntax: nsTimingFunction_StepSyntax, pub mStepSyntax: nsTimingFunction_StepSyntax,
pub mSteps: u32, pub mSteps: u32,
} }
impl ::std::clone::Clone for impl ::std::clone::Clone for
nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24 { nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24() { fn bindgen_test_layout_nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25() {
assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>() assert_eq!(::std::mem::size_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_22_nsStyleStruct_h_unnamed_24>() assert_eq!(::std::mem::align_of::<nsTimingFunction_nsStyleStruct_h_unnamed_23_nsStyleStruct_h_unnamed_25>()
, 4usize); , 4usize);
} }
impl ::std::clone::Clone for nsTimingFunction { impl ::std::clone::Clone for nsTimingFunction {
@ -5734,25 +5735,25 @@ pub enum nsStyleContentType {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleContentData { pub struct nsStyleContentData {
pub mType: nsStyleContentType, pub mType: nsStyleContentType,
pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_25, pub mContent: nsStyleContentData_nsStyleStruct_h_unnamed_26,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleContentData_nsStyleStruct_h_unnamed_25 { pub struct nsStyleContentData_nsStyleStruct_h_unnamed_26 {
pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>, pub mString: __BindgenUnionField<*mut ::std::os::raw::c_ushort>,
pub mImage: __BindgenUnionField<*mut imgRequestProxy>, pub mImage: __BindgenUnionField<*mut imgRequestProxy>,
pub mCounters: __BindgenUnionField<*mut Array>, pub mCounters: __BindgenUnionField<*mut Array>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleContentData_nsStyleStruct_h_unnamed_25 { } impl nsStyleContentData_nsStyleStruct_h_unnamed_26 { }
impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_25 { impl ::std::clone::Clone for nsStyleContentData_nsStyleStruct_h_unnamed_26 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_25() { fn bindgen_test_layout_nsStyleContentData_nsStyleStruct_h_unnamed_26() {
assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_25>() assert_eq!(::std::mem::size_of::<nsStyleContentData_nsStyleStruct_h_unnamed_26>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_25>() assert_eq!(::std::mem::align_of::<nsStyleContentData_nsStyleStruct_h_unnamed_26>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5886,26 +5887,26 @@ pub enum nsStyleSVGOpacitySource {
#[repr(C)] #[repr(C)]
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleSVGPaint { pub struct nsStyleSVGPaint {
pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_26, pub mPaint: nsStyleSVGPaint_nsStyleStruct_h_unnamed_27,
pub mType: nsStyleSVGPaintType, pub mType: nsStyleSVGPaintType,
pub mFallbackColor: nscolor, pub mFallbackColor: nscolor,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { pub struct nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 {
pub mColor: __BindgenUnionField<nscolor>, pub mColor: __BindgenUnionField<nscolor>,
pub mPaintServer: __BindgenUnionField<*mut nsIURI>, pub mPaintServer: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { } impl nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 { }
impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_26 { impl ::std::clone::Clone for nsStyleSVGPaint_nsStyleStruct_h_unnamed_27 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_26() { fn bindgen_test_layout_nsStyleSVGPaint_nsStyleStruct_h_unnamed_27() {
assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_26>() assert_eq!(::std::mem::size_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_27>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_26>() assert_eq!(::std::mem::align_of::<nsStyleSVGPaint_nsStyleStruct_h_unnamed_27>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -5940,7 +5941,7 @@ pub struct nsStyleSVG {
} }
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum nsStyleSVG_nsStyleStruct_h_unnamed_27 { pub enum nsStyleSVG_nsStyleStruct_h_unnamed_28 {
FILL_OPACITY_SOURCE_MASK = 3, FILL_OPACITY_SOURCE_MASK = 3,
STROKE_OPACITY_SOURCE_MASK = 12, STROKE_OPACITY_SOURCE_MASK = 12,
STROKE_DASHARRAY_CONTEXT = 16, STROKE_DASHARRAY_CONTEXT = 16,
@ -5982,25 +5983,25 @@ fn bindgen_test_layout_nsStyleBasicShape() {
#[derive(Debug)] #[derive(Debug)]
pub struct nsStyleClipPath { pub struct nsStyleClipPath {
pub mType: i32, pub mType: i32,
pub nsStyleClipPath_nsStyleStruct_h_unnamed_28: nsStyleClipPath_nsStyleStruct_h_unnamed_28, pub nsStyleClipPath_nsStyleStruct_h_unnamed_29: nsStyleClipPath_nsStyleStruct_h_unnamed_29,
pub mSizingBox: u8, pub mSizingBox: u8,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_28 { pub struct nsStyleClipPath_nsStyleStruct_h_unnamed_29 {
pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>, pub mBasicShape: __BindgenUnionField<*mut nsStyleBasicShape>,
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleClipPath_nsStyleStruct_h_unnamed_28 { } impl nsStyleClipPath_nsStyleStruct_h_unnamed_29 { }
impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_28 { impl ::std::clone::Clone for nsStyleClipPath_nsStyleStruct_h_unnamed_29 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_28() { fn bindgen_test_layout_nsStyleClipPath_nsStyleStruct_h_unnamed_29() {
assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_28>() assert_eq!(::std::mem::size_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_29>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_28>() assert_eq!(::std::mem::align_of::<nsStyleClipPath_nsStyleStruct_h_unnamed_29>()
, 8usize); , 8usize);
} }
#[test] #[test]
@ -6013,24 +6014,24 @@ fn bindgen_test_layout_nsStyleClipPath() {
pub struct nsStyleFilter { pub struct nsStyleFilter {
pub mType: i32, pub mType: i32,
pub mFilterParameter: nsStyleCoord, pub mFilterParameter: nsStyleCoord,
pub nsStyleFilter_nsStyleStruct_h_unnamed_29: nsStyleFilter_nsStyleStruct_h_unnamed_29, pub nsStyleFilter_nsStyleStruct_h_unnamed_30: nsStyleFilter_nsStyleStruct_h_unnamed_30,
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct nsStyleFilter_nsStyleStruct_h_unnamed_29 { pub struct nsStyleFilter_nsStyleStruct_h_unnamed_30 {
pub mURL: __BindgenUnionField<*mut nsIURI>, pub mURL: __BindgenUnionField<*mut nsIURI>,
pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>, pub mDropShadow: __BindgenUnionField<*mut nsCSSShadowArray>,
pub _bindgen_data_: u64, pub _bindgen_data_: u64,
} }
impl nsStyleFilter_nsStyleStruct_h_unnamed_29 { } impl nsStyleFilter_nsStyleStruct_h_unnamed_30 { }
impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_29 { impl ::std::clone::Clone for nsStyleFilter_nsStyleStruct_h_unnamed_30 {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[test] #[test]
fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_29() { fn bindgen_test_layout_nsStyleFilter_nsStyleStruct_h_unnamed_30() {
assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_29>() assert_eq!(::std::mem::size_of::<nsStyleFilter_nsStyleStruct_h_unnamed_30>()
, 8usize); , 8usize);
assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_29>() assert_eq!(::std::mem::align_of::<nsStyleFilter_nsStyleStruct_h_unnamed_30>()
, 8usize); , 8usize);
} }
#[test] #[test]

View file

@ -2,4 +2,5 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
mod ns_style_auto_array;
mod ns_t_array; mod ns_t_array;

View file

@ -0,0 +1,28 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::iter::{once, Chain, Once, IntoIterator};
use std::slice::IterMut;
use structs::nsStyleAutoArray;
impl<T> nsStyleAutoArray<T> {
pub fn iter_mut(&mut self) -> Chain<Once<&mut T>, IterMut<T>> {
once(&mut self.mFirstElement).chain(self.mOtherElements.iter_mut())
}
// Note that often structs containing autoarrays will have
// additional member fields that contain the length, which must be kept
// in sync
pub fn len(&self) -> usize {
1 + self.mOtherElements.len()
}
}
impl<'a, T> IntoIterator for &'a mut nsStyleAutoArray<T> {
type Item = &'a mut T;
type IntoIter = Chain<Once<&'a mut T>, IterMut<'a, T>>;
fn into_iter(self) -> Self::IntoIter {
self.iter_mut()
}
}

View file

@ -2,8 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bindings::Gecko_EnsureTArrayCapacity;
use std::mem; use std::mem;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};
use std::os::raw::c_void;
use std::slice; use std::slice;
use structs::{nsTArray, nsTArrayHeader}; use structs::{nsTArray, nsTArrayHeader};
@ -33,10 +35,33 @@ impl<T> nsTArray<T> {
debug_assert!(!self.mBuffer.is_null()); debug_assert!(!self.mBuffer.is_null());
unsafe { mem::transmute(self.mBuffer) } unsafe { mem::transmute(self.mBuffer) }
} }
// unsafe, since header may be in shared static or something
unsafe fn header_mut<'a>(&'a mut self) -> &'a mut nsTArrayHeader {
debug_assert!(!self.mBuffer.is_null());
mem::transmute(self.mBuffer)
}
#[inline] #[inline]
unsafe fn slice_begin(&self) -> *mut T { unsafe fn slice_begin(&self) -> *mut T {
debug_assert!(!self.mBuffer.is_null()); debug_assert!(!self.mBuffer.is_null());
(self.mBuffer as *const nsTArrayHeader).offset(1) as *mut _ (self.mBuffer as *const nsTArrayHeader).offset(1) as *mut _
} }
fn ensure_capacity(&mut self, cap: usize) {
unsafe {
Gecko_EnsureTArrayCapacity(self as *mut nsTArray<T> as *mut c_void, cap, mem::size_of::<T>())
}
}
// unsafe because the array may contain uninits
// This will not call constructors, either manually
// add bindings or run the typed ensurecapacity call
// on the gecko side
pub unsafe fn set_len(&mut self, len: u32) {
// this can leak
debug_assert!(len >= self.len() as u32);
self.ensure_capacity(len as usize);
let mut header = self.header_mut();
header.mLength = len;
}
} }

View file

@ -118,12 +118,16 @@ COMPILATION_TARGETS = {
"nsStyleMargin", "nsStylePadding", "nsStyleBorder", "nsStyleMargin", "nsStylePadding", "nsStyleBorder",
"nsStyleOutline", "nsStyleXUL", "nsStyleSVGReset", "nsStyleColumn", "nsStyleOutline", "nsStyleXUL", "nsStyleSVGReset", "nsStyleColumn",
"nsStyleEffects", "nsStyleImage", "nsStyleGradient", "nsStyleEffects", "nsStyleImage", "nsStyleGradient",
"nsStyleCoord", "nsStyleGradientStop", "nsStyleCoord", "nsStyleGradientStop", "nsStyleImageLayers",
"nsStyleImageLayers::Layer", "nsStyleImageLayers::LayerType",
"SheetParsingMode", "nsMainThreadPtrHandle", "SheetParsingMode", "nsMainThreadPtrHandle",
"nsMainThreadPtrHolder", "nscolor", "nsFont", "FontFamilyList", "nsMainThreadPtrHolder", "nscolor", "nsFont", "FontFamilyList",
"FontFamilyType", "nsIAtom", "FontFamilyType", "nsIAtom",
], ],
"void_types": [
"nsINode", "nsIDocument", "nsIPrincipal", "nsIURI",
]
} }
} }
@ -226,23 +230,33 @@ def build(objdir, target_name, kind_name=None,
for ty in current_target["opaque_types"]: for ty in current_target["opaque_types"]:
flags.append("-opaque-type") flags.append("-opaque-type")
flags.append(ty) flags.append(ty)
if "void_types" in current_target:
for ty in current_target["void_types"]:
flags.append("-raw-line")
flags.append("pub enum {} {{}}".format(ty))
if "structs_types" in current_target: if "structs_types" in current_target:
for ty in current_target["structs_types"]: for ty in current_target["structs_types"]:
ty_fragments = ty.split("::")
mangled_name = ty.replace("::", "_")
flags.append("-blacklist-type") flags.append("-blacklist-type")
flags.append(ty) flags.append(ty_fragments[-1])
flags.append("-raw-line") flags.append("-raw-line")
flags.append("use structs::{};".format(ty)) if len(ty_fragments) > 1:
flags.append("use structs::{} as {};".format(mangled_name, ty_fragments[-1]))
else:
flags.append("use structs::{};".format(mangled_name))
# TODO: this is hacky, figure out a better way to do it without # TODO: this is hacky, figure out a better way to do it without
# hardcoding everything... # hardcoding everything...
if ty.startswith("nsStyle"): if ty_fragments[-1].startswith("nsStyle"):
flags.extend([ flags.extend([
"-raw-line", "-raw-line",
"unsafe impl Send for {} {{}}".format(ty), "unsafe impl Send for {} {{}}".format(ty_fragments[-1]),
"-raw-line", "-raw-line",
"unsafe impl Sync for {} {{}}".format(ty), "unsafe impl Sync for {} {{}}".format(ty_fragments[-1]),
"-raw-line", "-raw-line",
"impl HeapSizeOf for {} {{ fn heap_size_of_children(&self) -> usize {{ 0 }} }}".format(ty) "impl HeapSizeOf for {} {{ fn heap_size_of_children(&self) -> usize {{ 0 }} }}"
.format(ty_fragments[-1])
]) ])
flags.append("-o") flags.append("-o")

View file

@ -19,10 +19,10 @@ use gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name};
use gecko_bindings::bindings::{Gecko_CopyMozBindingFrom, Gecko_CopyListStyleTypeFrom}; use gecko_bindings::bindings::{Gecko_CopyMozBindingFrom, Gecko_CopyListStyleTypeFrom};
use gecko_bindings::bindings::{Gecko_SetMozBinding, Gecko_SetListStyleType}; use gecko_bindings::bindings::{Gecko_SetMozBinding, Gecko_SetListStyleType};
use gecko_bindings::bindings::{Gecko_SetNullImageValue, Gecko_SetGradientImageValue}; use gecko_bindings::bindings::{Gecko_SetNullImageValue, Gecko_SetGradientImageValue};
use gecko_bindings::bindings::{Gecko_CreateGradient}; use gecko_bindings::bindings::{Gecko_EnsureImageLayersLength, Gecko_CreateGradient};
use gecko_bindings::bindings::{Gecko_CopyImageValueFrom, Gecko_CopyFontFamilyFrom}; use gecko_bindings::bindings::{Gecko_CopyImageValueFrom, Gecko_CopyFontFamilyFrom};
use gecko_bindings::bindings::{Gecko_FontFamilyList_AppendGeneric, Gecko_FontFamilyList_AppendNamed}; use gecko_bindings::bindings::{Gecko_FontFamilyList_AppendGeneric, Gecko_FontFamilyList_AppendNamed};
use gecko_bindings::bindings::{Gecko_FontFamilyList_Clear}; use gecko_bindings::bindings::{Gecko_FontFamilyList_Clear, Gecko_InitializeImageLayer};
use gecko_bindings::structs; use gecko_bindings::structs;
use glue::ArcHelpers; use glue::ArcHelpers;
use std::fmt::{self, Debug}; use std::fmt::{self, Debug};
@ -946,7 +946,8 @@ fn static_assert() {
} }
} }
fn set_background_image(&mut self, image: longhands::background_image::computed_value::T) { fn set_background_image(&mut self, images: longhands::background_image::computed_value::T) {
use gecko_bindings::structs::nsStyleImageLayers_LayerType as LayerType;
use gecko_bindings::structs::{NS_STYLE_GRADIENT_SHAPE_LINEAR, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER}; use gecko_bindings::structs::{NS_STYLE_GRADIENT_SHAPE_LINEAR, NS_STYLE_GRADIENT_SIZE_FARTHEST_CORNER};
use gecko_bindings::structs::nsStyleCoord; use gecko_bindings::structs::nsStyleCoord;
use style::values::computed::Image; use style::values::computed::Image;
@ -955,10 +956,21 @@ fn static_assert() {
unsafe { unsafe {
// Prevent leaking of the last element we did set // Prevent leaking of the last element we did set
Gecko_SetNullImageValue(&mut self.gecko.mImage.mLayers.mFirstElement.mImage); for image in &mut self.gecko.mImage.mLayers {
Gecko_SetNullImageValue(&mut image.mImage)
}
Gecko_EnsureImageLayersLength(&mut self.gecko.mImage, images.0.len());
for image in &mut self.gecko.mImage.mLayers {
Gecko_InitializeImageLayer(image, LayerType::Background);
}
} }
self.gecko.mImage.mImageCount = cmp::max(1, self.gecko.mImage.mImageCount); self.gecko.mImage.mImageCount = cmp::max(self.gecko.mImage.mLayers.len() as u32,
self.gecko.mImage.mImageCount);
// TODO: pre-grow the nsTArray to the right capacity
// otherwise the below code won't work
for (image, geckoimage) in images.0.into_iter().zip(self.gecko.mImage.mLayers.iter_mut()) {
if let Some(image) = image.0 { if let Some(image) = image.0 {
match image { match image {
Image::LinearGradient(ref gradient) => { Image::LinearGradient(ref gradient) => {
@ -1012,8 +1024,7 @@ fn static_assert() {
} }
unsafe { unsafe {
Gecko_SetGradientImageValue(&mut self.gecko.mImage.mLayers.mFirstElement.mImage, Gecko_SetGradientImageValue(&mut geckoimage.mImage, gecko_gradient);
gecko_gradient);
} }
}, },
Image::Url(_) => { Image::Url(_) => {
@ -1026,6 +1037,8 @@ fn static_assert() {
} }
} }
} }
}
} }
</%self:impl_trait> </%self:impl_trait>

View file

@ -24,6 +24,7 @@ use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink};
use gecko_bindings::bindings::{Gecko_LocalName, Gecko_Namespace, Gecko_NodeIsElement, Gecko_SetNodeData}; use gecko_bindings::bindings::{Gecko_LocalName, Gecko_Namespace, Gecko_NodeIsElement, Gecko_SetNodeData};
use gecko_bindings::bindings::{RawGeckoDocument, RawGeckoElement, RawGeckoNode}; use gecko_bindings::bindings::{RawGeckoDocument, RawGeckoElement, RawGeckoNode};
use gecko_bindings::structs::nsIAtom; use gecko_bindings::structs::nsIAtom;
use gecko_bindings::structs::{NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO, NODE_IS_DIRTY_FOR_SERVO};
use glue::GeckoDeclarationBlock; use glue::GeckoDeclarationBlock;
use libc::uintptr_t; use libc::uintptr_t;
use properties::GeckoComputedValues; use properties::GeckoComputedValues;
@ -184,7 +185,6 @@ impl<'ln> TNode for GeckoNode<'ln> {
} }
fn is_dirty(&self) -> bool { fn is_dirty(&self) -> bool {
use gecko_bindings::structs::NodeFlags::*;
// Return true unconditionally if we're not yet styled. This is a hack // Return true unconditionally if we're not yet styled. This is a hack
// and should go away soon. // and should go away soon.
if unsafe { Gecko_GetNodeData(self.node) }.is_null() { if unsafe { Gecko_GetNodeData(self.node) }.is_null() {
@ -196,7 +196,6 @@ impl<'ln> TNode for GeckoNode<'ln> {
} }
unsafe fn set_dirty(&self, value: bool) { unsafe fn set_dirty(&self, value: bool) {
use gecko_bindings::structs::NodeFlags::*;
if value { if value {
Gecko_SetNodeFlags(self.node, NODE_IS_DIRTY_FOR_SERVO as u32) Gecko_SetNodeFlags(self.node, NODE_IS_DIRTY_FOR_SERVO as u32)
} else { } else {
@ -205,7 +204,6 @@ impl<'ln> TNode for GeckoNode<'ln> {
} }
fn has_dirty_descendants(&self) -> bool { fn has_dirty_descendants(&self) -> bool {
use gecko_bindings::structs::NodeFlags::*;
// Return true unconditionally if we're not yet styled. This is a hack // Return true unconditionally if we're not yet styled. This is a hack
// and should go away soon. // and should go away soon.
if unsafe { Gecko_GetNodeData(self.node) }.is_null() { if unsafe { Gecko_GetNodeData(self.node) }.is_null() {
@ -216,7 +214,6 @@ impl<'ln> TNode for GeckoNode<'ln> {
} }
unsafe fn set_dirty_descendants(&self, value: bool) { unsafe fn set_dirty_descendants(&self, value: bool) {
use gecko_bindings::structs::NodeFlags::*;
if value { if value {
Gecko_SetNodeFlags(self.node, NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32) Gecko_SetNodeFlags(self.node, NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO as u32)
} else { } else {