mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Report memory usage from LayoutThreadData Stylist [#7038]
This commit is contained in:
parent
e551ea7322
commit
db2e10a70f
11 changed files with 133 additions and 164 deletions
|
@ -23,7 +23,7 @@ pub fn parse_name(s: &str) -> Result<&str, ()> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub struct SpecifiedValue {
|
||||
css: String,
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ pub mod longhands {
|
|||
-> Result<SpecifiedValue, ()> {
|
||||
specified::parse_border_width(input).map(SpecifiedValue)
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(pub specified::Length);
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
|
@ -416,7 +416,7 @@ pub mod longhands {
|
|||
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||
specified::parse_border_width(input).map(SpecifiedValue)
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(pub specified::Length);
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
|
@ -678,7 +678,7 @@ pub mod longhands {
|
|||
use values::CSSFloat;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Copy)]
|
||||
#[derive(Debug, Clone, PartialEq, Copy, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Normal,
|
||||
Number(CSSFloat),
|
||||
|
@ -774,7 +774,7 @@ pub mod longhands {
|
|||
<% vertical_align_keywords = (
|
||||
"baseline sub super top text-top middle bottom text-bottom".split()) %>
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Debug, Clone, PartialEq, Copy)]
|
||||
#[derive(Debug, Clone, PartialEq, Copy, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
% for keyword in vertical_align_keywords:
|
||||
${to_rust_ident(keyword)},
|
||||
|
@ -1124,7 +1124,7 @@ pub mod longhands {
|
|||
use values::computed::Context;
|
||||
use values::LocalToCss;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
None,
|
||||
Url(Url),
|
||||
|
@ -1362,7 +1362,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(pub Option<Image>);
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
|
@ -1415,7 +1415,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Copy)]
|
||||
#[derive(Debug, Clone, PartialEq, Copy, HeapSizeOf)]
|
||||
pub struct SpecifiedValue {
|
||||
pub horizontal: specified::LengthOrPercentage,
|
||||
pub vertical: specified::LengthOrPercentage,
|
||||
|
@ -1554,7 +1554,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub struct SpecifiedExplicitSize {
|
||||
pub width: specified::LengthOrPercentageOrAuto,
|
||||
pub height: specified::LengthOrPercentageOrAuto,
|
||||
|
@ -1577,7 +1577,7 @@ pub mod longhands {
|
|||
}
|
||||
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Explicit(SpecifiedExplicitSize),
|
||||
Cover,
|
||||
|
@ -1818,7 +1818,7 @@ pub mod longhands {
|
|||
use std::fmt;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Copy, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Bolder,
|
||||
Lighter,
|
||||
|
@ -1945,7 +1945,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(pub specified::LengthOrPercentage);
|
||||
pub mod computed_value {
|
||||
use app_units::Au;
|
||||
|
@ -2045,7 +2045,7 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Normal,
|
||||
Specified(specified::Length),
|
||||
|
@ -2108,7 +2108,7 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Normal,
|
||||
Specified(specified::Length), // FIXME(SimonSapin) support percentages
|
||||
|
@ -2435,7 +2435,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue {
|
||||
pub horizontal: specified::Length,
|
||||
pub vertical: specified::Length,
|
||||
|
@ -2586,7 +2586,7 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Auto,
|
||||
Specified(specified::Length),
|
||||
|
@ -2648,7 +2648,7 @@ pub mod longhands {
|
|||
use std::fmt;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Auto,
|
||||
Specified(u32),
|
||||
|
@ -2715,7 +2715,7 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, HeapSizeOf)]
|
||||
pub enum SpecifiedValue {
|
||||
Normal,
|
||||
Specified(specified::Length),
|
||||
|
@ -2787,7 +2787,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(pub CSSFloat);
|
||||
pub mod computed_value {
|
||||
use values::CSSFloat;
|
||||
|
@ -2823,10 +2823,10 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(Vec<SpecifiedBoxShadow>);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedBoxShadow {
|
||||
pub offset_x: specified::Length,
|
||||
pub offset_y: specified::Length,
|
||||
|
@ -3080,7 +3080,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Copy)]
|
||||
#[derive(Clone, Debug, PartialEq, Copy, HeapSizeOf)]
|
||||
pub struct SpecifiedClipRect {
|
||||
pub top: specified::Length,
|
||||
pub right: Option<specified::Length>,
|
||||
|
@ -3088,7 +3088,7 @@ pub mod longhands {
|
|||
pub left: specified::Length,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Copy)]
|
||||
#[derive(Clone, Debug, PartialEq, Copy, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(Option<SpecifiedClipRect>);
|
||||
|
||||
impl ToCss for SpecifiedClipRect {
|
||||
|
@ -3187,10 +3187,10 @@ pub mod longhands {
|
|||
use values::AuExtensionMethods;
|
||||
use values::computed::Context;
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(Vec<SpecifiedTextShadow>);
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub struct SpecifiedTextShadow {
|
||||
pub offset_x: specified::Length,
|
||||
pub offset_y: specified::Length,
|
||||
|
@ -3368,11 +3368,11 @@ pub mod longhands {
|
|||
use values::CSSFloat;
|
||||
use values::specified::{Angle, Length};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(Vec<SpecifiedFilter>);
|
||||
|
||||
// TODO(pcwalton): `drop-shadow`
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub enum SpecifiedFilter {
|
||||
Blur(Length),
|
||||
Brightness(CSSFloat),
|
||||
|
@ -3670,7 +3670,7 @@ pub mod longhands {
|
|||
Ok((first, second))
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, HeapSizeOf)]
|
||||
enum TranslateKind {
|
||||
Translate,
|
||||
TranslateX,
|
||||
|
@ -3679,7 +3679,7 @@ pub mod longhands {
|
|||
Translate3D,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
|
||||
enum SpecifiedOperation {
|
||||
Matrix(SpecifiedMatrix),
|
||||
Skew(specified::Angle, specified::Angle),
|
||||
|
@ -3758,7 +3758,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue(Vec<SpecifiedOperation>);
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
|
@ -4155,7 +4155,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue {
|
||||
horizontal: LengthOrPercentage,
|
||||
vertical: LengthOrPercentage,
|
||||
|
@ -4243,7 +4243,7 @@ pub mod longhands {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, HeapSizeOf)]
|
||||
pub struct SpecifiedValue {
|
||||
horizontal: LengthOrPercentage,
|
||||
vertical: LengthOrPercentage,
|
||||
|
@ -5855,7 +5855,7 @@ impl CSSWideKeyword {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, Debug, HeapSizeOf)]
|
||||
pub enum Shorthand {
|
||||
% for property in SHORTHANDS:
|
||||
${property.camel_case},
|
||||
|
@ -5888,7 +5888,7 @@ impl Shorthand {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq, Debug, HeapSizeOf)]
|
||||
pub enum DeclaredValue<T> {
|
||||
Value(T),
|
||||
WithVariables {
|
||||
|
@ -5919,7 +5919,7 @@ impl<T: ToCss> ToCss for DeclaredValue<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
#[derive(PartialEq, Clone, Debug, HeapSizeOf)]
|
||||
pub enum PropertyDeclaration {
|
||||
% for property in LONGHANDS:
|
||||
${property.camel_case}(DeclaredValue<longhands::${property.ident}::SpecifiedValue>),
|
||||
|
|
|
@ -218,7 +218,7 @@ fn combinator_to_restyle_hint(combinator: Option<Combinator>) -> RestyleHint {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, HeapSizeOf)]
|
||||
struct Sensitivities {
|
||||
pub states: ElementState,
|
||||
pub attrs: bool,
|
||||
|
@ -255,14 +255,14 @@ impl Sensitivities {
|
|||
// us to quickly scan through the dependency sites of all style rules and determine the
|
||||
// maximum effect that a given state or attribute change may have on the style of
|
||||
// elements in the document.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, HeapSizeOf)]
|
||||
struct Dependency<Impl: SelectorImplExt> {
|
||||
selector: Arc<CompoundSelector<Impl>>,
|
||||
combinator: Option<Combinator>,
|
||||
sensitivities: Sensitivities,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, HeapSizeOf)]
|
||||
pub struct DependencySet<Impl: SelectorImplExt> {
|
||||
deps: Vec<Dependency<Impl>>,
|
||||
}
|
||||
|
|
|
@ -83,6 +83,7 @@ lazy_static! {
|
|||
};
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf)]
|
||||
pub struct Stylist<Impl: SelectorImplExt> {
|
||||
// Device that the stylist is currently evaluating against.
|
||||
pub device: Device,
|
||||
|
@ -337,6 +338,7 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf)]
|
||||
struct PerOriginSelectorMap<Impl: SelectorImpl> {
|
||||
normal: SelectorMap<Vec<PropertyDeclaration>, Impl>,
|
||||
important: SelectorMap<Vec<PropertyDeclaration>, Impl>,
|
||||
|
@ -352,6 +354,7 @@ impl<Impl: SelectorImpl> PerOriginSelectorMap<Impl> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf)]
|
||||
struct PerPseudoElementSelectorMap<Impl: SelectorImpl> {
|
||||
user_agent: PerOriginSelectorMap<Impl>,
|
||||
author: PerOriginSelectorMap<Impl>,
|
||||
|
|
|
@ -132,7 +132,7 @@ pub mod specified {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug, HeapSizeOf)]
|
||||
pub struct CSSRGBA {
|
||||
pub parsed: cssparser::RGBA,
|
||||
pub authored: Option<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue