diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index bada5da4fe5..2438d745518 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -34,20 +34,18 @@ pub enum CollectionTypeId { pub struct HTMLCollection { collection: CollectionTypeId, reflector_: Reflector, - window: JS, } impl HTMLCollection { - pub fn new_inherited(window: &JSRef, collection: CollectionTypeId) -> HTMLCollection { + pub fn new_inherited(collection: CollectionTypeId) -> HTMLCollection { HTMLCollection { collection: collection, reflector_: Reflector::new(), - window: JS::from_rooted(window), } } pub fn new(window: &JSRef, collection: CollectionTypeId) -> Temporary { - reflect_dom_object(box HTMLCollection::new_inherited(window, collection), + reflect_dom_object(box HTMLCollection::new_inherited(collection), window, HTMLCollectionBinding::Wrap) } } diff --git a/src/components/script/dom/nodelist.rs b/src/components/script/dom/nodelist.rs index fd83bf458e6..b3fbd578fe6 100644 --- a/src/components/script/dom/nodelist.rs +++ b/src/components/script/dom/nodelist.rs @@ -18,22 +18,19 @@ pub enum NodeListType { pub struct NodeList { list_type: NodeListType, reflector_: Reflector, - window: JS } impl NodeList { - pub fn new_inherited(window: &JSRef, - list_type: NodeListType) -> NodeList { + pub fn new_inherited(list_type: NodeListType) -> NodeList { NodeList { list_type: list_type, reflector_: Reflector::new(), - window: JS::from_rooted(window) } } pub fn new(window: &JSRef, list_type: NodeListType) -> Temporary { - reflect_dom_object(box NodeList::new_inherited(window, list_type), + reflect_dom_object(box NodeList::new_inherited(list_type), window, NodeListBinding::Wrap) }