aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/attrlist.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-04-10 17:11:08 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:30 -0400
commitdfdda0098a3f169a37c100b36d4dd36ec1d815aa (patch)
treeb4835f3c863c6e45849cf036faf5611925e10189 /src/components/script/dom/attrlist.rs
parentd7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1 (diff)
downloadservo-dfdda0098a3f169a37c100b36d4dd36ec1d815aa.tar.gz
servo-dfdda0098a3f169a37c100b36d4dd36ec1d815aa.zip
Remove JS::get/get_mut to enforce sound rooting practices.
Diffstat (limited to 'src/components/script/dom/attrlist.rs')
-rw-r--r--src/components/script/dom/attrlist.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/script/dom/attrlist.rs b/src/components/script/dom/attrlist.rs
index 78f8211e3e0..273378347f0 100644
--- a/src/components/script/dom/attrlist.rs
+++ b/src/components/script/dom/attrlist.rs
@@ -4,7 +4,7 @@
use dom::attr::Attr;
use dom::bindings::codegen::BindingDeclarations::AttrListBinding;
-use dom::bindings::js::{JS, JSRef, Unrooted};
+use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::element::Element;
use dom::window::Window;
@@ -31,11 +31,13 @@ impl AttrList {
}
pub fn Length(&self) -> u32 {
- self.owner.get().attrs.len() as u32
+ let roots = RootCollection::new();
+ self.owner.root(&roots).attrs.len() as u32
}
pub fn Item(&self, index: u32) -> Option<Unrooted<Attr>> {
- self.owner.get().attrs.as_slice().get(index as uint).map(|x| Unrooted::new(x.clone()))
+ let roots = RootCollection::new();
+ self.owner.root(&roots).attrs.as_slice().get(index as uint).map(|x| Unrooted::new(x.clone()))
}
pub fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Unrooted<Attr>> {