diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-05-08 23:40:15 +0200 |
---|---|---|
committer | Jack Moffitt <jack@metajack.im> | 2014-05-22 16:36:40 -0600 |
commit | eaedeb07cb0c4fdda37f35057588e4a769fbe758 (patch) | |
tree | cdeb134482f06818f7d6dbad8e008882fcc336a5 /src/components/script/dom/htmlcollection.rs | |
parent | 3644d0272c89336954358eb5005f884a9c89e8bc (diff) | |
download | servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.tar.gz servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.zip |
Update Rust.
Diffstat (limited to 'src/components/script/dom/htmlcollection.rs')
-rw-r--r-- | src/components/script/dom/htmlcollection.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index 82b0d54693f..f1cc1ef5aa5 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -18,7 +18,7 @@ pub trait CollectionFilter { fn filter(&self, elem: &JSRef<Element>, root: &JSRef<Node>) -> bool; } -impl<S: Encoder<E>, E> Encodable<S, E> for ~CollectionFilter { +impl<S: Encoder<E>, E> Encodable<S, E> for Box<CollectionFilter> { fn encode(&self, _s: &mut S) -> Result<(), E> { Ok(()) } @@ -27,7 +27,7 @@ impl<S: Encoder<E>, E> Encodable<S, E> for ~CollectionFilter { #[deriving(Encodable)] pub enum CollectionTypeId { Static(Vec<JS<Element>>), - Live(JS<Node>, ~CollectionFilter) + Live(JS<Node>, Box<CollectionFilter>) } #[deriving(Encodable)] @@ -47,13 +47,14 @@ impl HTMLCollection { } pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> { - reflect_dom_object(~HTMLCollection::new_inherited(window, collection), + reflect_dom_object(box HTMLCollection::new_inherited(window, collection), window, HTMLCollectionBinding::Wrap) } } impl HTMLCollection { - pub fn create(window: &JSRef<Window>, root: &JSRef<Node>, filter: ~CollectionFilter) -> Temporary<HTMLCollection> { + pub fn create(window: &JSRef<Window>, root: &JSRef<Node>, + filter: Box<CollectionFilter>) -> Temporary<HTMLCollection> { HTMLCollection::new(window, Live(root.unrooted(), filter)) } @@ -70,7 +71,7 @@ impl HTMLCollection { let filter = TagNameFilter { tag: tag }; - HTMLCollection::create(window, root, ~filter) + HTMLCollection::create(window, root, box filter) } pub fn by_tag_name_ns(window: &JSRef<Window>, root: &JSRef<Node>, tag: DOMString, @@ -88,7 +89,7 @@ impl HTMLCollection { tag: tag, namespace: namespace }; - HTMLCollection::create(window, root, ~filter) + HTMLCollection::create(window, root, box filter) } pub fn by_class_name(window: &JSRef<Window>, root: &JSRef<Node>, classes: DOMString) @@ -104,7 +105,7 @@ impl HTMLCollection { let filter = ClassNameFilter { classes: split_html_space_chars(classes).map(|class| class.into_owned()).collect() }; - HTMLCollection::create(window, root, ~filter) + HTMLCollection::create(window, root, box filter) } pub fn children(window: &JSRef<Window>, root: &JSRef<Node>) -> Temporary<HTMLCollection> { @@ -114,7 +115,7 @@ impl HTMLCollection { root.is_parent_of(NodeCast::from_ref(elem)) } } - HTMLCollection::create(window, root, ~ElementChildFilter) + HTMLCollection::create(window, root, box ElementChildFilter) } } |