aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/documentfragment.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2014-03-31 18:41:28 -0400
committerJosh Matthews <josh@joshmatthews.net>2014-05-03 14:18:30 -0400
commitd7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1 (patch)
treeefd1e7f7ec1dd30467c2a67306e1a639837abead /src/components/script/dom/documentfragment.rs
parentffdc3f5b32a345b88eed774848924e862d47c093 (diff)
downloadservo-d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1.tar.gz
servo-d7b96db33ca8f2b8a162df38e0f00e95f5ea6fa1.zip
Implement safe rooting strategy via Unrooted, Root, JSRef, and JS.
Diffstat (limited to 'src/components/script/dom/documentfragment.rs')
-rw-r--r--src/components/script/dom/documentfragment.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/script/dom/documentfragment.rs b/src/components/script/dom/documentfragment.rs
index e10e9e1204c..629b68ffdec 100644
--- a/src/components/script/dom/documentfragment.rs
+++ b/src/components/script/dom/documentfragment.rs
@@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::{DocumentFragmentDerived, NodeCast};
use dom::bindings::codegen::BindingDeclarations::DocumentFragmentBinding;
-use dom::bindings::js::{JS, JSRef, RootCollection};
+use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted};
use dom::bindings::error::Fallible;
use dom::document::Document;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@@ -34,14 +34,14 @@ impl DocumentFragment {
}
}
- pub fn new(document: &JSRef<Document>) -> JS<DocumentFragment> {
+ pub fn new(document: &JSRef<Document>) -> Unrooted<DocumentFragment> {
let node = DocumentFragment::new_inherited(document.unrooted());
Node::reflect_node(~node, document, DocumentFragmentBinding::Wrap)
}
}
impl DocumentFragment {
- pub fn Constructor(owner: &JSRef<Window>) -> Fallible<JS<DocumentFragment>> {
+ pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Unrooted<DocumentFragment>> {
let roots = RootCollection::new();
let document = owner.get().Document();
let document = document.root(&roots);
@@ -51,9 +51,9 @@ impl DocumentFragment {
}
impl DocumentFragment {
- pub fn Children(&self, abstract_self: &JSRef<DocumentFragment>) -> JS<HTMLCollection> {
+ pub fn Children(&self, abstract_self: &JSRef<DocumentFragment>) -> Unrooted<HTMLCollection> {
let roots = RootCollection::new();
- let window = window_from_node(&abstract_self.unrooted()).root(&roots);
+ let window = window_from_node(abstract_self).root(&roots);
HTMLCollection::children(&window.root_ref(), NodeCast::from_ref(abstract_self))
}
}