diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-04-26 11:04:06 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-04-28 23:06:25 +0200 |
commit | cc23a324e5eb4c7a7182c7c8bbe3126bec7977b8 (patch) | |
tree | f4031faaace4c22ce049d1e88f45155539933d63 /src/components/script/dom | |
parent | 251e22266e1bccb2a12ece85e42c76db9dd11b61 (diff) | |
download | servo-cc23a324e5eb4c7a7182c7c8bbe3126bec7977b8.tar.gz servo-cc23a324e5eb4c7a7182c7c8bbe3126bec7977b8.zip |
Make static HTMLCollections use Vec.
Diffstat (limited to 'src/components/script/dom')
-rw-r--r-- | src/components/script/dom/htmlcollection.rs | 3 | ||||
-rw-r--r-- | src/components/script/dom/htmlformelement.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/htmlmapelement.rs | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index 70a94b04f43..5d5f7de0ae0 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -26,7 +26,7 @@ impl<S: Encoder<E>, E> Encodable<S, E> for ~CollectionFilter { #[deriving(Encodable)] pub enum CollectionTypeId { - Static(~[JS<Element>]), + Static(Vec<JS<Element>>), Live(JS<Node>, ~CollectionFilter) } @@ -135,6 +135,7 @@ impl HTMLCollection { pub fn Item(&self, index: u32) -> Option<JS<Element>> { match self.collection { Static(ref elems) => elems + .as_slice() .get(index as uint) .map(|elem| elem.clone()), Live(ref root, ref filter) => root.traverse_preorder() diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index c054d9232d9..bc04beabdb4 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.rs @@ -118,7 +118,7 @@ impl HTMLFormElement { // FIXME: https://github.com/mozilla/servo/issues/1844 let doc = self.htmlelement.element.node.owner_doc(); let doc = doc.get(); - HTMLCollection::new(&doc.window, Static(~[])) + HTMLCollection::new(&doc.window, Static(vec!())) } pub fn Length(&self) -> i32 { diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 8f853386473..24bab61040e 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.rs @@ -54,6 +54,6 @@ impl HTMLMapElement { // FIXME: https://github.com/mozilla/servo/issues/1845 let doc = self.htmlelement.element.node.owner_doc(); let doc = doc.get(); - HTMLCollection::new(&doc.window, Static(~[])) + HTMLCollection::new(&doc.window, Static(vec!())) } } |