diff options
author | Josh Matthews <josh@joshmatthews.net> | 2014-04-18 00:12:52 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2014-05-03 14:18:31 -0400 |
commit | 0f2d0b1dc3d98ef109627dda061c5a54ff06a91d (patch) | |
tree | a698b4eb0829079f09ad862c43a4eb1101c78e40 /src/components/script/dom/htmlcollection.rs | |
parent | 7b3e6d1f2125faf598919722b72cc56197d0102c (diff) | |
download | servo-0f2d0b1dc3d98ef109627dda061c5a54ff06a91d.tar.gz servo-0f2d0b1dc3d98ef109627dda061c5a54ff06a91d.zip |
Address review comments.
Diffstat (limited to 'src/components/script/dom/htmlcollection.rs')
-rw-r--r-- | src/components/script/dom/htmlcollection.rs | 12 |
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)) } } } |