Auto merge of #16235 - upsuper:bug1351957, r=heycam

Create URLExtraData for holding base uri, referrer, and principal

This is the Servo side change of [bug 1351957](https://bugzilla.mozilla.org/show_bug.cgi?id=1351957) which has been reviewed on Bugzilla.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16235)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-02 23:30:56 -05:00 committed by GitHub
commit 5b037a0aa0
12 changed files with 245 additions and 394 deletions

View file

@ -367,7 +367,6 @@ mod bindings {
"nsCursorImage", "nsCursorImage",
"nsFont", "nsFont",
"nsIAtom", "nsIAtom",
"nsIURI",
"nsMainThreadPtrHandle", "nsMainThreadPtrHandle",
"nsMainThreadPtrHolder", "nsMainThreadPtrHolder",
"nsMargin", "nsMargin",
@ -604,10 +603,8 @@ mod bindings {
"RawGeckoPresContext", "RawGeckoPresContext",
"RawGeckoPresContextOwned", "RawGeckoPresContextOwned",
"RawGeckoStyleAnimationList", "RawGeckoStyleAnimationList",
"GeckoParserExtraData", "RawGeckoURLExtraData",
"RefPtr", "RefPtr",
"ThreadSafeURIHolder",
"ThreadSafePrincipalHolder",
"CSSPseudoClassType", "CSSPseudoClassType",
"TraversalRootBehavior", "TraversalRootBehavior",
"FontFamilyList", "FontFamilyList",
@ -630,7 +627,6 @@ mod bindings {
"nsCursorImage", "nsCursorImage",
"nsFont", "nsFont",
"nsIAtom", "nsIAtom",
"nsIURI",
"nsMediaFeature", "nsMediaFeature",
"nsRestyleHint", "nsRestyleHint",
"nsStyleBackground", "nsStyleBackground",

View file

@ -5,8 +5,8 @@
//! Common handling for the specified value CSS url() values. //! Common handling for the specified value CSS url() values.
use cssparser::CssStringWriter; use cssparser::CssStringWriter;
use gecko_bindings::structs::ServoBundledURI; use gecko_bindings::structs::{ServoBundledURI, URLExtraData};
use gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI}; use gecko_bindings::sugar::refptr::RefPtr;
use parser::ParserContext; use parser::ParserContext;
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt::{self, Write}; use std::fmt::{self, Write};
@ -22,12 +22,8 @@ pub struct SpecifiedUrl {
/// really large. /// really large.
serialization: Arc<String>, serialization: Arc<String>,
/// The base URI. /// The URL extra data.
pub base: GeckoArcURI, pub extra_data: RefPtr<URLExtraData>,
/// The referrer.
pub referrer: GeckoArcURI,
/// The principal that originated this URI.
pub principal: GeckoArcPrincipal,
} }
impl SpecifiedUrl { impl SpecifiedUrl {
@ -39,7 +35,7 @@ impl SpecifiedUrl {
context: &ParserContext) context: &ParserContext)
-> Result<Self, ()> { -> Result<Self, ()> {
let extra = &context.extra_data; let extra = &context.extra_data;
if extra.base.is_none() || extra.referrer.is_none() || extra.principal.is_none() { if extra.data.is_none() {
// FIXME(heycam) should ensure we always have a principal, etc., // FIXME(heycam) should ensure we always have a principal, etc.,
// when parsing style attributes and re-parsing due to CSS // when parsing style attributes and re-parsing due to CSS
// Variables. // Variables.
@ -49,9 +45,7 @@ impl SpecifiedUrl {
Ok(SpecifiedUrl { Ok(SpecifiedUrl {
serialization: Arc::new(url.into_owned()), serialization: Arc::new(url.into_owned()),
base: extra.base.as_ref().unwrap().clone(), extra_data: extra.data.as_ref().unwrap().clone(),
referrer: extra.referrer.as_ref().unwrap().clone(),
principal: extra.principal.as_ref().unwrap().clone(),
}) })
} }
@ -88,9 +82,7 @@ impl SpecifiedUrl {
ServoBundledURI { ServoBundledURI {
mURLString: ptr, mURLString: ptr,
mURLStringLength: len as u32, mURLStringLength: len as u32,
mBaseURI: self.base.get(), mExtraData: self.extra_data.get(),
mReferrer: self.referrer.get(),
mPrincipal: self.principal.get(),
} }
} }
} }

View file

@ -17,10 +17,8 @@ use gecko_bindings::structs::RawServoDeclarationBlock;
use gecko_bindings::structs::RawGeckoPresContext; use gecko_bindings::structs::RawGeckoPresContext;
use gecko_bindings::structs::RawGeckoPresContextOwned; use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::structs::RawGeckoStyleAnimationList; use gecko_bindings::structs::RawGeckoStyleAnimationList;
use gecko_bindings::structs::GeckoParserExtraData; use gecko_bindings::structs::RawGeckoURLExtraData;
use gecko_bindings::structs::RefPtr; use gecko_bindings::structs::RefPtr;
use gecko_bindings::structs::ThreadSafeURIHolder;
use gecko_bindings::structs::ThreadSafePrincipalHolder;
use gecko_bindings::structs::CSSPseudoClassType; use gecko_bindings::structs::CSSPseudoClassType;
use gecko_bindings::structs::TraversalRootBehavior; use gecko_bindings::structs::TraversalRootBehavior;
use gecko_bindings::structs::FontFamilyList; use gecko_bindings::structs::FontFamilyList;
@ -43,7 +41,6 @@ use gecko_bindings::structs::nsChangeHint;
use gecko_bindings::structs::nsCursorImage; use gecko_bindings::structs::nsCursorImage;
use gecko_bindings::structs::nsFont; use gecko_bindings::structs::nsFont;
use gecko_bindings::structs::nsIAtom; use gecko_bindings::structs::nsIAtom;
use gecko_bindings::structs::nsIURI;
use gecko_bindings::structs::nsMediaFeature; use gecko_bindings::structs::nsMediaFeature;
use gecko_bindings::structs::nsRestyleHint; use gecko_bindings::structs::nsRestyleHint;
use gecko_bindings::structs::nsStyleBackground; use gecko_bindings::structs::nsStyleBackground;
@ -370,20 +367,6 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned); pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned);
} }
extern "C" {
pub fn Gecko_AddRefPrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder);
}
extern "C" {
pub fn Gecko_ReleasePrincipalArbitraryThread(aPtr:
*mut ThreadSafePrincipalHolder);
}
extern "C" {
pub fn Gecko_AddRefURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder);
}
extern "C" {
pub fn Gecko_ReleaseURIArbitraryThread(aPtr: *mut ThreadSafeURIHolder);
}
extern "C" { extern "C" {
pub fn Gecko_ChildrenCount(node: RawGeckoNodeBorrowed) -> u32; pub fn Gecko_ChildrenCount(node: RawGeckoNodeBorrowed) -> u32;
} }
@ -446,9 +429,9 @@ extern "C" {
pub fn Gecko_LoadStyleSheet(loader: *mut Loader, pub fn Gecko_LoadStyleSheet(loader: *mut Loader,
parent: *mut ServoStyleSheet, parent: *mut ServoStyleSheet,
import_rule: RawServoImportRuleBorrowed, import_rule: RawServoImportRuleBorrowed,
base_uri: *mut nsIURI, url_bytes: *const u8, base_url_data: *mut RawGeckoURLExtraData,
url_length: u32, media_bytes: *const u8, url_bytes: *const u8, url_length: u32,
media_length: u32); media_bytes: *const u8, media_length: u32);
} }
extern "C" { extern "C" {
pub fn Gecko_MaybeCreateStyleChildrenIterator(node: RawGeckoNodeBorrowed) pub fn Gecko_MaybeCreateStyleChildrenIterator(node: RawGeckoNodeBorrowed)
@ -891,6 +874,14 @@ extern "C" {
extern "C" { extern "C" {
pub fn Gecko_ReleaseCSSURLValueArbitraryThread(aPtr: *mut URLValue); pub fn Gecko_ReleaseCSSURLValueArbitraryThread(aPtr: *mut URLValue);
} }
extern "C" {
pub fn Gecko_AddRefURLExtraDataArbitraryThread(aPtr:
*mut RawGeckoURLExtraData);
}
extern "C" {
pub fn Gecko_ReleaseURLExtraDataArbitraryThread(aPtr:
*mut RawGeckoURLExtraData);
}
extern "C" { extern "C" {
pub fn Gecko_FillAllBackgroundLists(layers: *mut nsStyleImageLayers, pub fn Gecko_FillAllBackgroundLists(layers: *mut nsStyleImageLayers,
max_len: u32); max_len: u32);
@ -1387,10 +1378,8 @@ extern "C" {
data: *const nsACString, data: *const nsACString,
parsing_mode: SheetParsingMode, parsing_mode: SheetParsingMode,
base_url: *const nsACString, base_url: *const nsACString,
base: *mut ThreadSafeURIHolder, extra_data:
referrer: *mut ThreadSafeURIHolder, *mut RawGeckoURLExtraData)
principal:
*mut ThreadSafePrincipalHolder)
-> RawServoStyleSheetStrong; -> RawServoStyleSheetStrong;
} }
extern "C" { extern "C" {
@ -1404,10 +1393,8 @@ extern "C" {
gecko_stylesheet: gecko_stylesheet:
*mut ServoStyleSheet, *mut ServoStyleSheet,
data: *const nsACString, data: *const nsACString,
base: *mut ThreadSafeURIHolder, extra_data:
referrer: *mut ThreadSafeURIHolder, *mut RawGeckoURLExtraData);
principal:
*mut ThreadSafePrincipalHolder);
} }
extern "C" { extern "C" {
pub fn Servo_StyleSheet_HasRules(sheet: RawServoStyleSheetBorrowed) pub fn Servo_StyleSheet_HasRules(sheet: RawServoStyleSheetBorrowed)
@ -1563,13 +1550,13 @@ extern "C" {
pub fn Servo_ParseProperty(property: *const nsACString, pub fn Servo_ParseProperty(property: *const nsACString,
value: *const nsACString, value: *const nsACString,
base: *const nsACString, base: *const nsACString,
data: *const GeckoParserExtraData) data: *mut RawGeckoURLExtraData)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
extern "C" { extern "C" {
pub fn Servo_ParseEasing(easing: *const nsAString, pub fn Servo_ParseEasing(easing: *const nsAString,
base: *const nsACString, base: *const nsACString,
data: *const GeckoParserExtraData, data: *mut RawGeckoURLExtraData,
output: nsTimingFunctionBorrowedMut) -> bool; output: nsTimingFunctionBorrowedMut) -> bool;
} }
extern "C" { extern "C" {
@ -1624,7 +1611,7 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_ParseStyleAttribute(data: *const nsACString, pub fn Servo_ParseStyleAttribute(data: *const nsACString,
base: *const nsACString, base: *const nsACString,
extraData: *const GeckoParserExtraData) extra_data: *mut RawGeckoURLExtraData)
-> RawServoDeclarationBlockStrong; -> RawServoDeclarationBlockStrong;
} }
extern "C" { extern "C" {
@ -1692,8 +1679,7 @@ extern "C" {
value: *const nsACString, value: *const nsACString,
is_important: bool, is_important: bool,
base: *const nsACString, base: *const nsACString,
data: data: *mut RawGeckoURLExtraData)
*const GeckoParserExtraData)
-> bool; -> bool;
} }
extern "C" { extern "C" {
@ -1704,7 +1690,7 @@ extern "C" {
is_important: bool, is_important: bool,
base: *const nsACString, base: *const nsACString,
data: data:
*const GeckoParserExtraData) *mut RawGeckoURLExtraData)
-> bool; -> bool;
} }
extern "C" { extern "C" {

View file

@ -5224,6 +5224,49 @@ pub mod root {
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct ImageLoader([u8; 0]); pub struct ImageLoader([u8; 0]);
#[repr(C)] #[repr(C)]
#[derive(Debug)]
pub struct URLExtraData {
pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
pub mBaseURI: root::RefPtr<root::nsIURI>,
pub mReferrer: root::RefPtr<root::nsIURI>,
pub mPrincipal: root::RefPtr<root::nsIPrincipal>,
}
pub type URLExtraData_HasThreadSafeRefCnt =
root::mozilla::TrueType;
#[test]
fn bindgen_test_layout_URLExtraData() {
assert_eq!(::std::mem::size_of::<URLExtraData>() , 32usize ,
concat ! (
"Size of: " , stringify ! ( URLExtraData ) ));
assert_eq! (::std::mem::align_of::<URLExtraData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( URLExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mRefCnt as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mRefCnt )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mBaseURI
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mReferrer
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mReferrer )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mPrincipal
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mPrincipal )
));
}
#[repr(C)]
pub struct URLValueData__bindgen_vtable { pub struct URLValueData__bindgen_vtable {
} }
#[repr(C)] #[repr(C)]
@ -5232,10 +5275,8 @@ pub mod root {
pub vtable_: *const URLValueData__bindgen_vtable, pub vtable_: *const URLValueData__bindgen_vtable,
pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
pub mURI: root::nsMainThreadPtrHandle<root::nsIURI>, pub mURI: root::nsMainThreadPtrHandle<root::nsIURI>,
pub mBaseURI: root::nsMainThreadPtrHandle<root::nsIURI>,
pub mString: root::RefPtr<root::nsStringBuffer>, pub mString: root::RefPtr<root::nsStringBuffer>,
pub mReferrer: root::nsMainThreadPtrHandle<root::nsIURI>, pub mExtraData: root::RefPtr<root::mozilla::css::URLExtraData>,
pub mOriginPrincipal: root::nsMainThreadPtrHandle<root::nsIPrincipal>,
pub mURIResolved: bool, pub mURIResolved: bool,
pub mIsLocalRef: bool, pub mIsLocalRef: bool,
} }
@ -5243,7 +5284,7 @@ pub mod root {
root::mozilla::TrueType; root::mozilla::TrueType;
#[test] #[test]
fn bindgen_test_layout_URLValueData() { fn bindgen_test_layout_URLValueData() {
assert_eq!(::std::mem::size_of::<URLValueData>() , 64usize , assert_eq!(::std::mem::size_of::<URLValueData>() , 48usize ,
concat ! ( concat ! (
"Size of: " , stringify ! ( URLValueData ) )); "Size of: " , stringify ! ( URLValueData ) ));
assert_eq! (::std::mem::align_of::<URLValueData>() , 8usize , assert_eq! (::std::mem::align_of::<URLValueData>() , 8usize ,
@ -5260,41 +5301,28 @@ pub mod root {
const _ as usize } , 16usize , concat ! ( const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mURI ) )); URLValueData ) , "::" , stringify ! ( mURI ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mBaseURI
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mString as & ( * ( 0 as * const URLValueData ) ) . mString as
* const _ as usize } , 32usize , concat ! ( * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mString ) URLValueData ) , "::" , stringify ! ( mString )
)); ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mReferrer & ( * ( 0 as * const URLValueData ) ) . mExtraData
as * const _ as usize } , 40usize , concat ! ( as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mReferrer ) URLValueData ) , "::" , stringify ! ( mExtraData )
)); ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . & ( * ( 0 as * const URLValueData ) ) .
mOriginPrincipal as * const _ as usize } , 48usize mURIResolved as * const _ as usize } , 40usize ,
, concat ! (
"Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! (
mOriginPrincipal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) .
mURIResolved as * const _ as usize } , 56usize ,
concat ! ( concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mURIResolved URLValueData ) , "::" , stringify ! ( mURIResolved
) )); ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . & ( * ( 0 as * const URLValueData ) ) .
mIsLocalRef as * const _ as usize } , 57usize , mIsLocalRef as * const _ as usize } , 41usize ,
concat ! ( concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mIsLocalRef URLValueData ) , "::" , stringify ! ( mIsLocalRef
@ -5307,7 +5335,7 @@ pub mod root {
} }
#[test] #[test]
fn bindgen_test_layout_URLValue() { fn bindgen_test_layout_URLValue() {
assert_eq!(::std::mem::size_of::<URLValue>() , 64usize , assert_eq!(::std::mem::size_of::<URLValue>() , 48usize ,
concat ! ( "Size of: " , stringify ! ( URLValue ) concat ! ( "Size of: " , stringify ! ( URLValue )
)); ));
assert_eq! (::std::mem::align_of::<URLValue>() , 8usize , assert_eq! (::std::mem::align_of::<URLValue>() , 8usize ,
@ -5323,7 +5351,7 @@ pub mod root {
} }
#[test] #[test]
fn bindgen_test_layout_ImageValue() { fn bindgen_test_layout_ImageValue() {
assert_eq!(::std::mem::size_of::<ImageValue>() , 120usize , assert_eq!(::std::mem::size_of::<ImageValue>() , 104usize ,
concat ! ( "Size of: " , stringify ! ( ImageValue ) concat ! ( "Size of: " , stringify ! ( ImageValue )
)); ));
assert_eq! (::std::mem::align_of::<ImageValue>() , 8usize , assert_eq! (::std::mem::align_of::<ImageValue>() , 8usize ,
@ -5331,12 +5359,12 @@ pub mod root {
"Alignment of " , stringify ! ( ImageValue ) )); "Alignment of " , stringify ! ( ImageValue ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const ImageValue ) ) . mRequests as & ( * ( 0 as * const ImageValue ) ) . mRequests as
* const _ as usize } , 64usize , concat ! ( * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ImageValue "Alignment of field: " , stringify ! ( ImageValue
) , "::" , stringify ! ( mRequests ) )); ) , "::" , stringify ! ( mRequests ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const ImageValue ) ) . mInitialized & ( * ( 0 as * const ImageValue ) ) . mInitialized
as * const _ as usize } , 112usize , concat ! ( as * const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( ImageValue "Alignment of field: " , stringify ! ( ImageValue
) , "::" , stringify ! ( mInitialized ) )); ) , "::" , stringify ! ( mInitialized ) ));
} }
@ -26466,6 +26494,7 @@ pub mod root {
pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoElement = root::mozilla::dom::Element;
pub type RawGeckoDocument = root::nsIDocument; pub type RawGeckoDocument = root::nsIDocument;
pub type RawGeckoPresContext = root::nsPresContext; pub type RawGeckoPresContext = root::nsPresContext;
pub type RawGeckoURLExtraData = root::mozilla::css::URLExtraData;
pub type RawGeckoKeyframeList = root::nsTArray<root::mozilla::Keyframe>; pub type RawGeckoKeyframeList = root::nsTArray<root::mozilla::Keyframe>;
pub type RawGeckoComputedKeyframeValuesList = pub type RawGeckoComputedKeyframeValuesList =
root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>; root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>;
@ -26709,21 +26738,16 @@ pub mod root {
impl Clone for nsMediaFeature { impl Clone for nsMediaFeature {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
pub type ThreadSafePrincipalHolder =
root::nsMainThreadPtrHolder<root::nsIPrincipal>;
pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder<root::nsIURI>;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct ServoBundledURI { pub struct ServoBundledURI {
pub mURLString: *const u8, pub mURLString: *const u8,
pub mURLStringLength: u32, pub mURLStringLength: u32,
pub mBaseURI: *mut root::ThreadSafeURIHolder, pub mExtraData: *mut root::mozilla::css::URLExtraData,
pub mReferrer: *mut root::ThreadSafeURIHolder,
pub mPrincipal: *mut root::ThreadSafePrincipalHolder,
} }
#[test] #[test]
fn bindgen_test_layout_ServoBundledURI() { fn bindgen_test_layout_ServoBundledURI() {
assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 40usize , concat assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 24usize , concat
! ( "Size of: " , stringify ! ( ServoBundledURI ) )); ! ( "Size of: " , stringify ! ( ServoBundledURI ) ));
assert_eq! (::std::mem::align_of::<ServoBundledURI>() , 8usize , assert_eq! (::std::mem::align_of::<ServoBundledURI>() , 8usize ,
concat ! ( concat ! (
@ -26740,59 +26764,15 @@ pub mod root {
"Alignment of field: " , stringify ! ( ServoBundledURI ) , "Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mURLStringLength ) )); "::" , stringify ! ( mURLStringLength ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mBaseURI as * & ( * ( 0 as * const ServoBundledURI ) ) . mExtraData as *
const _ as usize } , 16usize , concat ! ( const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) , "Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mBaseURI ) )); "::" , stringify ! ( mExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mReferrer as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mReferrer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mPrincipal as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mPrincipal ) ));
} }
impl Clone for ServoBundledURI { impl Clone for ServoBundledURI {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[repr(C)] #[repr(C)]
#[derive(Debug)]
pub struct GeckoParserExtraData {
pub mBaseURI: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIURI>>,
pub mReferrer: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIURI>>,
pub mPrincipal: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIPrincipal>>,
}
#[test]
fn bindgen_test_layout_GeckoParserExtraData() {
assert_eq!(::std::mem::size_of::<GeckoParserExtraData>() , 24usize ,
concat ! (
"Size of: " , stringify ! ( GeckoParserExtraData ) ));
assert_eq! (::std::mem::align_of::<GeckoParserExtraData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( GeckoParserExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mBaseURI
as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mReferrer
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mReferrer )
));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mPrincipal
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mPrincipal )
));
}
#[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct nsROCSSPrimitiveValue([u8; 0]); pub struct nsROCSSPrimitiveValue([u8; 0]);
#[repr(C)] #[repr(C)]
@ -27969,6 +27949,19 @@ pub mod root {
} }
#[test] #[test]
fn __bindgen_test_layout_template_75() { fn __bindgen_test_layout_template_75() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::css::URLExtraData>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::mozilla::css::URLExtraData> )
));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::css::URLExtraData>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::mozilla::css::URLExtraData> )
));
}
#[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>()
, 24usize , concat ! ( , 24usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27979,44 +27972,7 @@ pub mod root {
root::nsMainThreadPtrHolder<root::nsIURI> ) )); root::nsMainThreadPtrHolder<root::nsIURI> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>
) ));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>
) ));
}
#[test]
fn __bindgen_test_layout_template_77() { fn __bindgen_test_layout_template_77() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIPrincipal>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
root::nsMainThreadPtrHolder<root::nsIPrincipal> ) ));
assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIPrincipal>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsMainThreadPtrHolder<root::nsIPrincipal> ) ));
}
#[test]
fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>
) ));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>
) ));
}
#[test]
fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28027,7 +27983,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsCSSValueList> ) )); root::mozilla::DefaultDelete<root::nsCSSValueList> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_80() { fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList,
root::mozilla::DefaultDelete<root::nsCSSValueList>>>() root::mozilla::DefaultDelete<root::nsCSSValueList>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -28044,7 +28000,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_81() { fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28057,7 +28013,7 @@ pub mod root {
)); ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_82() { fn __bindgen_test_layout_template_80() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList,
root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>() root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -28074,7 +28030,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_83() { fn __bindgen_test_layout_template_81() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>() assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28087,7 +28043,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_84() { fn __bindgen_test_layout_template_82() {
assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>() assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>()
, 16usize , concat ! ( , 16usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28098,7 +28054,7 @@ pub mod root {
root::nsPtrHashKey<root::nsIFrame> ) )); root::nsPtrHashKey<root::nsIFrame> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_85() { fn __bindgen_test_layout_template_83() {
assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat ! assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28109,7 +28065,7 @@ pub mod root {
[u64; 6usize] ) )); [u64; 6usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_86() { fn __bindgen_test_layout_template_84() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>()
, 16usize , concat ! ( , 16usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28122,7 +28078,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_87() { fn __bindgen_test_layout_template_85() {
assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28133,7 +28089,7 @@ pub mod root {
[u64; 2usize] ) )); [u64; 2usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_88() { fn __bindgen_test_layout_template_86() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 ) "Size of template specialization: " , stringify ! ( u64 )
)); ));
@ -28142,7 +28098,7 @@ pub mod root {
u64 ) )); u64 ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_89() { fn __bindgen_test_layout_template_87() {
assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28153,7 +28109,7 @@ pub mod root {
[u32; 3usize] ) )); [u32; 3usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_90() { fn __bindgen_test_layout_template_88() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>() assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28164,7 +28120,7 @@ pub mod root {
root::already_AddRefed<root::nsStyleImageRequest> ) )); root::already_AddRefed<root::nsStyleImageRequest> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_91() { fn __bindgen_test_layout_template_89() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28175,7 +28131,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsStyleSides> ) )); root::mozilla::DefaultDelete<root::nsStyleSides> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_92() { fn __bindgen_test_layout_template_90() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides,
root::mozilla::DefaultDelete<root::nsStyleSides>>>() root::mozilla::DefaultDelete<root::nsStyleSides>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -28192,7 +28148,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_93() { fn __bindgen_test_layout_template_91() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28205,7 +28161,7 @@ pub mod root {
)); ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_94() { fn __bindgen_test_layout_template_92() {
assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>()
, 32usize , concat ! ( , 32usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28216,7 +28172,7 @@ pub mod root {
root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_95() { fn __bindgen_test_layout_template_93() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
::nsstring::nsStringRepr>>>() ::nsstring::nsStringRepr>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -28231,7 +28187,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_96() { fn __bindgen_test_layout_template_94() {
assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat
! ( ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28242,7 +28198,7 @@ pub mod root {
[u64; 18usize] ) )); [u64; 18usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_97() { fn __bindgen_test_layout_template_95() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28255,7 +28211,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_98() { fn __bindgen_test_layout_template_96() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28266,7 +28222,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::DOMRect> ) )); root::RefPtr<root::mozilla::dom::DOMRect> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_99() { fn __bindgen_test_layout_template_97() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 ) "Size of template specialization: " , stringify ! ( u64 )
)); ));
@ -28275,7 +28231,7 @@ pub mod root {
u64 ) )); u64 ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_100() { fn __bindgen_test_layout_template_98() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -28286,7 +28242,7 @@ pub mod root {
root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); root::nsTArray<*mut root::mozilla::css::DocumentRule> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_101() { fn __bindgen_test_layout_template_99() {
assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>() assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (

View file

@ -5163,6 +5163,49 @@ pub mod root {
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct ImageLoader([u8; 0]); pub struct ImageLoader([u8; 0]);
#[repr(C)] #[repr(C)]
#[derive(Debug)]
pub struct URLExtraData {
pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
pub mBaseURI: root::RefPtr<root::nsIURI>,
pub mReferrer: root::RefPtr<root::nsIURI>,
pub mPrincipal: root::RefPtr<root::nsIPrincipal>,
}
pub type URLExtraData_HasThreadSafeRefCnt =
root::mozilla::TrueType;
#[test]
fn bindgen_test_layout_URLExtraData() {
assert_eq!(::std::mem::size_of::<URLExtraData>() , 32usize ,
concat ! (
"Size of: " , stringify ! ( URLExtraData ) ));
assert_eq! (::std::mem::align_of::<URLExtraData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( URLExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mRefCnt as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mRefCnt )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mBaseURI
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mReferrer
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mReferrer )
));
assert_eq! (unsafe {
& ( * ( 0 as * const URLExtraData ) ) . mPrincipal
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
URLExtraData ) , "::" , stringify ! ( mPrincipal )
));
}
#[repr(C)]
pub struct URLValueData__bindgen_vtable { pub struct URLValueData__bindgen_vtable {
} }
#[repr(C)] #[repr(C)]
@ -5171,10 +5214,8 @@ pub mod root {
pub vtable_: *const URLValueData__bindgen_vtable, pub vtable_: *const URLValueData__bindgen_vtable,
pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt, pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,
pub mURI: root::nsMainThreadPtrHandle<root::nsIURI>, pub mURI: root::nsMainThreadPtrHandle<root::nsIURI>,
pub mBaseURI: root::nsMainThreadPtrHandle<root::nsIURI>,
pub mString: root::RefPtr<root::nsStringBuffer>, pub mString: root::RefPtr<root::nsStringBuffer>,
pub mReferrer: root::nsMainThreadPtrHandle<root::nsIURI>, pub mExtraData: root::RefPtr<root::mozilla::css::URLExtraData>,
pub mOriginPrincipal: root::nsMainThreadPtrHandle<root::nsIPrincipal>,
pub mURIResolved: bool, pub mURIResolved: bool,
pub mIsLocalRef: bool, pub mIsLocalRef: bool,
} }
@ -5182,7 +5223,7 @@ pub mod root {
root::mozilla::TrueType; root::mozilla::TrueType;
#[test] #[test]
fn bindgen_test_layout_URLValueData() { fn bindgen_test_layout_URLValueData() {
assert_eq!(::std::mem::size_of::<URLValueData>() , 64usize , assert_eq!(::std::mem::size_of::<URLValueData>() , 48usize ,
concat ! ( concat ! (
"Size of: " , stringify ! ( URLValueData ) )); "Size of: " , stringify ! ( URLValueData ) ));
assert_eq! (::std::mem::align_of::<URLValueData>() , 8usize , assert_eq! (::std::mem::align_of::<URLValueData>() , 8usize ,
@ -5199,41 +5240,28 @@ pub mod root {
const _ as usize } , 16usize , concat ! ( const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mURI ) )); URLValueData ) , "::" , stringify ! ( mURI ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mBaseURI
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mString as & ( * ( 0 as * const URLValueData ) ) . mString as
* const _ as usize } , 32usize , concat ! ( * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mString ) URLValueData ) , "::" , stringify ! ( mString )
)); ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . mReferrer & ( * ( 0 as * const URLValueData ) ) . mExtraData
as * const _ as usize } , 40usize , concat ! ( as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mReferrer ) URLValueData ) , "::" , stringify ! ( mExtraData )
)); ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . & ( * ( 0 as * const URLValueData ) ) .
mOriginPrincipal as * const _ as usize } , 48usize mURIResolved as * const _ as usize } , 40usize ,
, concat ! (
"Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! (
mOriginPrincipal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) .
mURIResolved as * const _ as usize } , 56usize ,
concat ! ( concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mURIResolved URLValueData ) , "::" , stringify ! ( mURIResolved
) )); ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const URLValueData ) ) . & ( * ( 0 as * const URLValueData ) ) .
mIsLocalRef as * const _ as usize } , 57usize , mIsLocalRef as * const _ as usize } , 41usize ,
concat ! ( concat ! (
"Alignment of field: " , stringify ! ( "Alignment of field: " , stringify ! (
URLValueData ) , "::" , stringify ! ( mIsLocalRef URLValueData ) , "::" , stringify ! ( mIsLocalRef
@ -5246,7 +5274,7 @@ pub mod root {
} }
#[test] #[test]
fn bindgen_test_layout_URLValue() { fn bindgen_test_layout_URLValue() {
assert_eq!(::std::mem::size_of::<URLValue>() , 64usize , assert_eq!(::std::mem::size_of::<URLValue>() , 48usize ,
concat ! ( "Size of: " , stringify ! ( URLValue ) concat ! ( "Size of: " , stringify ! ( URLValue )
)); ));
assert_eq! (::std::mem::align_of::<URLValue>() , 8usize , assert_eq! (::std::mem::align_of::<URLValue>() , 8usize ,
@ -5261,7 +5289,7 @@ pub mod root {
} }
#[test] #[test]
fn bindgen_test_layout_ImageValue() { fn bindgen_test_layout_ImageValue() {
assert_eq!(::std::mem::size_of::<ImageValue>() , 104usize , assert_eq!(::std::mem::size_of::<ImageValue>() , 88usize ,
concat ! ( "Size of: " , stringify ! ( ImageValue ) concat ! ( "Size of: " , stringify ! ( ImageValue )
)); ));
assert_eq! (::std::mem::align_of::<ImageValue>() , 8usize , assert_eq! (::std::mem::align_of::<ImageValue>() , 8usize ,
@ -5269,7 +5297,7 @@ pub mod root {
"Alignment of " , stringify ! ( ImageValue ) )); "Alignment of " , stringify ! ( ImageValue ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const ImageValue ) ) . mRequests as & ( * ( 0 as * const ImageValue ) ) . mRequests as
* const _ as usize } , 64usize , concat ! ( * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ImageValue "Alignment of field: " , stringify ! ( ImageValue
) , "::" , stringify ! ( mRequests ) )); ) , "::" , stringify ! ( mRequests ) ));
} }
@ -25827,6 +25855,7 @@ pub mod root {
pub type RawGeckoElement = root::mozilla::dom::Element; pub type RawGeckoElement = root::mozilla::dom::Element;
pub type RawGeckoDocument = root::nsIDocument; pub type RawGeckoDocument = root::nsIDocument;
pub type RawGeckoPresContext = root::nsPresContext; pub type RawGeckoPresContext = root::nsPresContext;
pub type RawGeckoURLExtraData = root::mozilla::css::URLExtraData;
pub type RawGeckoKeyframeList = root::nsTArray<root::mozilla::Keyframe>; pub type RawGeckoKeyframeList = root::nsTArray<root::mozilla::Keyframe>;
pub type RawGeckoComputedKeyframeValuesList = pub type RawGeckoComputedKeyframeValuesList =
root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>; root::nsTArray<root::nsTArray<root::mozilla::PropertyStyleAnimationValuePair>>;
@ -26070,21 +26099,16 @@ pub mod root {
impl Clone for nsMediaFeature { impl Clone for nsMediaFeature {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
pub type ThreadSafePrincipalHolder =
root::nsMainThreadPtrHolder<root::nsIPrincipal>;
pub type ThreadSafeURIHolder = root::nsMainThreadPtrHolder<root::nsIURI>;
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]
pub struct ServoBundledURI { pub struct ServoBundledURI {
pub mURLString: *const u8, pub mURLString: *const u8,
pub mURLStringLength: u32, pub mURLStringLength: u32,
pub mBaseURI: *mut root::ThreadSafeURIHolder, pub mExtraData: *mut root::mozilla::css::URLExtraData,
pub mReferrer: *mut root::ThreadSafeURIHolder,
pub mPrincipal: *mut root::ThreadSafePrincipalHolder,
} }
#[test] #[test]
fn bindgen_test_layout_ServoBundledURI() { fn bindgen_test_layout_ServoBundledURI() {
assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 40usize , concat assert_eq!(::std::mem::size_of::<ServoBundledURI>() , 24usize , concat
! ( "Size of: " , stringify ! ( ServoBundledURI ) )); ! ( "Size of: " , stringify ! ( ServoBundledURI ) ));
assert_eq! (::std::mem::align_of::<ServoBundledURI>() , 8usize , assert_eq! (::std::mem::align_of::<ServoBundledURI>() , 8usize ,
concat ! ( concat ! (
@ -26101,59 +26125,15 @@ pub mod root {
"Alignment of field: " , stringify ! ( ServoBundledURI ) , "Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mURLStringLength ) )); "::" , stringify ! ( mURLStringLength ) ));
assert_eq! (unsafe { assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mBaseURI as * & ( * ( 0 as * const ServoBundledURI ) ) . mExtraData as *
const _ as usize } , 16usize , concat ! ( const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) , "Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mBaseURI ) )); "::" , stringify ! ( mExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mReferrer as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mReferrer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoBundledURI ) ) . mPrincipal as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ServoBundledURI ) ,
"::" , stringify ! ( mPrincipal ) ));
} }
impl Clone for ServoBundledURI { impl Clone for ServoBundledURI {
fn clone(&self) -> Self { *self } fn clone(&self) -> Self { *self }
} }
#[repr(C)] #[repr(C)]
#[derive(Debug)]
pub struct GeckoParserExtraData {
pub mBaseURI: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIURI>>,
pub mReferrer: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIURI>>,
pub mPrincipal: root::RefPtr<root::nsMainThreadPtrHolder<root::nsIPrincipal>>,
}
#[test]
fn bindgen_test_layout_GeckoParserExtraData() {
assert_eq!(::std::mem::size_of::<GeckoParserExtraData>() , 24usize ,
concat ! (
"Size of: " , stringify ! ( GeckoParserExtraData ) ));
assert_eq! (::std::mem::align_of::<GeckoParserExtraData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( GeckoParserExtraData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mBaseURI
as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mBaseURI )
));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mReferrer
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mReferrer )
));
assert_eq! (unsafe {
& ( * ( 0 as * const GeckoParserExtraData ) ) . mPrincipal
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
GeckoParserExtraData ) , "::" , stringify ! ( mPrincipal )
));
}
#[repr(C)]
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub struct nsROCSSPrimitiveValue([u8; 0]); pub struct nsROCSSPrimitiveValue([u8; 0]);
#[repr(C)] #[repr(C)]
@ -27330,6 +27310,19 @@ pub mod root {
} }
#[test] #[test]
fn __bindgen_test_layout_template_75() { fn __bindgen_test_layout_template_75() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::css::URLExtraData>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::mozilla::css::URLExtraData> )
));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::mozilla::css::URLExtraData>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::mozilla::css::URLExtraData> )
));
}
#[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>() assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>()
, 24usize , concat ! ( , 24usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27340,44 +27333,7 @@ pub mod root {
root::nsMainThreadPtrHolder<root::nsIURI> ) )); root::nsMainThreadPtrHolder<root::nsIURI> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>
) ));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIURI>>
) ));
}
#[test]
fn __bindgen_test_layout_template_77() { fn __bindgen_test_layout_template_77() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIPrincipal>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
root::nsMainThreadPtrHolder<root::nsIPrincipal> ) ));
assert_eq!(::std::mem::align_of::<root::nsMainThreadPtrHolder<root::nsIPrincipal>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsMainThreadPtrHolder<root::nsIPrincipal> ) ));
}
#[test]
fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>
) ));
assert_eq!(::std::mem::align_of::<root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::already_AddRefed<root::nsMainThreadPtrHolder<root::nsIPrincipal>>
) ));
}
#[test]
fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27388,7 +27344,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsCSSValueList> ) )); root::mozilla::DefaultDelete<root::nsCSSValueList> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_80() { fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList,
root::mozilla::DefaultDelete<root::nsCSSValueList>>>() root::mozilla::DefaultDelete<root::nsCSSValueList>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -27405,7 +27361,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_81() { fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27418,7 +27374,7 @@ pub mod root {
)); ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_82() { fn __bindgen_test_layout_template_80() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList,
root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>() root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -27435,7 +27391,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_83() { fn __bindgen_test_layout_template_81() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>() assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27448,7 +27404,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_84() { fn __bindgen_test_layout_template_82() {
assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>() assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>()
, 16usize , concat ! ( , 16usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27459,7 +27415,7 @@ pub mod root {
root::nsPtrHashKey<root::nsIFrame> ) )); root::nsPtrHashKey<root::nsIFrame> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_85() { fn __bindgen_test_layout_template_83() {
assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat ! assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27470,7 +27426,7 @@ pub mod root {
[u64; 5usize] ) )); [u64; 5usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_86() { fn __bindgen_test_layout_template_84() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>() assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27483,7 +27439,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_87() { fn __bindgen_test_layout_template_85() {
assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat ! assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27494,7 +27450,7 @@ pub mod root {
[u64; 2usize] ) )); [u64; 2usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_88() { fn __bindgen_test_layout_template_86() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 ) "Size of template specialization: " , stringify ! ( u64 )
)); ));
@ -27503,7 +27459,7 @@ pub mod root {
u64 ) )); u64 ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_89() { fn __bindgen_test_layout_template_87() {
assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat ! assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat !
( (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27514,7 +27470,7 @@ pub mod root {
[u32; 3usize] ) )); [u32; 3usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_90() { fn __bindgen_test_layout_template_88() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>() assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27525,7 +27481,7 @@ pub mod root {
root::already_AddRefed<root::nsStyleImageRequest> ) )); root::already_AddRefed<root::nsStyleImageRequest> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_91() { fn __bindgen_test_layout_template_89() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27536,7 +27492,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsStyleSides> ) )); root::mozilla::DefaultDelete<root::nsStyleSides> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_92() { fn __bindgen_test_layout_template_90() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides, assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides,
root::mozilla::DefaultDelete<root::nsStyleSides>>>() root::mozilla::DefaultDelete<root::nsStyleSides>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -27553,7 +27509,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_93() { fn __bindgen_test_layout_template_91() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>() assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>()
, 1usize , concat ! ( , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27566,7 +27522,7 @@ pub mod root {
)); ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_94() { fn __bindgen_test_layout_template_92() {
assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>() assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>()
, 32usize , concat ! ( , 32usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27577,7 +27533,7 @@ pub mod root {
root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) )); root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_95() { fn __bindgen_test_layout_template_93() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr, assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
::nsstring::nsStringRepr>>>() ::nsstring::nsStringRepr>>>()
, 8usize , concat ! ( , 8usize , concat ! (
@ -27592,7 +27548,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_96() { fn __bindgen_test_layout_template_94() {
assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat
! ( ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27603,7 +27559,7 @@ pub mod root {
[u64; 18usize] ) )); [u64; 18usize] ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_97() { fn __bindgen_test_layout_template_95() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>() assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27616,7 +27572,7 @@ pub mod root {
) )); ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_98() { fn __bindgen_test_layout_template_96() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>() assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27627,7 +27583,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::DOMRect> ) )); root::RefPtr<root::mozilla::dom::DOMRect> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_99() { fn __bindgen_test_layout_template_97() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! ( assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 ) "Size of template specialization: " , stringify ! ( u64 )
)); ));
@ -27636,7 +27592,7 @@ pub mod root {
u64 ) )); u64 ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_100() { fn __bindgen_test_layout_template_98() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>() assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (
@ -27647,7 +27603,7 @@ pub mod root {
root::nsTArray<*mut root::mozilla::css::DocumentRule> ) )); root::nsTArray<*mut root::mozilla::css::DocumentRule> ) ));
} }
#[test] #[test]
fn __bindgen_test_layout_template_101() { fn __bindgen_test_layout_template_99() {
assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>() assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>()
, 8usize , concat ! ( , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( "Size of template specialization: " , stringify ! (

View file

@ -261,12 +261,9 @@ macro_rules! impl_threadsafe_refcount {
); );
} }
impl_threadsafe_refcount!(::gecko_bindings::structs::ThreadSafePrincipalHolder, impl_threadsafe_refcount!(::gecko_bindings::structs::RawGeckoURLExtraData,
Gecko_AddRefPrincipalArbitraryThread, Gecko_AddRefURLExtraDataArbitraryThread,
Gecko_ReleasePrincipalArbitraryThread); Gecko_ReleaseURLExtraDataArbitraryThread);
impl_threadsafe_refcount!(::gecko_bindings::structs::ThreadSafeURIHolder,
Gecko_AddRefURIArbitraryThread,
Gecko_ReleaseURIArbitraryThread);
impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues, impl_threadsafe_refcount!(::gecko_bindings::structs::nsStyleQuoteValues,
Gecko_AddRefQuoteValuesArbitraryThread, Gecko_AddRefQuoteValuesArbitraryThread,
Gecko_ReleaseQuoteValuesArbitraryThread); Gecko_ReleaseQuoteValuesArbitraryThread);
@ -276,10 +273,3 @@ impl_threadsafe_refcount!(::gecko_bindings::structs::nsCSSValueSharedList,
impl_threadsafe_refcount!(::gecko_bindings::structs::mozilla::css::URLValue, impl_threadsafe_refcount!(::gecko_bindings::structs::mozilla::css::URLValue,
Gecko_AddRefCSSURLValueArbitraryThread, Gecko_AddRefCSSURLValueArbitraryThread,
Gecko_ReleaseCSSURLValueArbitraryThread); Gecko_ReleaseCSSURLValueArbitraryThread);
/// A Gecko `ThreadSafePrincipalHolder` wrapped in a safe refcounted pointer, to
/// use during stylesheet parsing and style computation.
pub type GeckoArcPrincipal = RefPtr<::gecko_bindings::structs::ThreadSafePrincipalHolder>;
/// A Gecko `ThreadSafeURIHolder` wrapped in a safe refcounted pointer, to use
/// during stylesheet parsing and style computation.
pub type GeckoArcURI = RefPtr<::gecko_bindings::structs::ThreadSafeURIHolder>;

View file

@ -9,7 +9,9 @@
use cssparser::{Parser, SourcePosition, UnicodeRange}; use cssparser::{Parser, SourcePosition, UnicodeRange};
use error_reporting::ParseErrorReporter; use error_reporting::ParseErrorReporter;
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
use gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI}; use gecko_bindings::structs::URLExtraData;
#[cfg(feature = "gecko")]
use gecko_bindings::sugar::refptr::RefPtr;
use servo_url::ServoUrl; use servo_url::ServoUrl;
use style_traits::OneOrMoreCommaSeparated; use style_traits::OneOrMoreCommaSeparated;
use stylesheets::Origin; use stylesheets::Origin;
@ -21,12 +23,8 @@ pub struct ParserContextExtraData;
/// Extra data that the style backend may need to parse stylesheets. /// Extra data that the style backend may need to parse stylesheets.
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
pub struct ParserContextExtraData { pub struct ParserContextExtraData {
/// The base URI. /// The URL extra data.
pub base: Option<GeckoArcURI>, pub data: Option<RefPtr<URLExtraData>>,
/// The referrer URI.
pub referrer: Option<GeckoArcURI>,
/// The principal that loaded this stylesheet.
pub principal: Option<GeckoArcPrincipal>,
} }
#[cfg(not(feature = "gecko"))] #[cfg(not(feature = "gecko"))]
@ -39,7 +37,7 @@ impl Default for ParserContextExtraData {
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
impl Default for ParserContextExtraData { impl Default for ParserContextExtraData {
fn default() -> Self { fn default() -> Self {
ParserContextExtraData { base: None, referrer: None, principal: None } ParserContextExtraData { data: None }
} }
} }
@ -48,15 +46,10 @@ impl ParserContextExtraData {
/// Construct from a GeckoParserExtraData /// Construct from a GeckoParserExtraData
/// ///
/// GeckoParserExtraData must live longer than this call /// GeckoParserExtraData must live longer than this call
pub unsafe fn new(data: *const ::gecko_bindings::structs::GeckoParserExtraData) -> Self { pub unsafe fn new(data: *mut URLExtraData) -> Self {
// the to_safe calls are safe since we trust that we have references to ParserContextExtraData {
// real Gecko refptrs. The dereferencing of data is safe because this function data: Some(RefPtr::new(data)),
// is expected to be called with a `data` living longer than this function. }
unsafe { ParserContextExtraData {
base: Some((*data).mBaseURI.to_safe()),
referrer: Some((*data).mReferrer.to_safe()),
principal: Some((*data).mPrincipal.to_safe()),
}}
} }
} }
/// The data that the parser needs from outside in order to parse a stylesheet. /// The data that the parser needs from outside in order to parse a stylesheet.

View file

@ -2158,8 +2158,7 @@ ${helpers.predefined_type("-moz-binding", "UrlOrNone", "Either::Second(None_)",
animatable="False", animatable="False",
gecko_ffi_name="mBinding", gecko_ffi_name="mBinding",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-binding)", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-binding)",
disable_when_testing="True", disable_when_testing="True")}
boxed=True)}
${helpers.single_keyword("-moz-orient", ${helpers.single_keyword("-moz-orient",
"inline block horizontal vertical", "inline block horizontal vertical",

View file

@ -121,19 +121,16 @@ ${helpers.single_keyword("clip-rule", "nonzero evenodd",
${helpers.predefined_type("marker-start", "UrlOrNone", "Either::Second(None_)", ${helpers.predefined_type("marker-start", "UrlOrNone", "Either::Second(None_)",
products="gecko", products="gecko",
boxed = product == "gecko",
animatable="False", animatable="False",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")}
${helpers.predefined_type("marker-mid", "UrlOrNone", "Either::Second(None_)", ${helpers.predefined_type("marker-mid", "UrlOrNone", "Either::Second(None_)",
products="gecko", products="gecko",
boxed = product == "gecko",
animatable="False", animatable="False",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")}
${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)",
products="gecko", products="gecko",
boxed = product == "gecko",
animatable="False", animatable="False",
spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")}

View file

@ -38,7 +38,6 @@ ${helpers.single_keyword("list-style-type", """
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")} spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")}
${helpers.predefined_type("list-style-image", "UrlOrNone", "Either::Second(None_)", ${helpers.predefined_type("list-style-image", "UrlOrNone", "Either::Second(None_)",
boxed = product == "gecko",
initial_specified_value="Either::Second(None_)", animatable=False, initial_specified_value="Either::Second(None_)", animatable=False,
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image")} spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image")}

View file

@ -54,16 +54,15 @@ use style::gecko_bindings::bindings::nsTimingFunctionBorrowed;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut; use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut;
use style::gecko_bindings::structs; use style::gecko_bindings::structs;
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID}; use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID};
use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint, nsCSSFontFaceRule}; use style::gecko_bindings::structs::{nsRestyleHint, nsChangeHint, nsCSSFontFaceRule};
use style::gecko_bindings::structs::Loader; use style::gecko_bindings::structs::Loader;
use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::RawGeckoPresContextOwned;
use style::gecko_bindings::structs::ServoStyleSheet; use style::gecko_bindings::structs::ServoStyleSheet;
use style::gecko_bindings::structs::URLExtraData;
use style::gecko_bindings::structs::nsCSSValueSharedList; use style::gecko_bindings::structs::nsCSSValueSharedList;
use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::structs::nsresult;
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI};
use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
use style::gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI};
use style::gecko_properties::{self, style_structs}; use style::gecko_properties::{self, style_structs};
use style::keyframes::KeyframesStepValue; use style::keyframes::KeyframesStepValue;
use style::media_queries::{MediaList, parse_media_query_list}; use style::media_queries::{MediaList, parse_media_query_list};
@ -331,9 +330,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader,
data: *const nsACString, data: *const nsACString,
mode: SheetParsingMode, mode: SheetParsingMode,
base_url: *const nsACString, base_url: *const nsACString,
base: *mut ThreadSafeURIHolder, extra_data: *mut URLExtraData)
referrer: *mut ThreadSafeURIHolder,
principal: *mut ThreadSafePrincipalHolder)
-> RawServoStyleSheetStrong { -> RawServoStyleSheetStrong {
let global_style_data = &*GLOBAL_STYLE_DATA; let global_style_data = &*GLOBAL_STYLE_DATA;
let input = unsafe { data.as_ref().unwrap().as_str_unchecked() }; let input = unsafe { data.as_ref().unwrap().as_str_unchecked() };
@ -346,11 +343,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(loader: *mut Loader,
let base_str = unsafe { base_url.as_ref().unwrap().as_str_unchecked() }; let base_str = unsafe { base_url.as_ref().unwrap().as_str_unchecked() };
let url = ServoUrl::parse(base_str).unwrap(); let url = ServoUrl::parse(base_str).unwrap();
let extra_data = unsafe { ParserContextExtraData { let extra_data = unsafe { ParserContextExtraData::new(extra_data) };
base: Some(GeckoArcURI::new(base)),
referrer: Some(GeckoArcURI::new(referrer)),
principal: Some(GeckoArcPrincipal::new(principal)),
}};
let loader = if loader.is_null() { let loader = if loader.is_null() {
None None
} else { } else {
@ -375,16 +368,10 @@ pub extern "C" fn Servo_StyleSheet_ClearAndUpdate(stylesheet: RawServoStyleSheet
loader: *mut Loader, loader: *mut Loader,
gecko_stylesheet: *mut ServoStyleSheet, gecko_stylesheet: *mut ServoStyleSheet,
data: *const nsACString, data: *const nsACString,
base: *mut ThreadSafeURIHolder, extra_data: *mut URLExtraData)
referrer: *mut ThreadSafeURIHolder,
principal: *mut ThreadSafePrincipalHolder)
{ {
let input = unsafe { data.as_ref().unwrap().as_str_unchecked() }; let input = unsafe { data.as_ref().unwrap().as_str_unchecked() };
let extra_data = unsafe { ParserContextExtraData { let extra_data = unsafe { ParserContextExtraData::new(extra_data) };
base: Some(GeckoArcURI::new(base)),
referrer: Some(GeckoArcURI::new(referrer)),
principal: Some(GeckoArcPrincipal::new(principal)),
}};
let loader = if loader.is_null() { let loader = if loader.is_null() {
None None
@ -792,7 +779,7 @@ macro_rules! make_context {
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_ParseProperty(property: *const nsACString, value: *const nsACString, pub extern "C" fn Servo_ParseProperty(property: *const nsACString, value: *const nsACString,
base: *const nsACString, base: *const nsACString,
data: *const structs::GeckoParserExtraData) data: *mut URLExtraData)
-> RawServoDeclarationBlockStrong { -> RawServoDeclarationBlockStrong {
let name = unsafe { property.as_ref().unwrap().as_str_unchecked() }; let name = unsafe { property.as_ref().unwrap().as_str_unchecked() };
let id = if let Ok(id) = PropertyId::parse(name.into()) { let id = if let Ok(id) = PropertyId::parse(name.into()) {
@ -824,7 +811,7 @@ pub extern "C" fn Servo_ParseProperty(property: *const nsACString, value: *const
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_ParseEasing(easing: *const nsAString, pub extern "C" fn Servo_ParseEasing(easing: *const nsAString,
base: *const nsACString, base: *const nsACString,
data: *const structs::GeckoParserExtraData, data: *mut URLExtraData,
output: nsTimingFunctionBorrowedMut) output: nsTimingFunctionBorrowedMut)
-> bool { -> bool {
use style::properties::longhands::transition_timing_function; use style::properties::longhands::transition_timing_function;
@ -845,7 +832,7 @@ pub extern "C" fn Servo_ParseEasing(easing: *const nsAString,
#[no_mangle] #[no_mangle]
pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString, pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString,
base: *const nsACString, base: *const nsACString,
raw_extra_data: *const structs::GeckoParserExtraData) raw_extra_data: *mut URLExtraData)
-> RawServoDeclarationBlockStrong { -> RawServoDeclarationBlockStrong {
let global_style_data = &*GLOBAL_STYLE_DATA; let global_style_data = &*GLOBAL_STYLE_DATA;
let value = unsafe { data.as_ref().unwrap().as_str_unchecked() }; let value = unsafe { data.as_ref().unwrap().as_str_unchecked() };
@ -965,7 +952,7 @@ pub extern "C" fn Servo_DeclarationBlock_GetPropertyIsImportant(declarations: Ra
fn set_property(declarations: RawServoDeclarationBlockBorrowed, property_id: PropertyId, fn set_property(declarations: RawServoDeclarationBlockBorrowed, property_id: PropertyId,
value: *const nsACString, is_important: bool, value: *const nsACString, is_important: bool,
base: *const nsACString, data: *const structs::GeckoParserExtraData) -> bool { base: *const nsACString, data: *mut URLExtraData) -> bool {
let value = unsafe { value.as_ref().unwrap().as_str_unchecked() }; let value = unsafe { value.as_ref().unwrap().as_str_unchecked() };
make_context!((base, data) => (base_url, extra_data)); make_context!((base, data) => (base_url, extra_data));
@ -985,7 +972,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetProperty(declarations: RawServoDecla
property: *const nsACString, value: *const nsACString, property: *const nsACString, value: *const nsACString,
is_important: bool, is_important: bool,
base: *const nsACString, base: *const nsACString,
data: *const structs::GeckoParserExtraData) -> bool { data: *mut URLExtraData) -> bool {
set_property(declarations, get_property_id_from_property!(property, false), set_property(declarations, get_property_id_from_property!(property, false),
value, is_important, base, data) value, is_important, base, data)
} }
@ -995,7 +982,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPropertyById(declarations: RawServoD
property: nsCSSPropertyID, value: *const nsACString, property: nsCSSPropertyID, value: *const nsACString,
is_important: bool, is_important: bool,
base: *const nsACString, base: *const nsACString,
data: *const structs::GeckoParserExtraData) -> bool { data: *mut URLExtraData) -> bool {
set_property(declarations, get_property_id_from_nscsspropertyid!(property, false), set_property(declarations, get_property_id_from_nscsspropertyid!(property, false),
value, is_important, base, data) value, is_important, base, data)
} }

View file

@ -44,13 +44,13 @@ impl StyleStylesheetLoader for StylesheetLoader {
// so this raw pointer will still be valid. // so this raw pointer will still be valid.
let (spec_bytes, spec_len): (*const u8, usize) = import.url.as_slice_components(); let (spec_bytes, spec_len): (*const u8, usize) = import.url.as_slice_components();
let base_uri = import.url.base.mRawPtr; let base_url_data = import.url.extra_data.get();
let arc = make_arc(import); let arc = make_arc(import);
unsafe { unsafe {
Gecko_LoadStyleSheet(self.0, Gecko_LoadStyleSheet(self.0,
self.1, self.1,
HasArcFFI::arc_as_borrowed(&arc), HasArcFFI::arc_as_borrowed(&arc),
base_uri, base_url_data,
spec_bytes, spec_bytes,
spec_len as u32, spec_len as u32,
media_string.as_bytes().as_ptr(), media_string.as_bytes().as_ptr(),