mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
stylo: Flatten ServoComputedValues into ServoStyleContext
This patch also removes the duplication of style contexts during the restyle, because otherwise pointer equality of ServoComputedValues stops holding (and we assert on that in a few places)
This commit is contained in:
parent
cfad95bff0
commit
ff4bc5a2c6
6 changed files with 82 additions and 45 deletions
|
@ -10847,11 +10847,11 @@ pub mod root {
|
|||
pub struct ServoStyleContext {
|
||||
pub _base: root::nsStyleContext,
|
||||
pub mPresContext: *mut root::nsPresContext,
|
||||
pub mSource: root::RefPtr<root::ServoComputedValues>,
|
||||
pub mSource: root::ServoComputedValues,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_ServoStyleContext() {
|
||||
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 56usize ,
|
||||
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 280usize ,
|
||||
concat ! (
|
||||
"Size of: " , stringify ! ( ServoStyleContext ) ));
|
||||
assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize ,
|
||||
|
@ -20971,10 +20971,6 @@ pub mod root {
|
|||
* so we define this type on the C++ side and use the bindgenned version
|
||||
* on the Rust side.
|
||||
*
|
||||
* C++ just sees pointers and opaque types here, so bindgen will attempt to generate a Copy
|
||||
* impl. This will fail because the bindgenned version contains owned types. Opt out.
|
||||
*
|
||||
* <div rustbindgen nocopy></div>
|
||||
*/
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
|
@ -21174,6 +21170,31 @@ pub mod root {
|
|||
"Alignment of field: " , stringify ! ( ServoComputedValues
|
||||
) , "::" , stringify ! ( flags ) ));
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct ServoComputedValuesForgotten {
|
||||
pub mPtr: *const root::ServoComputedValues,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_ServoComputedValuesForgotten() {
|
||||
assert_eq!(::std::mem::size_of::<ServoComputedValuesForgotten>() ,
|
||||
8usize , concat ! (
|
||||
"Size of: " , stringify ! ( ServoComputedValuesForgotten )
|
||||
));
|
||||
assert_eq! (::std::mem::align_of::<ServoComputedValuesForgotten>() ,
|
||||
8usize , concat ! (
|
||||
"Alignment of " , stringify ! (
|
||||
ServoComputedValuesForgotten ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const ServoComputedValuesForgotten ) ) .
|
||||
mPtr as * const _ as usize } , 0usize , concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
ServoComputedValuesForgotten ) , "::" , stringify ! ( mPtr
|
||||
) ));
|
||||
}
|
||||
impl Clone for ServoComputedValuesForgotten {
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum WeakMapTraceKind {
|
||||
|
@ -38416,13 +38437,15 @@ pub mod root {
|
|||
pub type RawGeckoGfxMatrix4x4 = [root::mozilla::gfx::Float; 16usize];
|
||||
pub type RawGeckoStyleChildrenIterator =
|
||||
root::mozilla::dom::StyleChildrenIterator;
|
||||
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
||||
pub type RawServoDeclarationBlockBorrowed =
|
||||
*const root::RawServoDeclarationBlock;
|
||||
pub type ServoStyleContextBorrowed =
|
||||
*const root::mozilla::ServoStyleContext;
|
||||
pub type ServoStyleContextBorrowedOrNull =
|
||||
*const root::mozilla::ServoStyleContext;
|
||||
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
||||
pub type ServoComputedValuesBorrowedOrNull =
|
||||
*const root::ServoComputedValues;
|
||||
pub type RawServoAnimationValueMapBorrowedMut =
|
||||
*mut root::RawServoAnimationValueMap;
|
||||
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
|
||||
|
@ -40091,7 +40114,7 @@ pub mod root {
|
|||
root::nsCharTraits ) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout__bindgen_ty_id_195909_instantiation_33() {
|
||||
fn __bindgen_test_layout__bindgen_ty_id_195896_instantiation_33() {
|
||||
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! ( u8 )
|
||||
));
|
||||
|
@ -40100,7 +40123,7 @@ pub mod root {
|
|||
) ));
|
||||
}
|
||||
#[test]
|
||||
fn __bindgen_test_layout__bindgen_ty_id_195945_instantiation_34() {
|
||||
fn __bindgen_test_layout__bindgen_ty_id_195932_instantiation_34() {
|
||||
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
|
||||
"Size of template specialization: " , stringify ! ( u8 )
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue