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, E> Encodable for ~CollectionFilter {
#[deriving(Encodable)]
pub enum CollectionTypeId {
- Static(~[JS]),
+ Static(Vec>),
Live(JS, ~CollectionFilter)
}
@@ -135,6 +135,7 @@ impl HTMLCollection {
pub fn Item(&self, index: u32) -> Option> {
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!()))
}
}