Add sizeof for AuthorStyles.

This commit is contained in:
Xidorn Quan 2018-02-19 15:12:13 +11:00
parent d423e54d58
commit f518e55c28
6 changed files with 97 additions and 88 deletions

View file

@ -25,8 +25,7 @@ use stylesheets::{CssRule, StylesheetInDocument};
/// need to be restyled. Whether it represents a whole subtree or just a single
/// element is determined by whether the invalidation is stored in the
/// StylesheetInvalidationSet's invalid_scopes or invalid_elements table.
#[derive(Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
#[derive(Debug, Eq, Hash, MallocSizeOf, PartialEq)]
enum Invalidation {
/// An element with a given id.
ID(Atom),
@ -98,7 +97,7 @@ impl Invalidation {
///
/// TODO(emilio): We might be able to do the same analysis for media query
/// changes too (or even selector changes?).
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
#[derive(MallocSizeOf)]
pub struct StylesheetInvalidationSet {
/// The subtrees we know we have to restyle so far.
invalid_scopes: FnvHashSet<Invalidation>,