Navigation Menu

Skip to content

Commit

Permalink
stylo: Stop using mStyleIfVisited in Servo
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jul 18, 2017
1 parent e78947f commit 2a49a73
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 82 deletions.
5 changes: 0 additions & 5 deletions components/style/gecko/generated/bindings.rs
Expand Up @@ -2687,11 +2687,6 @@ extern "C" {
target: InheritTarget)
-> ServoStyleContextStrong;
}
extern "C" {
pub fn Servo_ComputedValues_GetVisitedStyle(values:
ServoComputedValuesBorrowed)
-> ServoStyleContextStrong;
}
extern "C" {
pub fn Servo_ComputedValues_GetStyleBits(values:
ServoComputedValuesBorrowed)
Expand Down
66 changes: 33 additions & 33 deletions components/style/gecko/generated/structs_debug.rs
Expand Up @@ -13,7 +13,7 @@ pub type ServoWritingMode = ::logical_geometry::WritingMode;
pub type ServoFontComputationData = ::properties::FontComputationData;
pub type ServoCustomPropertiesMap = Option<::stylearc::Arc<::custom_properties::CustomPropertiesMap>>;
pub type ServoRuleNode = Option<::rule_tree::StrongRuleNode>;
pub type ServoVisitedStyle = Option<::stylearc::Arc<::properties::ComputedValues>>;
pub type ServoVisitedStyle = Option<::stylearc::RawOffsetArc<::properties::ComputedValues>>;
pub type ServoComputedValueFlags = ::properties::computed_value_flags::ComputedValueFlags;
pub type ServoRawOffsetArc<T> = ::stylearc::RawOffsetArc<T>;
pub type ServoStyleContextStrong = ::gecko_bindings::sugar::ownership::Strong<ServoStyleContext>;
Expand Down Expand Up @@ -7603,6 +7603,36 @@ pub mod root {
}
#[repr(C)]
#[derive(Debug)]
pub struct ServoStyleContext {
pub _base: root::nsStyleContext,
pub mPresContext: *mut root::nsPresContext,
pub mSource: root::ServoComputedValues,
}
#[test]
fn bindgen_test_layout_ServoStyleContext() {
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 280usize ,
concat ! (
"Size of: " , stringify ! ( ServoStyleContext ) ));
assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( ServoStyleContext )
));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) .
mPresContext as * const _ as usize } , 40usize ,
concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! (
mPresContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) . mSource
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! ( mSource )
));
}
#[repr(C)]
#[derive(Debug)]
pub struct GeckoFont {
pub gecko: root::nsStyleFont,
}
Expand Down Expand Up @@ -10844,36 +10874,6 @@ pub mod root {
}
#[repr(C)]
#[derive(Debug)]
pub struct ServoStyleContext {
pub _base: root::nsStyleContext,
pub mPresContext: *mut root::nsPresContext,
pub mSource: root::ServoComputedValues,
}
#[test]
fn bindgen_test_layout_ServoStyleContext() {
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 280usize ,
concat ! (
"Size of: " , stringify ! ( ServoStyleContext ) ));
assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( ServoStyleContext )
));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) .
mPresContext as * const _ as usize } , 40usize ,
concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! (
mPresContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) . mSource
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! ( mSource )
));
}
#[repr(C)]
#[derive(Debug)]
pub struct AnimationPropertySegment {
pub mFromKey: f32,
pub mToKey: f32,
Expand Down Expand Up @@ -40114,7 +40114,7 @@ pub mod root {
root::nsCharTraits ) ));
}
#[test]
fn __bindgen_test_layout__bindgen_ty_id_195320_instantiation_33() {
fn __bindgen_test_layout__bindgen_ty_id_195318_instantiation_33() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
Expand All @@ -40123,7 +40123,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout__bindgen_ty_id_195356_instantiation_34() {
fn __bindgen_test_layout__bindgen_ty_id_195354_instantiation_34() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
Expand Down
66 changes: 33 additions & 33 deletions components/style/gecko/generated/structs_release.rs
Expand Up @@ -13,7 +13,7 @@ pub type ServoWritingMode = ::logical_geometry::WritingMode;
pub type ServoFontComputationData = ::properties::FontComputationData;
pub type ServoCustomPropertiesMap = Option<::stylearc::Arc<::custom_properties::CustomPropertiesMap>>;
pub type ServoRuleNode = Option<::rule_tree::StrongRuleNode>;
pub type ServoVisitedStyle = Option<::stylearc::Arc<::properties::ComputedValues>>;
pub type ServoVisitedStyle = Option<::stylearc::RawOffsetArc<::properties::ComputedValues>>;
pub type ServoComputedValueFlags = ::properties::computed_value_flags::ComputedValueFlags;
pub type ServoRawOffsetArc<T> = ::stylearc::RawOffsetArc<T>;
pub type ServoStyleContextStrong = ::gecko_bindings::sugar::ownership::Strong<ServoStyleContext>;
Expand Down Expand Up @@ -7455,6 +7455,36 @@ pub mod root {
}
#[repr(C)]
#[derive(Debug)]
pub struct ServoStyleContext {
pub _base: root::nsStyleContext,
pub mPresContext: *mut root::nsPresContext,
pub mSource: root::ServoComputedValues,
}
#[test]
fn bindgen_test_layout_ServoStyleContext() {
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 280usize ,
concat ! (
"Size of: " , stringify ! ( ServoStyleContext ) ));
assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( ServoStyleContext )
));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) .
mPresContext as * const _ as usize } , 40usize ,
concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! (
mPresContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) . mSource
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! ( mSource )
));
}
#[repr(C)]
#[derive(Debug)]
pub struct GeckoFont {
pub gecko: root::nsStyleFont,
}
Expand Down Expand Up @@ -10581,36 +10611,6 @@ pub mod root {
}
#[repr(C)]
#[derive(Debug)]
pub struct ServoStyleContext {
pub _base: root::nsStyleContext,
pub mPresContext: *mut root::nsPresContext,
pub mSource: root::ServoComputedValues,
}
#[test]
fn bindgen_test_layout_ServoStyleContext() {
assert_eq!(::std::mem::size_of::<ServoStyleContext>() , 280usize ,
concat ! (
"Size of: " , stringify ! ( ServoStyleContext ) ));
assert_eq! (::std::mem::align_of::<ServoStyleContext>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( ServoStyleContext )
));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) .
mPresContext as * const _ as usize } , 40usize ,
concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! (
mPresContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ServoStyleContext ) ) . mSource
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
ServoStyleContext ) , "::" , stringify ! ( mSource )
));
}
#[repr(C)]
#[derive(Debug)]
pub struct AnimationPropertySegment {
pub mFromKey: f32,
pub mToKey: f32,
Expand Down Expand Up @@ -39462,7 +39462,7 @@ pub mod root {
root::nsCharTraits ) ));
}
#[test]
fn __bindgen_test_layout__bindgen_ty_id_192842_instantiation_33() {
fn __bindgen_test_layout__bindgen_ty_id_192840_instantiation_33() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
Expand All @@ -39471,7 +39471,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout__bindgen_ty_id_192878_instantiation_34() {
fn __bindgen_test_layout__bindgen_ty_id_192876_instantiation_34() {
assert_eq!(::std::mem::size_of::<u8>() , 1usize , concat ! (
"Size of template specialization: " , stringify ! ( u8 )
));
Expand Down
4 changes: 2 additions & 2 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -131,7 +131,7 @@ impl ComputedValuesInner {
writing_mode: writing_mode,
font_computation_data: FontComputationData::new(font_size_keyword),
rules: rules,
visited_style: visited_style,
visited_style: visited_style.map(|x| Arc::into_raw_offset(x)),
flags: flags,
% for style_struct in data.style_structs:
${style_struct.gecko_name}: Arc::into_raw_offset(${style_struct.ident}),
Expand Down Expand Up @@ -250,7 +250,7 @@ impl ComputedValuesInner {
/// Clone the visited style. Used for inheriting parent styles in
/// StyleBuilder::for_inheritance.
pub fn clone_visited_style(&self) -> Option<Arc<ComputedValues>> {
self.visited_style.clone()
self.visited_style.as_ref().map(|x| x.clone_arc())
}

/// Gets a reference to the custom properties map (if one exists).
Expand Down
9 changes: 0 additions & 9 deletions ports/geckolib/glue.rs
Expand Up @@ -1732,15 +1732,6 @@ pub extern "C" fn Servo_ComputedValues_Inherit(
style.to_outer(data.stylist.device(), parent_style_context, pseudo_info).into_strong()
}

#[no_mangle]
pub extern "C" fn Servo_ComputedValues_GetVisitedStyle(values: ServoComputedValuesBorrowed)
-> ServoStyleContextStrong {
match values.clone_visited_style() {
Some(v) => v.into_strong(),
None => Strong::null(),
}
}

#[no_mangle]
pub extern "C" fn Servo_StyleContext_NewContext(values: ServoComputedValuesBorrowed,
parent: ServoStyleContextBorrowedOrNull,
Expand Down

0 comments on commit 2a49a73

Please sign in to comment.