mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Measure PropertyDeclaration more thoroughly.
This patch replaces the handwritten MallocSizeOf implementation for PropertyDeclaration with a derived one, which gives much more thorough measurement. This requires (a) deriving MallocSizeOf for a *lot* of additional types (most of which already have `derive(HeapSizeOf)` in Servo builds), and (b) implementing MallocSizeOf for a few more types in the `malloc_size_of` crate. These changes would significantly improve the reporting coverage for gmail if it weren't for the fact that SpecifiedUrl isn't measured due to a lack of clarity about its fields; that can be fixed as a follow-up once bug 1397971 has landed.
This commit is contained in:
parent
1aa8be392b
commit
c5aa2cb986
66 changed files with 302 additions and 59 deletions
|
@ -10,6 +10,7 @@ use style_traits::ToCss;
|
|||
use values::generics::rect::Rect;
|
||||
|
||||
/// A generic value for a single side of a `border-image-width` property.
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||
pub enum BorderImageSideWidth<LengthOrPercentage, Number> {
|
||||
|
@ -23,6 +24,7 @@ pub enum BorderImageSideWidth<LengthOrPercentage, Number> {
|
|||
|
||||
/// A generic value for the `border-image-slice` property.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, ToComputedValue)]
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct BorderImageSlice<NumberOrPercentage> {
|
||||
/// The offsets.
|
||||
|
@ -34,6 +36,7 @@ pub struct BorderImageSlice<NumberOrPercentage> {
|
|||
/// A generic value for `border-radius`, `outline-radius` and `inset()`.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-backgrounds-3/#border-radius
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)]
|
||||
#[derive(PartialEq, ToComputedValue)]
|
||||
|
@ -49,6 +52,7 @@ pub struct BorderRadius<LengthOrPercentage> {
|
|||
}
|
||||
|
||||
/// A generic value for `border-*-radius` longhand properties.
|
||||
#[cfg_attr(feature = "gecko", derive(MallocSizeOf))]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)]
|
||||
#[derive(PartialEq, ToComputedValue)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue