diff options
Diffstat (limited to 'components/script/dom/htmlcollection.rs')
-rw-r--r-- | components/script/dom/htmlcollection.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index 226c3d58d9f..88414aa6a84 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -30,8 +30,10 @@ pub enum CollectionTypeId { } #[dom_struct] +#[derive(HeapSizeOf)] pub struct HTMLCollection { reflector_: Reflector, + #[ignore_heap_size_of = "Contains a trait object; can't measure due to #6870"] collection: CollectionTypeId, } @@ -57,7 +59,7 @@ impl HTMLCollection { fn all_elements(window: &Window, root: &Node, namespace_filter: Option<Namespace>) -> Root<HTMLCollection> { - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] struct AllElementFilter { namespace_filter: Option<Namespace> } @@ -79,7 +81,7 @@ impl HTMLCollection { return HTMLCollection::all_elements(window, root, None); } - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] struct TagNameFilter { tag: Atom, ascii_lower_tag: Atom, @@ -110,7 +112,7 @@ impl HTMLCollection { if tag == "*" { return HTMLCollection::all_elements(window, root, namespace_filter); } - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] struct TagNameNSFilter { tag: Atom, namespace_filter: Option<Namespace> @@ -135,7 +137,7 @@ impl HTMLCollection { pub fn by_class_name(window: &Window, root: &Node, classes: DOMString) -> Root<HTMLCollection> { - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] struct ClassNameFilter { classes: Vec<Atom> } @@ -153,7 +155,7 @@ impl HTMLCollection { } pub fn children(window: &Window, root: &Node) -> Root<HTMLCollection> { - #[derive(JSTraceable)] + #[derive(JSTraceable, HeapSizeOf)] struct ElementChildFilter; impl CollectionFilter for ElementChildFilter { fn filter(&self, elem: &Element, root: &Node) -> bool { |