aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmlcollection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/htmlcollection.rs')
-rw-r--r--src/components/script/dom/htmlcollection.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs
index 0047247ffad..6d0a0c78edf 100644
--- a/src/components/script/dom/htmlcollection.rs
+++ b/src/components/script/dom/htmlcollection.rs
@@ -38,16 +38,16 @@ pub struct HTMLCollection {
}
impl HTMLCollection {
- pub fn new_inherited(window: JS<Window>, collection: CollectionTypeId) -> HTMLCollection {
+ pub fn new_inherited(window: &JSRef<Window>, collection: CollectionTypeId) -> HTMLCollection {
HTMLCollection {
collection: collection,
reflector_: Reflector::new(),
- window: window,
+ window: window.unrooted(),
}
}
pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> {
- reflect_dom_object(~HTMLCollection::new_inherited(window.unrooted(), collection),
+ reflect_dom_object(~HTMLCollection::new_inherited(window, collection),
window, HTMLCollectionBinding::Wrap)
}
}
@@ -159,7 +159,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
})
.nth(index as uint)
.clone()
- .map(|elem| Temporary::new_rooted(&elem))
+ .map(|elem| Temporary::from_rooted(&elem))
}
}
}
@@ -179,7 +179,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
.find(|elem| {
elem.get_string_attribute("name") == key ||
elem.get_string_attribute("id") == key })
- .map(|maybe_elem| Temporary::new_rooted(&*maybe_elem)),
+ .map(|maybe_elem| Temporary::from_rooted(&*maybe_elem)),
Live(ref root, ref filter) => {
let root = root.root();
root.deref().traverse_preorder()
@@ -191,7 +191,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
.find(|elem| {
elem.get_string_attribute("name") == key ||
elem.get_string_attribute("id") == key })
- .map(|maybe_elem| Temporary::new_rooted(&maybe_elem))
+ .map(|maybe_elem| Temporary::from_rooted(&maybe_elem))
}
}
}