Skip to content

Commit

Permalink
Derive MallocSizeOf for ComputedValueFlags (#76)
Browse files Browse the repository at this point in the history
And then remove ignore_malloc_size_of in Stylist.

Signed-off-by: Oriol Brufau <[email protected]>
  • Loading branch information
Loirooriol authored Sep 16, 2024
1 parent 6059306 commit 25daa6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 12 additions & 9 deletions style/properties/computed_value_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

//! Misc information about a given computed style.
/// Misc information about a given computed style.
///
/// All flags are currently inherited for text, pseudo elements, and
/// anonymous boxes, see StyleBuilder::for_inheritance and its callsites.
/// If we ever want to add some flags that shouldn't inherit for them,
/// we might want to add a function to handle this.
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
pub struct ComputedValueFlags(u32);

bitflags! {
/// Misc information about a given computed style.
///
/// All flags are currently inherited for text, pseudo elements, and
/// anonymous boxes, see StyleBuilder::for_inheritance and its callsites.
/// If we ever want to add some flags that shouldn't inherit for them,
/// we might want to add a function to handle this.
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct ComputedValueFlags: u32 {
impl ComputedValueFlags: u32 {
/// Whether the style or any of the ancestors has a text-decoration-line
/// property that should get propagated to descendants.
///
Expand Down
1 change: 0 additions & 1 deletion style/stylist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ pub struct Stylist {
initial_values_for_custom_properties: ComputedCustomProperties,

/// Flags set from computing registered custom property initial values.
#[cfg_attr(feature = "servo", ignore_malloc_size_of = "missing malloc_size_of")]
initial_values_for_custom_properties_flags: ComputedValueFlags,

/// The total number of times the stylist has been rebuilt.
Expand Down

0 comments on commit 25daa6b

Please sign in to comment.