mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #17844 - emilio:is-visited, r=bholley
stylo: Read mName as a raw nsIAtom* from NodeInfoInner. Changes for bug 1383756.
This commit is contained in:
commit
897f5d8884
4 changed files with 60 additions and 22 deletions
|
@ -4206,19 +4206,21 @@ pub mod root {
|
|||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct NodeInfo_NodeInfoInner {
|
||||
pub mName: root::nsCOMPtr<root::nsIAtom>,
|
||||
pub mPrefix: root::nsCOMPtr<root::nsIAtom>,
|
||||
pub mName: *const root::nsIAtom,
|
||||
pub mPrefix: *mut root::nsIAtom,
|
||||
pub mNamespaceID: i32,
|
||||
pub mNodeType: u16,
|
||||
pub mNameString: *const root::nsAString,
|
||||
pub mExtraName: root::nsCOMPtr<root::nsIAtom>,
|
||||
pub mExtraName: *mut root::nsIAtom,
|
||||
pub mHash: root::PLHashNumber,
|
||||
pub mHashInitialized: bool,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_NodeInfo_NodeInfoInner() {
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo_NodeInfoInner>() ,
|
||||
40usize , concat ! (
|
||||
48usize , concat ! (
|
||||
"Size of: " , stringify ! ( NodeInfo_NodeInfoInner
|
||||
) ));
|
||||
assert_eq! (::std::mem::align_of::<NodeInfo_NodeInfoInner>() ,
|
||||
|
@ -4267,6 +4269,23 @@ pub mod root {
|
|||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mExtraName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) .
|
||||
mHash as * const _ as usize } , 40usize , concat !
|
||||
(
|
||||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mHash ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) .
|
||||
mHashInitialized as * const _ as usize } , 44usize
|
||||
, concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mHashInitialized ) ));
|
||||
}
|
||||
impl Clone for NodeInfo_NodeInfoInner {
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
extern "C" {
|
||||
#[link_name =
|
||||
|
@ -4276,7 +4295,7 @@ pub mod root {
|
|||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_NodeInfo() {
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo>() , 120usize ,
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo>() , 128usize ,
|
||||
concat ! ( "Size of: " , stringify ! ( NodeInfo )
|
||||
));
|
||||
assert_eq! (::std::mem::align_of::<NodeInfo>() , 8usize ,
|
||||
|
@ -4304,22 +4323,22 @@ pub mod root {
|
|||
, "::" , stringify ! ( mInner ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mOwnerManager
|
||||
as * const _ as usize } , 64usize , concat ! (
|
||||
as * const _ as usize } , 72usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mOwnerManager ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mQualifiedName
|
||||
as * const _ as usize } , 72usize , concat ! (
|
||||
as * const _ as usize } , 80usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mQualifiedName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mNodeName as *
|
||||
const _ as usize } , 88usize , concat ! (
|
||||
const _ as usize } , 96usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mNodeName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mLocalName as
|
||||
* const _ as usize } , 104usize , concat ! (
|
||||
* const _ as usize } , 112usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mLocalName ) ));
|
||||
}
|
||||
|
|
|
@ -4097,19 +4097,21 @@ pub mod root {
|
|||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct NodeInfo_NodeInfoInner {
|
||||
pub mName: root::nsCOMPtr,
|
||||
pub mPrefix: root::nsCOMPtr,
|
||||
pub mName: *const root::nsIAtom,
|
||||
pub mPrefix: *mut root::nsIAtom,
|
||||
pub mNamespaceID: i32,
|
||||
pub mNodeType: u16,
|
||||
pub mNameString: *const root::nsAString,
|
||||
pub mExtraName: root::nsCOMPtr,
|
||||
pub mExtraName: *mut root::nsIAtom,
|
||||
pub mHash: root::PLHashNumber,
|
||||
pub mHashInitialized: bool,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_NodeInfo_NodeInfoInner() {
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo_NodeInfoInner>() ,
|
||||
40usize , concat ! (
|
||||
48usize , concat ! (
|
||||
"Size of: " , stringify ! ( NodeInfo_NodeInfoInner
|
||||
) ));
|
||||
assert_eq! (::std::mem::align_of::<NodeInfo_NodeInfoInner>() ,
|
||||
|
@ -4158,6 +4160,23 @@ pub mod root {
|
|||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mExtraName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) .
|
||||
mHash as * const _ as usize } , 40usize , concat !
|
||||
(
|
||||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mHash ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo_NodeInfoInner ) ) .
|
||||
mHashInitialized as * const _ as usize } , 44usize
|
||||
, concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
NodeInfo_NodeInfoInner ) , "::" , stringify ! (
|
||||
mHashInitialized ) ));
|
||||
}
|
||||
impl Clone for NodeInfo_NodeInfoInner {
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
extern "C" {
|
||||
#[link_name =
|
||||
|
@ -4167,7 +4186,7 @@ pub mod root {
|
|||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_NodeInfo() {
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo>() , 112usize ,
|
||||
assert_eq!(::std::mem::size_of::<NodeInfo>() , 120usize ,
|
||||
concat ! ( "Size of: " , stringify ! ( NodeInfo )
|
||||
));
|
||||
assert_eq! (::std::mem::align_of::<NodeInfo>() , 8usize ,
|
||||
|
@ -4190,22 +4209,22 @@ pub mod root {
|
|||
, "::" , stringify ! ( mInner ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mOwnerManager
|
||||
as * const _ as usize } , 56usize , concat ! (
|
||||
as * const _ as usize } , 64usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mOwnerManager ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mQualifiedName
|
||||
as * const _ as usize } , 64usize , concat ! (
|
||||
as * const _ as usize } , 72usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mQualifiedName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mNodeName as *
|
||||
const _ as usize } , 80usize , concat ! (
|
||||
const _ as usize } , 88usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mNodeName ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const NodeInfo ) ) . mLocalName as
|
||||
* const _ as usize } , 96usize , concat ! (
|
||||
* const _ as usize } , 104usize , concat ! (
|
||||
"Alignment of field: " , stringify ! ( NodeInfo )
|
||||
, "::" , stringify ! ( mLocalName ) ));
|
||||
}
|
||||
|
|
|
@ -1665,7 +1665,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
|
||||
fn get_local_name(&self) -> &WeakAtom {
|
||||
unsafe {
|
||||
WeakAtom::new(self.as_node().node_info().mInner.mName.raw::<nsIAtom>())
|
||||
WeakAtom::new(self.as_node().node_info().mInner.mName)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ unsafe impl Sync for WeakAtom {}
|
|||
impl WeakAtom {
|
||||
/// Construct a `WeakAtom` from a raw `nsIAtom`.
|
||||
#[inline]
|
||||
pub unsafe fn new<'a>(atom: *mut nsIAtom) -> &'a mut Self {
|
||||
pub unsafe fn new<'a>(atom: *const nsIAtom) -> &'a mut Self {
|
||||
&mut *(atom as *mut WeakAtom)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue