From 522d3f167b12fa79401eea5525c7b6133cae0f06 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 17 Apr 2014 17:08:00 -0400 Subject: [PATCH] s/Unrooted/Temporary/g --- src/components/script/dom/attr.rs | 4 +- src/components/script/dom/attrlist.rs | 14 +- .../dom/bindings/codegen/CodegenRust.py | 6 +- .../dom/bindings/codegen/Configuration.py | 2 +- src/components/script/dom/bindings/js.rs | 44 ++--- src/components/script/dom/bindings/utils.rs | 8 +- src/components/script/dom/blob.rs | 10 +- src/components/script/dom/browsercontext.rs | 10 +- src/components/script/dom/clientrect.rs | 4 +- src/components/script/dom/clientrectlist.rs | 14 +- src/components/script/dom/comment.rs | 6 +- src/components/script/dom/console.rs | 4 +- src/components/script/dom/document.rs | 150 +++++++++--------- src/components/script/dom/documentfragment.rs | 10 +- src/components/script/dom/documenttype.rs | 4 +- src/components/script/dom/domexception.rs | 4 +- .../script/dom/domimplementation.rs | 20 +-- src/components/script/dom/domparser.rs | 10 +- src/components/script/dom/element.rs | 44 ++--- src/components/script/dom/event.rs | 20 +-- src/components/script/dom/formdata.rs | 6 +- .../script/dom/htmlanchorelement.rs | 4 +- .../script/dom/htmlappletelement.rs | 4 +- src/components/script/dom/htmlareaelement.rs | 4 +- src/components/script/dom/htmlaudioelement.rs | 4 +- src/components/script/dom/htmlbaseelement.rs | 4 +- src/components/script/dom/htmlbodyelement.rs | 4 +- src/components/script/dom/htmlbrelement.rs | 4 +- .../script/dom/htmlbuttonelement.rs | 12 +- .../script/dom/htmlcanvaselement.rs | 4 +- src/components/script/dom/htmlcollection.rs | 38 ++--- src/components/script/dom/htmldataelement.rs | 4 +- .../script/dom/htmldatalistelement.rs | 8 +- .../script/dom/htmldirectoryelement.rs | 4 +- src/components/script/dom/htmldivelement.rs | 4 +- src/components/script/dom/htmldlistelement.rs | 4 +- src/components/script/dom/htmlelement.rs | 8 +- src/components/script/dom/htmlembedelement.rs | 8 +- .../script/dom/htmlfieldsetelement.rs | 16 +- src/components/script/dom/htmlfontelement.rs | 4 +- src/components/script/dom/htmlformelement.rs | 12 +- src/components/script/dom/htmlframeelement.rs | 12 +- .../script/dom/htmlframesetelement.rs | 4 +- src/components/script/dom/htmlheadelement.rs | 4 +- .../script/dom/htmlheadingelement.rs | 4 +- src/components/script/dom/htmlhrelement.rs | 4 +- src/components/script/dom/htmlhtmlelement.rs | 4 +- .../script/dom/htmliframeelement.rs | 16 +- src/components/script/dom/htmlimageelement.rs | 4 +- src/components/script/dom/htmlinputelement.rs | 4 +- src/components/script/dom/htmllabelelement.rs | 4 +- .../script/dom/htmllegendelement.rs | 4 +- src/components/script/dom/htmllielement.rs | 4 +- src/components/script/dom/htmllinkelement.rs | 4 +- src/components/script/dom/htmlmainelement.rs | 4 +- src/components/script/dom/htmlmapelement.rs | 8 +- src/components/script/dom/htmlmetaelement.rs | 4 +- src/components/script/dom/htmlmeterelement.rs | 4 +- src/components/script/dom/htmlmodelement.rs | 4 +- .../script/dom/htmlobjectelement.rs | 24 +-- src/components/script/dom/htmlolistelement.rs | 4 +- .../script/dom/htmloptgroupelement.rs | 4 +- .../script/dom/htmloptionelement.rs | 8 +- .../script/dom/htmloutputelement.rs | 12 +- .../script/dom/htmlparagraphelement.rs | 4 +- src/components/script/dom/htmlparamelement.rs | 4 +- src/components/script/dom/htmlpreelement.rs | 4 +- .../script/dom/htmlprogresselement.rs | 4 +- src/components/script/dom/htmlquoteelement.rs | 4 +- .../script/dom/htmlscriptelement.rs | 4 +- .../script/dom/htmlselectelement.rs | 24 +-- .../script/dom/htmlsourceelement.rs | 4 +- src/components/script/dom/htmlspanelement.rs | 4 +- src/components/script/dom/htmlstyleelement.rs | 4 +- .../script/dom/htmltablecaptionelement.rs | 4 +- .../script/dom/htmltablecolelement.rs | 4 +- .../script/dom/htmltabledatacellelement.rs | 4 +- src/components/script/dom/htmltableelement.rs | 4 +- .../script/dom/htmltableheadercellelement.rs | 4 +- .../script/dom/htmltablerowelement.rs | 4 +- .../script/dom/htmltablesectionelement.rs | 4 +- .../script/dom/htmltemplateelement.rs | 4 +- .../script/dom/htmltextareaelement.rs | 4 +- src/components/script/dom/htmltimeelement.rs | 4 +- src/components/script/dom/htmltitleelement.rs | 4 +- src/components/script/dom/htmltrackelement.rs | 4 +- src/components/script/dom/htmlulistelement.rs | 4 +- .../script/dom/htmlunknownelement.rs | 4 +- src/components/script/dom/htmlvideoelement.rs | 4 +- src/components/script/dom/location.rs | 4 +- src/components/script/dom/mouseevent.rs | 14 +- src/components/script/dom/navigator.rs | 4 +- src/components/script/dom/node.rs | 144 ++++++++--------- src/components/script/dom/nodelist.rs | 20 +-- .../script/dom/processinginstruction.rs | 4 +- src/components/script/dom/testbinding.rs | 10 +- src/components/script/dom/text.rs | 10 +- src/components/script/dom/uievent.rs | 18 +-- src/components/script/dom/validitystate.rs | 4 +- src/components/script/dom/window.rs | 44 ++--- src/components/script/dom/xmlhttprequest.rs | 18 +-- .../script/dom/xmlhttprequestupload.rs | 4 +- .../script/html/hubbub_html_parser.rs | 8 +- src/components/script/script_task.rs | 8 +- 104 files changed, 565 insertions(+), 565 deletions(-) diff --git a/src/components/script/dom/attr.rs b/src/components/script/dom/attr.rs index 5c37ca45632..fe4ea856cff 100644 --- a/src/components/script/dom/attr.rs +++ b/src/components/script/dom/attr.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::AttrBinding; use dom::bindings::codegen::InheritTypes::NodeCast; -use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::element::Element; use dom::node::Node; @@ -59,7 +59,7 @@ impl Attr { pub fn new(window: &JSRef, local_name: DOMString, value: DOMString, name: DOMString, namespace: Namespace, - prefix: Option, owner: &JSRef) -> Unrooted { + prefix: Option, owner: &JSRef) -> Temporary { let attr = Attr::new_inherited(local_name, value, name, namespace, prefix, owner); reflect_dom_object(~attr, window, AttrBinding::Wrap) } diff --git a/src/components/script/dom/attrlist.rs b/src/components/script/dom/attrlist.rs index eca2deade79..7bc7f18bdfa 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, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::element::Element; use dom::window::Window; @@ -25,7 +25,7 @@ impl AttrList { } } - pub fn new(window: &JSRef, elem: &JSRef) -> Unrooted { + pub fn new(window: &JSRef, elem: &JSRef) -> Temporary { reflect_dom_object(~AttrList::new_inherited(window.unrooted(), elem.unrooted()), window, AttrListBinding::Wrap) } @@ -33,8 +33,8 @@ impl AttrList { pub trait AttrListMethods { fn Length(&self) -> u32; - fn Item(&self, index: u32) -> Option>; - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; + fn Item(&self, index: u32) -> Option>; + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; } impl<'a> AttrListMethods for JSRef<'a, AttrList> { @@ -43,12 +43,12 @@ impl<'a> AttrListMethods for JSRef<'a, AttrList> { self.owner.root(&roots).attrs.len() as u32 } - fn Item(&self, index: u32) -> Option> { + fn Item(&self, index: u32) -> Option> { let roots = RootCollection::new(); - self.owner.root(&roots).attrs.as_slice().get(index as uint).map(|x| Unrooted::new(x.clone())) + self.owner.root(&roots).attrs.as_slice().get(index as uint).map(|x| Temporary::new(x.clone())) } - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { let item = self.Item(index); *found = item.is_some(); item diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index f73de0ea365..b7df283d2b8 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -4323,7 +4323,7 @@ class CGBindingRoot(CGThing): 'js::glue::{RUST_JS_NumberValue, RUST_JSID_IS_STRING}', 'dom::types::*', 'dom::bindings', - 'dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Unrooted, OptionalRootable}', + 'dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Temporary, OptionalRootable}', 'dom::bindings::utils::{CreateDOMGlobal, CreateInterfaceObjects2}', 'dom::bindings::utils::{ConstantSpec, cx_for_dom_object, Default}', 'dom::bindings::utils::{dom_object_slot, DOM_OBJECT_SLOT, DOMClass}', @@ -5294,7 +5294,7 @@ class GlobalGenRoots(): descriptors = config.getDescriptors(register=True, hasInterfaceObject=True) allprotos = [CGGeneric("#![allow(unused_imports)]\n"), CGGeneric("use dom::types::*;\n"), - CGGeneric("use dom::bindings::js::{JS, JSRef, Unrooted};\n"), + CGGeneric("use dom::bindings::js::{JS, JSRef, Temporary};\n"), CGGeneric("use dom::bindings::trace::JSTraceable;\n"), CGGeneric("use dom::bindings::utils::Reflectable;\n"), CGGeneric("use serialize::{Encodable, Encoder};\n"), @@ -5349,7 +5349,7 @@ class GlobalGenRoots(): } #[inline(always)] - fn from_unrooted(derived: Unrooted) -> Unrooted { + fn from_unrooted(derived: Temporary) -> Temporary { unsafe { derived.transmute() } } } diff --git a/src/components/script/dom/bindings/codegen/Configuration.py b/src/components/script/dom/bindings/codegen/Configuration.py index 48570a05476..0ff1754a562 100644 --- a/src/components/script/dom/bindings/codegen/Configuration.py +++ b/src/components/script/dom/bindings/codegen/Configuration.py @@ -133,7 +133,7 @@ class Descriptor(DescriptorProvider): else: nativeTypeDefault = 'JS<%s>' % ifaceName - self.returnType = "Unrooted<%s>" % ifaceName + self.returnType = "Temporary<%s>" % ifaceName self.nativeType = desc.get('nativeType', nativeTypeDefault) self.concreteType = desc.get('concreteType', ifaceName) self.createGlobal = desc.get('createGlobal', False) diff --git a/src/components/script/dom/bindings/js.rs b/src/components/script/dom/bindings/js.rs index b26d2601139..031987181c2 100644 --- a/src/components/script/dom/bindings/js.rs +++ b/src/components/script/dom/bindings/js.rs @@ -14,27 +14,27 @@ use std::cell::RefCell; /// Importantly, it requires rooting in order to interact with the value in any way. /// Can be assigned into JS-owned member fields (ie. JS types) safely via the /// `JS::assign` method or `OptionalAssignable::assign` (for Option> fields). -pub struct Unrooted { +pub struct Temporary { inner: JS } -impl Eq for Unrooted { - fn eq(&self, other: &Unrooted) -> bool { +impl Eq for Temporary { + fn eq(&self, other: &Temporary) -> bool { self.inner == other.inner } } -impl Unrooted { - /// Create a new Unrooted value from a JS-owned value. - pub fn new(inner: JS) -> Unrooted { - Unrooted { +impl Temporary { + /// Create a new Temporary value from a JS-owned value. + pub fn new(inner: JS) -> Temporary { + Temporary { inner: inner } } - /// Create a new Unrooted value from a rooted value. - pub fn new_rooted<'a>(root: &JSRef<'a, T>) -> Unrooted { - Unrooted { + /// Create a new Temporary value from a rooted value. + pub fn new_rooted<'a>(root: &JSRef<'a, T>) -> Temporary { + Temporary { inner: root.unrooted() } } @@ -49,7 +49,7 @@ impl Unrooted { } //XXXjdm It would be lovely if this could be private. - pub unsafe fn transmute(self) -> Unrooted { + pub unsafe fn transmute(self) -> Temporary { cast::transmute(self) } } @@ -75,12 +75,12 @@ impl Clone for JS { } impl JS { - /// Create a new JS-reflected DOM object; returns an Unrooted type because the new value + /// Create a new JS-reflected DOM object; returns an Temporary type because the new value /// is not safe to use until it is rooted. pub fn new(obj: ~T, window: &JSRef, - wrap_fn: extern "Rust" fn(*JSContext, &JSRef, ~T) -> JS) -> Unrooted { - Unrooted::new(wrap_fn(window.get().get_cx(), window, obj)) + wrap_fn: extern "Rust" fn(*JSContext, &JSRef, ~T) -> JS) -> Temporary { + Temporary::new(wrap_fn(window.get().get_cx(), window, obj)) } /// Create a new JS-owned value wrapped from a raw Rust pointer. @@ -132,7 +132,7 @@ impl JS { /// Store an unrooted value in this field. This is safe under the assumption that JS /// values are only used as fields in DOM types that are reachable in the GC graph, /// so this unrooted value becomes transitively rooted for the lifetime of its new owner. - pub fn assign(&mut self, val: Unrooted) { + pub fn assign(&mut self, val: Temporary) { *self = unsafe { val.inner() }; } } @@ -178,7 +178,7 @@ impl<'a, T> Assignable for JSRef<'a, T> { // Assignable should not be exposed publically, since it's used to // extract unrooted values in a safe way WHEN USED CORRECTLY. -impl Assignable for Unrooted { +impl Assignable for Temporary { fn get_js(&self) -> JS { unsafe { self.inner() } } @@ -198,7 +198,7 @@ pub trait OptionalRootable { fn root<'a, 'b>(self, roots: &'a RootCollection) -> Option>; } -impl OptionalRootable for Option> { +impl OptionalRootable for Option> { fn root<'a, 'b>(self, roots: &'a RootCollection) -> Option> { self.map(|inner| inner.root(roots)) } @@ -218,7 +218,7 @@ pub trait ResultRootable { fn root<'a, 'b>(self, roots: &'a RootCollection) -> Result, U>; } -impl ResultRootable for Result, U> { +impl ResultRootable for Result, U> { fn root<'a, 'b>(self, roots: &'a RootCollection) -> Result, U> { self.map(|inner| inner.root(roots)) } @@ -227,12 +227,12 @@ impl ResultRootable for Result, U> { /// Provides a facility to push unrooted values onto lists of rooted values. This is safe /// under the assumption that said lists are reachable via the GC graph, and therefore the /// new values are transitively rooted for the lifetime of their new owner. -pub trait UnrootedPushable { - fn push_unrooted(&mut self, val: Unrooted); +pub trait TemporaryPushable { + fn push_unrooted(&mut self, val: Temporary); } -impl UnrootedPushable for Vec> { - fn push_unrooted(&mut self, val: Unrooted) { +impl TemporaryPushable for Vec> { + fn push_unrooted(&mut self, val: Temporary) { unsafe { self.push(val.inner()) }; } } diff --git a/src/components/script/dom/bindings/utils.rs b/src/components/script/dom/bindings/utils.rs index 65725b9d923..cbccb90197a 100644 --- a/src/components/script/dom/bindings/utils.rs +++ b/src/components/script/dom/bindings/utils.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::PrototypeList; use dom::bindings::codegen::PrototypeList::MAX_PROTO_CHAIN_LENGTH; use dom::bindings::conversions::{FromJSValConvertible, IDLInterface}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, Root}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, Root}; use dom::bindings::trace::Untraceable; use dom::browsercontext; use dom::window; @@ -391,7 +391,7 @@ pub fn reflect_dom_object (obj: ~T, window: &JSRef, wrap_fn: extern "Rust" fn(*JSContext, &JSRef, ~T) -> JS) - -> Unrooted { + -> Temporary { JS::new(obj, window, wrap_fn) } @@ -616,12 +616,12 @@ pub extern fn outerize_global(_cx: *JSContext, obj: JSHandleObject) -> *JSObject } /// Returns the global object of the realm that the given JS object was created in. -pub fn global_object_for_js_object(obj: *JSObject) -> Unrooted { +pub fn global_object_for_js_object(obj: *JSObject) -> Temporary { unsafe { let global = GetGlobalForObjectCrossCompartment(obj); let clasp = JS_GetClass(global); assert!(((*clasp).flags & (JSCLASS_IS_DOMJSCLASS | JSCLASS_IS_GLOBAL)) != 0); - Unrooted::new( + Temporary::new( FromJSValConvertible::from_jsval(ptr::null(), ObjectOrNullValue(global), ()) .ok().expect("found DOM global that doesn't unwrap to Window")) } diff --git a/src/components/script/dom/blob.rs b/src/components/script/dom/blob.rs index a40715f00f2..10cc93ef089 100644 --- a/src/components/script/dom/blob.rs +++ b/src/components/script/dom/blob.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::Fallible; use dom::bindings::codegen::BindingDeclarations::BlobBinding; @@ -23,13 +23,13 @@ impl Blob { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~Blob::new_inherited(window.unrooted()), window, BlobBinding::Wrap) } - pub fn Constructor(window: &JSRef) -> Fallible> { + pub fn Constructor(window: &JSRef) -> Fallible> { Ok(Blob::new(window)) } } @@ -37,7 +37,7 @@ impl Blob { pub trait BlobMethods { fn Size(&self) -> u64; fn Type(&self) -> DOMString; - fn Slice(&self, _start: Option, _end: Option, _contentType: Option) -> Unrooted; + fn Slice(&self, _start: Option, _end: Option, _contentType: Option) -> Temporary; fn Close(&self); } @@ -50,7 +50,7 @@ impl<'a> BlobMethods for JSRef<'a, Blob> { ~"" } - fn Slice(&self, _start: Option, _end: Option, _contentType: Option) -> Unrooted { + fn Slice(&self, _start: Option, _end: Option, _contentType: Option) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); Blob::new(&window.root_ref()) diff --git a/src/components/script/dom/browsercontext.rs b/src/components/script/dom/browsercontext.rs index 4a452ccd2ae..5b0be5ccf0c 100644 --- a/src/components/script/dom/browsercontext.rs +++ b/src/components/script/dom/browsercontext.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::trace::Traceable; use dom::bindings::utils::Reflectable; use dom::document::Document; @@ -32,14 +32,14 @@ impl BrowserContext { context } - pub fn active_document(&self) -> Unrooted { - Unrooted::new(self.history.get(self.active_index).document.clone()) + pub fn active_document(&self) -> Temporary { + Temporary::new(self.history.get(self.active_index).document.clone()) } - pub fn active_window(&self) -> Unrooted { + pub fn active_window(&self) -> Temporary { let roots = RootCollection::new(); let doc = self.active_document().root(&roots); - Unrooted::new(doc.deref().window.clone()) + Temporary::new(doc.deref().window.clone()) } pub fn window_proxy(&self) -> *JSObject { diff --git a/src/components/script/dom/clientrect.rs b/src/components/script/dom/clientrect.rs index 8f07c6b8175..ad48fe15d86 100644 --- a/src/components/script/dom/clientrect.rs +++ b/src/components/script/dom/clientrect.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::ClientRectBinding; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::window::Window; use servo_util::geometry::Au; @@ -34,7 +34,7 @@ impl ClientRect { pub fn new(window: &JSRef, top: Au, bottom: Au, - left: Au, right: Au) -> Unrooted { + left: Au, right: Au) -> Temporary { let rect = ClientRect::new_inherited(window.unrooted(), top, bottom, left, right); reflect_dom_object(~rect, window, ClientRectBinding::Wrap) } diff --git a/src/components/script/dom/clientrectlist.rs b/src/components/script/dom/clientrectlist.rs index 30cbb1043e3..2a7c609c958 100644 --- a/src/components/script/dom/clientrectlist.rs +++ b/src/components/script/dom/clientrectlist.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::ClientRectListBinding; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::clientrect::ClientRect; use dom::window::Window; @@ -26,7 +26,7 @@ impl ClientRectList { } pub fn new(window: &JSRef, - rects: Vec>) -> Unrooted { + rects: Vec>) -> Temporary { reflect_dom_object(~ClientRectList::new_inherited(window.unrooted(), rects), window, ClientRectListBinding::Wrap) } @@ -34,8 +34,8 @@ impl ClientRectList { pub trait ClientRectListMethods { fn Length(&self) -> u32; - fn Item(&self, index: u32) -> Option>; - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; + fn Item(&self, index: u32) -> Option>; + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; } impl<'a> ClientRectListMethods for JSRef<'a, ClientRectList> { @@ -43,15 +43,15 @@ impl<'a> ClientRectListMethods for JSRef<'a, ClientRectList> { self.rects.len() as u32 } - fn Item(&self, index: u32) -> Option> { + fn Item(&self, index: u32) -> Option> { if index < self.rects.len() as u32 { - Some(Unrooted::new(self.rects.get(index as uint).clone())) + Some(Temporary::new(self.rects.get(index as uint).clone())) } else { None } } - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { *found = index < self.rects.len() as u32; self.Item(index) } diff --git a/src/components/script/dom/comment.rs b/src/components/script/dom/comment.rs index 0814cb7b25c..33bb395488c 100644 --- a/src/components/script/dom/comment.rs +++ b/src/components/script/dom/comment.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::InheritTypes::CommentDerived; use dom::bindings::codegen::BindingDeclarations::CommentBinding; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::Fallible; use dom::characterdata::CharacterData; use dom::document::Document; @@ -35,12 +35,12 @@ impl Comment { } } - pub fn new(text: DOMString, document: &JSRef) -> Unrooted { + pub fn new(text: DOMString, document: &JSRef) -> Temporary { let node = Comment::new_inherited(text, document.unrooted()); Node::reflect_node(~node, document, CommentBinding::Wrap) } - pub fn Constructor(owner: &JSRef, data: DOMString) -> Fallible> { + pub fn Constructor(owner: &JSRef, data: DOMString) -> Fallible> { let roots = RootCollection::new(); let document = owner.Document().root(&roots); Ok(Comment::new(data, &*document)) diff --git a/src/components/script/dom/console.rs b/src/components/script/dom/console.rs index ce919980f26..a9c60962359 100644 --- a/src/components/script/dom/console.rs +++ b/src/components/script/dom/console.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::ConsoleBinding; -use dom::bindings::js::{JSRef, Unrooted}; +use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::window::Window; use servo_util::str::DOMString; @@ -20,7 +20,7 @@ impl Console { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~Console::new_inherited(), window, ConsoleBinding::Wrap) } } diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index 24c1d6eae89..09a2a2c2ffa 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -6,7 +6,7 @@ use dom::bindings::codegen::InheritTypes::{DocumentDerived, EventCast, HTMLEleme use dom::bindings::codegen::InheritTypes::{HTMLHeadElementCast, TextCast, ElementCast}; use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast}; use dom::bindings::codegen::BindingDeclarations::DocumentBinding; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, OptionalAssignable}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalAssignable}; use dom::bindings::js::OptionalRootable; use dom::bindings::trace::Untraceable; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; @@ -187,7 +187,7 @@ impl Document { pub fn reflect_document(document: ~Document, window: &JSRef, wrap_fn: extern "Rust" fn(*JSContext, &JSRef, ~Document) -> JS) - -> Unrooted { + -> Temporary { let roots = RootCollection::new(); assert!(document.reflector().get_jsobject().is_null()); let mut raw_doc = reflect_dom_object(document, window, wrap_fn).root(&roots); @@ -196,7 +196,7 @@ impl Document { let mut doc_alias = raw_doc.clone(); let node: &mut JSRef = NodeCast::from_mut_ref(&mut doc_alias); node.set_owner_doc(&*raw_doc); - Unrooted::new_rooted(&*raw_doc) + Temporary::new_rooted(&*raw_doc) } pub fn new_inherited(window: JS, @@ -230,11 +230,11 @@ impl Document { } // http://dom.spec.whatwg.org/#dom-document - pub fn Constructor(owner: &JSRef) -> Fallible> { + pub fn Constructor(owner: &JSRef) -> Fallible> { Ok(Document::new(owner, None, NonHTMLDocument, None)) } - pub fn new(window: &JSRef, url: Option, doctype: IsHTMLDocument, content_type: Option) -> Unrooted { + pub fn new(window: &JSRef, url: Option, doctype: IsHTMLDocument, content_type: Option) -> Temporary { let document = Document::new_inherited(window.unrooted(), url, doctype, content_type); Document::reflect_document(~document, window, DocumentBinding::Wrap) } @@ -251,12 +251,12 @@ impl Reflectable for Document { } trait PrivateDocumentHelpers { - fn createNodeList(&self, callback: |node: &JSRef| -> bool) -> Unrooted; - fn get_html_element(&self) -> Option>; + fn createNodeList(&self, callback: |node: &JSRef| -> bool) -> Temporary; + fn get_html_element(&self) -> Option>; } impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> { - fn createNodeList(&self, callback: |node: &JSRef| -> bool) -> Unrooted { + fn createNodeList(&self, callback: |node: &JSRef| -> bool) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -276,65 +276,65 @@ impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> { NodeList::new_simple_list(&*window, nodes) } - fn get_html_element(&self) -> Option> { + fn get_html_element(&self) -> Option> { let roots = RootCollection::new(); self.GetDocumentElement().root(&roots).filtered(|root| { root.node.type_id == ElementNodeTypeId(HTMLHtmlElementTypeId) }).map(|elem| { - Unrooted::new_rooted(HTMLHtmlElementCast::to_ref(&*elem).unwrap()) + Temporary::new_rooted(HTMLHtmlElementCast::to_ref(&*elem).unwrap()) }) } } pub trait DocumentMethods { - fn Implementation(&mut self) -> Unrooted; + fn Implementation(&mut self) -> Temporary; fn URL(&self) -> DOMString; fn DocumentURI(&self) -> DOMString; fn CompatMode(&self) -> DOMString; fn CharacterSet(&self) -> DOMString; fn ContentType(&self) -> DOMString; - fn GetDoctype(&self) -> Option>; - fn GetDocumentElement(&self) -> Option>; - fn GetElementsByTagName(&self, tag_name: DOMString) -> Unrooted; - fn GetElementsByTagNameNS(&self, maybe_ns: Option, tag_name: DOMString) -> Unrooted; - fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted; - fn GetElementById(&self, id: DOMString) -> Option>; - fn CreateElement(&self, local_name: DOMString) -> Fallible>; - fn CreateElementNS(&self, namespace: Option, qualified_name: DOMString) -> Fallible>; - fn CreateDocumentFragment(&self) -> Unrooted; - fn CreateTextNode(&self, data: DOMString) -> Unrooted; - fn CreateComment(&self, data: DOMString) -> Unrooted; - fn CreateProcessingInstruction(&self, target: DOMString, data: DOMString) -> Fallible>; - fn ImportNode(&self, node: &JSRef, deep: bool) -> Fallible>; - fn AdoptNode(&self, node: &mut JSRef) -> Fallible>; - fn CreateEvent(&self, interface: DOMString) -> Fallible>; + fn GetDoctype(&self) -> Option>; + fn GetDocumentElement(&self) -> Option>; + fn GetElementsByTagName(&self, tag_name: DOMString) -> Temporary; + fn GetElementsByTagNameNS(&self, maybe_ns: Option, tag_name: DOMString) -> Temporary; + fn GetElementsByClassName(&self, classes: DOMString) -> Temporary; + fn GetElementById(&self, id: DOMString) -> Option>; + fn CreateElement(&self, local_name: DOMString) -> Fallible>; + fn CreateElementNS(&self, namespace: Option, qualified_name: DOMString) -> Fallible>; + fn CreateDocumentFragment(&self) -> Temporary; + fn CreateTextNode(&self, data: DOMString) -> Temporary; + fn CreateComment(&self, data: DOMString) -> Temporary; + fn CreateProcessingInstruction(&self, target: DOMString, data: DOMString) -> Fallible>; + fn ImportNode(&self, node: &JSRef, deep: bool) -> Fallible>; + fn AdoptNode(&self, node: &mut JSRef) -> Fallible>; + fn CreateEvent(&self, interface: DOMString) -> Fallible>; fn Title(&self) -> DOMString; fn SetTitle(&self, title: DOMString) -> ErrorResult; - fn GetHead(&self) -> Option>; - fn GetBody(&self) -> Option>; + fn GetHead(&self) -> Option>; + fn GetBody(&self) -> Option>; fn SetBody(&self, new_body: Option>) -> ErrorResult; - fn GetElementsByName(&self, name: DOMString) -> Unrooted; - fn Images(&self) -> Unrooted; - fn Embeds(&self) -> Unrooted; - fn Plugins(&self) -> Unrooted; - fn Links(&self) -> Unrooted; - fn Forms(&self) -> Unrooted; - fn Scripts(&self) -> Unrooted; - fn Anchors(&self) -> Unrooted; - fn Applets(&self) -> Unrooted; - fn Location(&mut self) -> Unrooted; - fn Children(&self) -> Unrooted; + fn GetElementsByName(&self, name: DOMString) -> Temporary; + fn Images(&self) -> Temporary; + fn Embeds(&self) -> Temporary; + fn Plugins(&self) -> Temporary; + fn Links(&self) -> Temporary; + fn Forms(&self) -> Temporary; + fn Scripts(&self) -> Temporary; + fn Anchors(&self) -> Temporary; + fn Applets(&self) -> Temporary; + fn Location(&mut self) -> Temporary; + fn Children(&self) -> Temporary; } impl<'a> DocumentMethods for JSRef<'a, Document> { // http://dom.spec.whatwg.org/#dom-document-implementation - fn Implementation(&mut self) -> Unrooted { + fn Implementation(&mut self) -> Temporary { if self.implementation.is_none() { let roots = RootCollection::new(); let window = self.window.root(&roots); self.implementation.assign(Some(DOMImplementation::new(&*window))); } - Unrooted::new(self.implementation.get_ref().clone()) + Temporary::new(self.implementation.get_ref().clone()) } // http://dom.spec.whatwg.org/#dom-document-url @@ -366,31 +366,31 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-document-doctype - fn GetDoctype(&self) -> Option> { + fn GetDoctype(&self) -> Option> { let node: &JSRef = NodeCast::from_ref(self); node.children().find(|child| { child.is_doctype() }).map(|node| { let doctype: &JSRef = DocumentTypeCast::to_ref(&node).unwrap(); - Unrooted::new(doctype.unrooted()) + Temporary::new(doctype.unrooted()) }) } // http://dom.spec.whatwg.org/#dom-document-documentelement - fn GetDocumentElement(&self) -> Option> { + fn GetDocumentElement(&self) -> Option> { let node: &JSRef = NodeCast::from_ref(self); - node.child_elements().next().map(|elem| Unrooted::new_rooted(&elem)) + node.child_elements().next().map(|elem| Temporary::new_rooted(&elem)) } // http://dom.spec.whatwg.org/#dom-document-getelementsbytagname - fn GetElementsByTagName(&self, tag_name: DOMString) -> Unrooted { + fn GetElementsByTagName(&self, tag_name: DOMString) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); HTMLCollection::by_tag_name(&*window, NodeCast::from_ref(self), tag_name) } // http://dom.spec.whatwg.org/#dom-document-getelementsbytagnamens - fn GetElementsByTagNameNS(&self, maybe_ns: Option, tag_name: DOMString) -> Unrooted { + fn GetElementsByTagNameNS(&self, maybe_ns: Option, tag_name: DOMString) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -402,7 +402,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-document-getelementsbyclassname - fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted { + fn GetElementsByClassName(&self, classes: DOMString) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -410,15 +410,15 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid - fn GetElementById(&self, id: DOMString) -> Option> { + fn GetElementById(&self, id: DOMString) -> Option> { match self.idmap.find_equiv(&id) { None => None, - Some(ref elements) => Some(Unrooted::new(elements.get(0).clone())), + Some(ref elements) => Some(Temporary::new(elements.get(0).clone())), } } // http://dom.spec.whatwg.org/#dom-document-createelement - fn CreateElement(&self, local_name: DOMString) -> Fallible> { + fn CreateElement(&self, local_name: DOMString) -> Fallible> { if xml_name_type(local_name) == InvalidXMLName { debug!("Not a valid element name"); return Err(InvalidCharacter); @@ -430,7 +430,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { // http://dom.spec.whatwg.org/#dom-document-createelementns fn CreateElementNS(&self, namespace: Option, - qualified_name: DOMString) -> Fallible> { + qualified_name: DOMString) -> Fallible> { let ns = Namespace::from_str(null_str_as_empty_ref(&namespace)); match xml_name_type(qualified_name) { InvalidXMLName => { @@ -474,24 +474,24 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-document-createdocumentfragment - fn CreateDocumentFragment(&self) -> Unrooted { + fn CreateDocumentFragment(&self) -> Temporary { DocumentFragment::new(self) } // http://dom.spec.whatwg.org/#dom-document-createtextnode fn CreateTextNode(&self, data: DOMString) - -> Unrooted { + -> Temporary { Text::new(data, self) } // http://dom.spec.whatwg.org/#dom-document-createcomment - fn CreateComment(&self, data: DOMString) -> Unrooted { + fn CreateComment(&self, data: DOMString) -> Temporary { Comment::new(data, self) } // http://dom.spec.whatwg.org/#dom-document-createprocessinginstruction fn CreateProcessingInstruction(&self, target: DOMString, - data: DOMString) -> Fallible> { + data: DOMString) -> Fallible> { // Step 1. if xml_name_type(target) == InvalidXMLName { return Err(InvalidCharacter); @@ -507,7 +507,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-document-importnode - fn ImportNode(&self, node: &JSRef, deep: bool) -> Fallible> { + fn ImportNode(&self, node: &JSRef, deep: bool) -> Fallible> { // Step 1. if node.is_document() { return Err(NotSupported); @@ -523,7 +523,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://dom.spec.whatwg.org/#dom-document-adoptnode - fn AdoptNode(&self, node: &mut JSRef) -> Fallible> { + fn AdoptNode(&self, node: &mut JSRef) -> Fallible> { // Step 1. if node.is_document() { return Err(NotSupported); @@ -533,11 +533,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { Node::adopt(node, self); // Step 3. - Ok(Unrooted::new_rooted(node)) + Ok(Temporary::new_rooted(node)) } // http://dom.spec.whatwg.org/#dom-document-createevent - fn CreateEvent(&self, interface: DOMString) -> Fallible> { + fn CreateEvent(&self, interface: DOMString) -> Fallible> { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -611,7 +611,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-head - fn GetHead(&self) -> Option> { + fn GetHead(&self) -> Option> { let roots = RootCollection::new(); self.get_html_element().and_then(|root| { let root = root.root(&roots); @@ -619,13 +619,13 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { node.children().find(|child| { child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId) }).map(|node| { - Unrooted::new_rooted(HTMLHeadElementCast::to_ref(&node).unwrap()) + Temporary::new_rooted(HTMLHeadElementCast::to_ref(&node).unwrap()) }) }) } // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-body - fn GetBody(&self) -> Option> { + fn GetBody(&self) -> Option> { let roots = RootCollection::new(); self.get_html_element().and_then(|root| { let root = root.root(&roots); @@ -637,7 +637,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { _ => false } }).map(|node| { - Unrooted::new_rooted(HTMLElementCast::to_ref(&node).unwrap()) + Temporary::new_rooted(HTMLElementCast::to_ref(&node).unwrap()) }) }) } @@ -688,7 +688,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { } // http://www.whatwg.org/specs/web-apps/current-work/#dom-document-getelementsbyname - fn GetElementsByName(&self, name: DOMString) -> Unrooted { + fn GetElementsByName(&self, name: DOMString) -> Temporary { let roots = RootCollection::new(); self.createNodeList(|node| { @@ -703,7 +703,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { }) } - fn Images(&self) -> Unrooted { + fn Images(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -718,7 +718,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Embeds(&self) -> Unrooted { + fn Embeds(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -733,12 +733,12 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Plugins(&self) -> Unrooted { + fn Plugins(&self) -> Temporary { // FIXME: https://github.com/mozilla/servo/issues/1847 self.Embeds() } - fn Links(&self) -> Unrooted { + fn Links(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -754,7 +754,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Forms(&self) -> Unrooted { + fn Forms(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -769,7 +769,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Scripts(&self) -> Unrooted { + fn Scripts(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -784,7 +784,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Anchors(&self) -> Unrooted { + fn Anchors(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -799,7 +799,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Applets(&self) -> Unrooted { + fn Applets(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); @@ -814,13 +814,13 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { HTMLCollection::create(&*window, NodeCast::from_ref(self), filter) } - fn Location(&mut self) -> Unrooted { + fn Location(&mut self) -> Temporary { let roots = RootCollection::new(); let mut window = self.window.root(&roots); window.Location() } - fn Children(&self) -> Unrooted { + fn Children(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); HTMLCollection::children(&*window, NodeCast::from_ref(self)) diff --git a/src/components/script/dom/documentfragment.rs b/src/components/script/dom/documentfragment.rs index 55e782406b3..1dfd92c6f66 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, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::Fallible; use dom::document::Document; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -34,12 +34,12 @@ impl DocumentFragment { } } - pub fn new(document: &JSRef) -> Unrooted { + pub fn new(document: &JSRef) -> Temporary { let node = DocumentFragment::new_inherited(document.unrooted()); Node::reflect_node(~node, document, DocumentFragmentBinding::Wrap) } - pub fn Constructor(owner: &JSRef) -> Fallible> { + pub fn Constructor(owner: &JSRef) -> Fallible> { let roots = RootCollection::new(); let document = owner.Document(); let document = document.root(&roots); @@ -49,11 +49,11 @@ impl DocumentFragment { } pub trait DocumentFragmentMethods { - fn Children(&self) -> Unrooted; + fn Children(&self) -> Temporary; } impl<'a> DocumentFragmentMethods for JSRef<'a, DocumentFragment> { - fn Children(&self) -> Unrooted { + fn Children(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); HTMLCollection::children(&window.root_ref(), NodeCast::from_ref(self)) diff --git a/src/components/script/dom/documenttype.rs b/src/components/script/dom/documenttype.rs index 26772db65ec..9e0c61e3723 100644 --- a/src/components/script/dom/documenttype.rs +++ b/src/components/script/dom/documenttype.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::InheritTypes::DocumentTypeDerived; use dom::bindings::codegen::BindingDeclarations::DocumentTypeBinding; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::node::{Node, DoctypeNodeTypeId}; @@ -46,7 +46,7 @@ impl DocumentType { public_id: Option, system_id: Option, document: &JSRef) - -> Unrooted { + -> Temporary { let documenttype = DocumentType::new_inherited(name, public_id, system_id, diff --git a/src/components/script/dom/domexception.rs b/src/components/script/dom/domexception.rs index 78d43b047f1..d3ef0664383 100644 --- a/src/components/script/dom/domexception.rs +++ b/src/components/script/dom/domexception.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::DOMExceptionBinding; use dom::bindings::codegen::BindingDeclarations::DOMExceptionBinding::DOMExceptionConstants; -use dom::bindings::js::{JSRef, Unrooted}; +use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::window::Window; use servo_util::str::DOMString; @@ -49,7 +49,7 @@ impl DOMException { } } - pub fn new(window: &JSRef, code: DOMErrorName) -> Unrooted { + pub fn new(window: &JSRef, code: DOMErrorName) -> Temporary { reflect_dom_object(~DOMException::new_inherited(code), window, DOMExceptionBinding::Wrap) } } diff --git a/src/components/script/dom/domimplementation.rs b/src/components/script/dom/domimplementation.rs index e339485fbd9..4346e6044c4 100644 --- a/src/components/script/dom/domimplementation.rs +++ b/src/components/script/dom/domimplementation.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::DOMImplementationBinding; use dom::bindings::codegen::InheritTypes::NodeCast; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, OptionalRootable}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalRootable}; use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object}; use dom::bindings::error::{Fallible, InvalidCharacter, NamespaceError}; use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type}; @@ -33,7 +33,7 @@ impl DOMImplementation { } } - pub fn new(owner: &JSRef) -> Unrooted { + pub fn new(owner: &JSRef) -> Temporary { reflect_dom_object(~DOMImplementation::new_inherited(owner.unrooted()), owner, DOMImplementationBinding::Wrap) } @@ -50,16 +50,16 @@ impl Reflectable for DOMImplementation { } pub trait DOMImplementationMethods { - fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible>; + fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible>; fn CreateDocument(&self, namespace: Option, qname: DOMString, - mut maybe_doctype: Option>) -> Fallible>; - fn CreateHTMLDocument(&self, title: Option) -> Unrooted; + mut maybe_doctype: Option>) -> Fallible>; + fn CreateHTMLDocument(&self, title: Option) -> Temporary; } // http://dom.spec.whatwg.org/#domimplementation impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { // http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype - fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible> { + fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible> { let roots = RootCollection::new(); match xml_name_type(qname) { // Step 1. @@ -77,7 +77,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { // http://dom.spec.whatwg.org/#dom-domimplementation-createdocument fn CreateDocument(&self, namespace: Option, qname: DOMString, - mut maybe_doctype: Option>) -> Fallible> { + mut maybe_doctype: Option>) -> Fallible> { let roots = RootCollection::new(); let win = self.owner.root(&roots); @@ -117,11 +117,11 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { // FIXME: https://github.com/mozilla/servo/issues/1522 // Step 7. - Ok(Unrooted::new_rooted(&*doc)) + Ok(Temporary::new_rooted(&*doc)) } // http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument - fn CreateHTMLDocument(&self, title: Option) -> Unrooted { + fn CreateHTMLDocument(&self, title: Option) -> Temporary { let roots = RootCollection::new(); let owner = self.owner.root(&roots); @@ -170,6 +170,6 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> { // FIXME: https://github.com/mozilla/servo/issues/1522 // Step 9. - Unrooted::new_rooted(&*doc) + Temporary::new_rooted(&*doc) } } diff --git a/src/components/script/dom/domparser.rs b/src/components/script/dom/domparser.rs index 9f8785e6fd7..3dc95f57d27 100644 --- a/src/components/script/dom/domparser.rs +++ b/src/components/script/dom/domparser.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::DOMParserBinding; use dom::bindings::codegen::BindingDeclarations::DOMParserBinding::SupportedTypeValues::{Text_html, Text_xml}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object}; use dom::bindings::error::{Fallible, FailureUnknown}; use dom::document::{Document, HTMLDocument, NonHTMLDocument}; @@ -25,25 +25,25 @@ impl DOMParser { } } - pub fn new(owner: &JSRef) -> Unrooted { + pub fn new(owner: &JSRef) -> Temporary { reflect_dom_object(~DOMParser::new_inherited(owner.unrooted()), owner, DOMParserBinding::Wrap) } - pub fn Constructor(owner: &JSRef) -> Fallible> { + pub fn Constructor(owner: &JSRef) -> Fallible> { Ok(DOMParser::new(owner)) } } pub trait DOMParserMethods { - fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible>; + fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible>; } impl<'a> DOMParserMethods for JSRef<'a, DOMParser> { fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) - -> Fallible> { + -> Fallible> { let roots = RootCollection::new(); let owner = self.owner.root(&roots); match ty { diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 9e8be904788..fdf9db3e5b0 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -8,7 +8,7 @@ use dom::attr::{Attr, ReplacedAttr, FirstSetAttr, AttrMethods}; use dom::attrlist::AttrList; use dom::bindings::codegen::BindingDeclarations::ElementBinding; use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, UnrootedPushable}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, TemporaryPushable}; use dom::bindings::js::{OptionalAssignable, OptionalRootable, Root}; use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter}; @@ -153,7 +153,7 @@ impl Element { } } - pub fn new(local_name: DOMString, namespace: Namespace, prefix: Option, document: &JSRef) -> Unrooted { + pub fn new(local_name: DOMString, namespace: Namespace, prefix: Option, document: &JSRef) -> Temporary { let element = Element::new_inherited(ElementTypeId, local_name, namespace, prefix, document.unrooted()); Node::reflect_node(~element, document, ElementBinding::Wrap) } @@ -206,7 +206,7 @@ impl<'a> ElementHelpers for JSRef<'a, Element> { } pub trait AttributeHandlers { - fn get_attribute(&self, namespace: Namespace, name: &str) -> Option>; + fn get_attribute(&self, namespace: Namespace, name: &str) -> Option>; fn set_attr(&mut self, name: DOMString, value: DOMString) -> ErrorResult; fn set_attribute(&mut self, namespace: Namespace, name: DOMString, value: DOMString) -> ErrorResult; @@ -227,16 +227,16 @@ pub trait AttributeHandlers { } impl<'a> AttributeHandlers for JSRef<'a, Element> { - fn get_attribute(&self, namespace: Namespace, name: &str) -> Option> { + fn get_attribute(&self, namespace: Namespace, name: &str) -> Option> { let roots = RootCollection::new(); if self.html_element_in_html_document() { self.get().attrs.iter().map(|attr| attr.root(&roots)).find(|attr| { name.to_ascii_lower() == attr.local_name && attr.namespace == namespace - }).map(|x| Unrooted::new_rooted(&*x)) + }).map(|x| Temporary::new_rooted(&*x)) } else { self.get().attrs.iter().map(|attr| attr.root(&roots)).find(|attr| { name == attr.local_name && attr.namespace == namespace - }).map(|x| Unrooted::new_rooted(&*x)) + }).map(|x| Temporary::new_rooted(&*x)) } } @@ -394,7 +394,7 @@ pub trait ElementMethods { fn SetId(&mut self, id: DOMString); fn ClassName(&self) -> DOMString; fn SetClassName(&mut self, class: DOMString); - fn Attributes(&mut self) -> Unrooted; + fn Attributes(&mut self) -> Temporary; fn GetAttribute(&self, name: DOMString) -> Option; fn GetAttributeNS(&self, namespace: Option, local_name: DOMString) -> Option; fn SetAttribute(&mut self, name: DOMString, value: DOMString) -> ErrorResult; @@ -403,14 +403,14 @@ pub trait ElementMethods { fn RemoveAttributeNS(&mut self, namespace: Option, localname: DOMString) -> ErrorResult; fn HasAttribute(&self, name: DOMString) -> bool; fn HasAttributeNS(&self, namespace: Option, local_name: DOMString) -> bool; - fn GetElementsByTagName(&self, localname: DOMString) -> Unrooted; - fn GetElementsByTagNameNS(&self, maybe_ns: Option, localname: DOMString) -> Unrooted; - fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted; - fn GetClientRects(&self) -> Unrooted; - fn GetBoundingClientRect(&self) -> Unrooted; + fn GetElementsByTagName(&self, localname: DOMString) -> Temporary; + fn GetElementsByTagNameNS(&self, maybe_ns: Option, localname: DOMString) -> Temporary; + fn GetElementsByClassName(&self, classes: DOMString) -> Temporary; + fn GetClientRects(&self) -> Temporary; + fn GetBoundingClientRect(&self) -> Temporary; fn GetInnerHTML(&self) -> Fallible; fn GetOuterHTML(&self) -> Fallible; - fn Children(&self) -> Unrooted; + fn Children(&self) -> Temporary; } impl<'a> ElementMethods for JSRef<'a, Element> { @@ -461,11 +461,11 @@ impl<'a> ElementMethods for JSRef<'a, Element> { } // http://dom.spec.whatwg.org/#dom-element-attributes - fn Attributes(&mut self) -> Unrooted { + fn Attributes(&mut self) -> Temporary { let roots = RootCollection::new(); match self.attr_list { None => (), - Some(ref list) => return Unrooted::new(list.clone()), + Some(ref list) => return Temporary::new(list.clone()), } let doc = { @@ -475,7 +475,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { let window = doc.deref().window.root(&roots); let list = AttrList::new(&*window, self); self.attr_list.assign(Some(list)); - Unrooted::new(self.attr_list.get_ref().clone()) + Temporary::new(self.attr_list.get_ref().clone()) } // http://dom.spec.whatwg.org/#dom-element-getattribute @@ -623,14 +623,14 @@ impl<'a> ElementMethods for JSRef<'a, Element> { self.GetAttributeNS(namespace, local_name).is_some() } - fn GetElementsByTagName(&self, localname: DOMString) -> Unrooted { + fn GetElementsByTagName(&self, localname: DOMString) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); HTMLCollection::by_tag_name(&*window, NodeCast::from_ref(self), localname) } fn GetElementsByTagNameNS(&self, maybe_ns: Option, - localname: DOMString) -> Unrooted { + localname: DOMString) -> Temporary { let roots = RootCollection::new(); let namespace = match maybe_ns { Some(namespace) => Namespace::from_str(namespace), @@ -640,14 +640,14 @@ impl<'a> ElementMethods for JSRef<'a, Element> { HTMLCollection::by_tag_name_ns(&*window, NodeCast::from_ref(self), localname, namespace) } - fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted { + fn GetElementsByClassName(&self, classes: DOMString) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); HTMLCollection::by_class_name(&*window, NodeCast::from_ref(self), classes) } // http://dev.w3.org/csswg/cssom-view/#dom-element-getclientrects - fn GetClientRects(&self) -> Unrooted { + fn GetClientRects(&self) -> Temporary { let roots = RootCollection::new(); let win = window_from_node(self).root(&roots); let node: &JSRef = NodeCast::from_ref(self); @@ -665,7 +665,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { } // http://dev.w3.org/csswg/cssom-view/#dom-element-getboundingclientrect - fn GetBoundingClientRect(&self) -> Unrooted { + fn GetBoundingClientRect(&self) -> Temporary { let roots = RootCollection::new(); let win = window_from_node(self).root(&roots); let node: &JSRef = NodeCast::from_ref(self); @@ -689,7 +689,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> { Ok(serialize(&mut NodeIterator::new(&roots, NodeCast::from_ref(self), true, false))) } - fn Children(&self) -> Unrooted { + fn Children(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); HTMLCollection::children(&*window, NodeCast::from_ref(self)) diff --git a/src/components/script/dom/event.rs b/src/components/script/dom/event.rs index 08fdc818ed6..3b3254c0f0c 100644 --- a/src/components/script/dom/event.rs +++ b/src/components/script/dom/event.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::EventBinding; use dom::bindings::codegen::BindingDeclarations::EventBinding::EventConstants; -use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::Fallible; use dom::eventtarget::EventTarget; @@ -80,7 +80,7 @@ impl Event { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~Event::new_inherited(HTMLEventTypeId), window, EventBinding::Wrap) @@ -88,19 +88,19 @@ impl Event { pub fn Constructor(global: &JSRef, type_: DOMString, - init: &EventBinding::EventInit) -> Fallible> { + init: &EventBinding::EventInit) -> Fallible> { let roots = RootCollection::new(); let mut ev = Event::new(global).root(&roots); ev.InitEvent(type_, init.bubbles, init.cancelable); - Ok(Unrooted::new_rooted(&*ev)) + Ok(Temporary::new_rooted(&*ev)) } } pub trait EventMethods { fn EventPhase(&self) -> u16; fn Type(&self) -> DOMString; - fn GetTarget(&self) -> Option>; - fn GetCurrentTarget(&self) -> Option>; + fn GetTarget(&self) -> Option>; + fn GetCurrentTarget(&self) -> Option>; fn DefaultPrevented(&self) -> bool; fn PreventDefault(&mut self); fn StopPropagation(&mut self); @@ -121,12 +121,12 @@ impl<'a> EventMethods for JSRef<'a, Event> { self.type_.clone() } - fn GetTarget(&self) -> Option> { - self.target.as_ref().map(|target| Unrooted::new(target.clone())) + fn GetTarget(&self) -> Option> { + self.target.as_ref().map(|target| Temporary::new(target.clone())) } - fn GetCurrentTarget(&self) -> Option> { - self.current_target.as_ref().map(|target| Unrooted::new(target.clone())) + fn GetCurrentTarget(&self) -> Option> { + self.current_target.as_ref().map(|target| Temporary::new(target.clone())) } fn DefaultPrevented(&self) -> bool { diff --git a/src/components/script/dom/formdata.rs b/src/components/script/dom/formdata.rs index 88be3e4314e..8cd1eebb028 100644 --- a/src/components/script/dom/formdata.rs +++ b/src/components/script/dom/formdata.rs @@ -5,7 +5,7 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::{Fallible}; use dom::bindings::codegen::BindingDeclarations::FormDataBinding; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::blob::Blob; use dom::htmlformelement::HTMLFormElement; use dom::window::Window; @@ -37,11 +37,11 @@ impl FormData { } } - pub fn new(form: Option>, window: &JSRef) -> Unrooted { + pub fn new(form: Option>, window: &JSRef) -> Temporary { reflect_dom_object(~FormData::new_inherited(form, window.unrooted()), window, FormDataBinding::Wrap) } - pub fn Constructor(window: &JSRef, form: Option>) -> Fallible> { + pub fn Constructor(window: &JSRef, form: Option>) -> Fallible> { Ok(FormData::new(form, window)) } } diff --git a/src/components/script/dom/htmlanchorelement.rs b/src/components/script/dom/htmlanchorelement.rs index 22e7846269c..1757de35ecf 100644 --- a/src/components/script/dom/htmlanchorelement.rs +++ b/src/components/script/dom/htmlanchorelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLAnchorElementBinding; use dom::bindings::codegen::InheritTypes::HTMLAnchorElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLAnchorElementTypeId; @@ -34,7 +34,7 @@ impl HTMLAnchorElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLAnchorElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLAnchorElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlappletelement.rs b/src/components/script/dom/htmlappletelement.rs index bcf7481d4d7..5500f6568aa 100644 --- a/src/components/script/dom/htmlappletelement.rs +++ b/src/components/script/dom/htmlappletelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLAppletElementBinding; use dom::bindings::codegen::InheritTypes::HTMLAppletElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLAppletElementTypeId; @@ -34,7 +34,7 @@ impl HTMLAppletElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLAppletElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLAppletElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlareaelement.rs b/src/components/script/dom/htmlareaelement.rs index d22e8a45a67..e6678299abf 100644 --- a/src/components/script/dom/htmlareaelement.rs +++ b/src/components/script/dom/htmlareaelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLAreaElementBinding; use dom::bindings::codegen::InheritTypes::HTMLAreaElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLAreaElementTypeId; @@ -34,7 +34,7 @@ impl HTMLAreaElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLAreaElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLAreaElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlaudioelement.rs b/src/components/script/dom/htmlaudioelement.rs index 7e3826dd4c6..3b1a7cb3a98 100644 --- a/src/components/script/dom/htmlaudioelement.rs +++ b/src/components/script/dom/htmlaudioelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLAudioElementBinding; use dom::bindings::codegen::InheritTypes::HTMLAudioElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLAudioElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLAudioElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLAudioElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLAudioElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlbaseelement.rs b/src/components/script/dom/htmlbaseelement.rs index 83cdf3607ac..1105f862881 100644 --- a/src/components/script/dom/htmlbaseelement.rs +++ b/src/components/script/dom/htmlbaseelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLBaseElementBinding; use dom::bindings::codegen::InheritTypes::HTMLBaseElementDerived; use dom::bindings::error::ErrorResult; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLBaseElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -34,7 +34,7 @@ impl HTMLBaseElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLBaseElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLBaseElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlbodyelement.rs b/src/components/script/dom/htmlbodyelement.rs index cb59f0c6fb4..d070c7b5a12 100644 --- a/src/components/script/dom/htmlbodyelement.rs +++ b/src/components/script/dom/htmlbodyelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLBodyElementBinding; use dom::bindings::codegen::InheritTypes::HTMLBodyElementDerived; use dom::bindings::error::ErrorResult; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLBodyElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -34,7 +34,7 @@ impl HTMLBodyElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLBodyElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLBodyElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlbrelement.rs b/src/components/script/dom/htmlbrelement.rs index 5b06b1467ea..2bf59a4f966 100644 --- a/src/components/script/dom/htmlbrelement.rs +++ b/src/components/script/dom/htmlbrelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLBRElementBinding; use dom::bindings::codegen::InheritTypes::HTMLBRElementDerived; use dom::bindings::error::ErrorResult; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLBRElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -34,7 +34,7 @@ impl HTMLBRElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLBRElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLBRElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlbuttonelement.rs b/src/components/script/dom/htmlbuttonelement.rs index f37d9926032..7458c7df50b 100644 --- a/src/components/script/dom/htmlbuttonelement.rs +++ b/src/components/script/dom/htmlbuttonelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLButtonElementBinding; use dom::bindings::codegen::InheritTypes::HTMLButtonElementDerived; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLButtonElementTypeId; @@ -36,7 +36,7 @@ impl HTMLButtonElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLButtonElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLButtonElementBinding::Wrap) } @@ -47,7 +47,7 @@ pub trait HTMLButtonElementMethods { fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult; fn Disabled(&self) -> bool; fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult; - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn FormAction(&self) -> DOMString; fn SetFormAction(&mut self, _formaction: DOMString) -> ErrorResult; fn FormEnctype(&self) -> DOMString; @@ -66,7 +66,7 @@ pub trait HTMLButtonElementMethods { fn SetValue(&mut self, _value: DOMString) -> ErrorResult; fn WillValidate(&self) -> bool; fn SetWillValidate(&mut self, _will_validate: bool); - fn Validity(&self) -> Unrooted; + fn Validity(&self) -> Temporary; fn SetValidity(&mut self, _validity: JS); fn ValidationMessage(&self) -> DOMString; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; @@ -91,7 +91,7 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> { Ok(()) } - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } @@ -166,7 +166,7 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> { fn SetWillValidate(&mut self, _will_validate: bool) { } - fn Validity(&self) -> Unrooted { + fn Validity(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); ValidityState::new(&*window) diff --git a/src/components/script/dom/htmlcanvaselement.rs b/src/components/script/dom/htmlcanvaselement.rs index 32af35a06b7..068cee1bbd8 100644 --- a/src/components/script/dom/htmlcanvaselement.rs +++ b/src/components/script/dom/htmlcanvaselement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLCanvasElementBinding; use dom::bindings::codegen::InheritTypes::HTMLCanvasElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::{ErrorResult}; use dom::document::Document; use dom::element::HTMLCanvasElementTypeId; @@ -34,7 +34,7 @@ impl HTMLCanvasElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLCanvasElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLCanvasElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlcollection.rs b/src/components/script/dom/htmlcollection.rs index 77ddb563805..3be0a84a2a2 100644 --- a/src/components/script/dom/htmlcollection.rs +++ b/src/components/script/dom/htmlcollection.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, NodeCast}; use dom::bindings::codegen::BindingDeclarations::HTMLCollectionBinding; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::element::{Element, AttributeHandlers}; use dom::node::{Node, NodeHelpers}; @@ -46,19 +46,19 @@ impl HTMLCollection { } } - pub fn new(window: &JSRef, collection: CollectionTypeId) -> Unrooted { + pub fn new(window: &JSRef, collection: CollectionTypeId) -> Temporary { reflect_dom_object(~HTMLCollection::new_inherited(window.unrooted(), collection), window, HTMLCollectionBinding::Wrap) } } impl HTMLCollection { - pub fn create(window: &JSRef, root: &JSRef, filter: ~CollectionFilter) -> Unrooted { + pub fn create(window: &JSRef, root: &JSRef, filter: ~CollectionFilter) -> Temporary { HTMLCollection::new(window, Live(root.unrooted(), filter)) } pub fn by_tag_name(window: &JSRef, root: &JSRef, tag: DOMString) - -> Unrooted { + -> Temporary { struct TagNameFilter { tag: DOMString } @@ -74,7 +74,7 @@ impl HTMLCollection { } pub fn by_tag_name_ns(window: &JSRef, root: &JSRef, tag: DOMString, - namespace: Namespace) -> Unrooted { + namespace: Namespace) -> Temporary { struct TagNameNSFilter { tag: DOMString, namespace: Namespace @@ -92,7 +92,7 @@ impl HTMLCollection { } pub fn by_class_name(window: &JSRef, root: &JSRef, classes: DOMString) - -> Unrooted { + -> Temporary { struct ClassNameFilter { classes: Vec } @@ -107,7 +107,7 @@ impl HTMLCollection { HTMLCollection::create(window, root, ~filter) } - pub fn children(window: &JSRef, root: &JSRef) -> Unrooted { + pub fn children(window: &JSRef, root: &JSRef) -> Temporary { struct ElementChildFilter; impl CollectionFilter for ElementChildFilter { fn filter(&self, elem: &JSRef, root: &JSRef) -> bool { @@ -120,10 +120,10 @@ impl HTMLCollection { pub trait HTMLCollectionMethods { fn Length(&self) -> u32; - fn Item(&self, index: u32) -> Option>; - fn NamedItem(&self, key: DOMString) -> Option>; - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; - fn NamedGetter(&self, maybe_name: Option, found: &mut bool) -> Option>; + fn Item(&self, index: u32) -> Option>; + fn NamedItem(&self, key: DOMString) -> Option>; + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; + fn NamedGetter(&self, maybe_name: Option, found: &mut bool) -> Option>; } impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { @@ -144,13 +144,13 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { } // http://dom.spec.whatwg.org/#dom-htmlcollection-item - fn Item(&self, index: u32) -> Option> { + fn Item(&self, index: u32) -> Option> { let roots = RootCollection::new(); match self.collection { Static(ref elems) => elems .as_slice() .get(index as uint) - .map(|elem| Unrooted::new(elem.clone())), + .map(|elem| Temporary::new(elem.clone())), Live(ref root, ref filter) => { let root = root.root(&roots); root.deref().traverse_preorder(&roots) @@ -161,13 +161,13 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { }) .nth(index as uint) .clone() - .map(|elem| Unrooted::new_rooted(&elem)) + .map(|elem| Temporary::new_rooted(&elem)) } } } // http://dom.spec.whatwg.org/#dom-htmlcollection-nameditem - fn NamedItem(&self, key: DOMString) -> Option> { + fn NamedItem(&self, key: DOMString) -> Option> { let roots = RootCollection::new(); // Step 1. @@ -182,7 +182,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { .find(|elem| { elem.get_string_attribute("name") == key || elem.get_string_attribute("id") == key }) - .map(|maybe_elem| Unrooted::new_rooted(&*maybe_elem)), + .map(|maybe_elem| Temporary::new_rooted(&*maybe_elem)), Live(ref root, ref filter) => { let root = root.root(&roots); root.deref().traverse_preorder(&roots) @@ -194,18 +194,18 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> { .find(|elem| { elem.get_string_attribute("name") == key || elem.get_string_attribute("id") == key }) - .map(|maybe_elem| Unrooted::new_rooted(&maybe_elem)) + .map(|maybe_elem| Temporary::new_rooted(&maybe_elem)) } } } - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { let maybe_elem = self.Item(index); *found = maybe_elem.is_some(); maybe_elem } - fn NamedGetter(&self, maybe_name: Option, found: &mut bool) -> Option> { + fn NamedGetter(&self, maybe_name: Option, found: &mut bool) -> Option> { match maybe_name { Some(name) => { let maybe_elem = self.NamedItem(name); diff --git a/src/components/script/dom/htmldataelement.rs b/src/components/script/dom/htmldataelement.rs index 4e412665595..dcac09e2f5b 100644 --- a/src/components/script/dom/htmldataelement.rs +++ b/src/components/script/dom/htmldataelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLDataElementBinding; use dom::bindings::codegen::InheritTypes::HTMLDataElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLDataElementTypeId; @@ -34,7 +34,7 @@ impl HTMLDataElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLDataElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLDataElementBinding::Wrap) } diff --git a/src/components/script/dom/htmldatalistelement.rs b/src/components/script/dom/htmldatalistelement.rs index ae5dbfbef9e..398920bdc61 100644 --- a/src/components/script/dom/htmldatalistelement.rs +++ b/src/components/script/dom/htmldatalistelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLDataListElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, NodeCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::document::Document; use dom::element::{Element, HTMLDataListElementTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -34,18 +34,18 @@ impl HTMLDataListElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLDataListElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLDataListElementBinding::Wrap) } } pub trait HTMLDataListElementMethods { - fn Options(&self) -> Unrooted; + fn Options(&self) -> Temporary; } impl<'a> HTMLDataListElementMethods for JSRef<'a, HTMLDataListElement> { - fn Options(&self) -> Unrooted { + fn Options(&self) -> Temporary { struct HTMLDataListOptionsFilter; impl CollectionFilter for HTMLDataListOptionsFilter { fn filter(&self, elem: &JSRef, _root: &JSRef) -> bool { diff --git a/src/components/script/dom/htmldirectoryelement.rs b/src/components/script/dom/htmldirectoryelement.rs index cc7dd99920b..8cde736766f 100644 --- a/src/components/script/dom/htmldirectoryelement.rs +++ b/src/components/script/dom/htmldirectoryelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLDirectoryElementBinding; use dom::bindings::codegen::InheritTypes::HTMLDirectoryElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLDirectoryElementTypeId; @@ -34,7 +34,7 @@ impl HTMLDirectoryElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLDirectoryElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLDirectoryElementBinding::Wrap) } diff --git a/src/components/script/dom/htmldivelement.rs b/src/components/script/dom/htmldivelement.rs index d50b95c72cd..2047530985b 100644 --- a/src/components/script/dom/htmldivelement.rs +++ b/src/components/script/dom/htmldivelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLDivElementBinding; use dom::bindings::codegen::InheritTypes::HTMLDivElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLDivElementTypeId; @@ -34,7 +34,7 @@ impl HTMLDivElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLDivElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLDivElementBinding::Wrap) } diff --git a/src/components/script/dom/htmldlistelement.rs b/src/components/script/dom/htmldlistelement.rs index 838c694a33c..dc7ae6066fe 100644 --- a/src/components/script/dom/htmldlistelement.rs +++ b/src/components/script/dom/htmldlistelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLDListElementBinding; use dom::bindings::codegen::InheritTypes::HTMLDListElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLDListElementTypeId; @@ -34,7 +34,7 @@ impl HTMLDListElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLDListElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLDListElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs index c7596688cdb..87b00f2eb90 100644 --- a/src/components/script/dom/htmlelement.rs +++ b/src/components/script/dom/htmlelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding; use dom::bindings::codegen::InheritTypes::ElementCast; use dom::bindings::codegen::InheritTypes::HTMLElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::{ErrorResult, Fallible}; use dom::document::Document; use dom::element::{Element, ElementTypeId, HTMLElementTypeId}; @@ -39,7 +39,7 @@ impl HTMLElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document.unrooted()); Node::reflect_node(~element, document, HTMLElementBinding::Wrap) } @@ -71,7 +71,7 @@ pub trait HTMLElementMethods { fn IsContentEditable(&self) -> bool; fn Spellcheck(&self) -> bool; fn SetSpellcheck(&self, _val: bool) -> ErrorResult; - fn GetOffsetParent(&self) -> Option>; + fn GetOffsetParent(&self) -> Option>; fn OffsetTop(&self) -> i32; fn OffsetLeft(&self) -> i32; fn OffsetWidth(&self) -> i32; @@ -176,7 +176,7 @@ impl<'a> HTMLElementMethods for JSRef<'a, HTMLElement> { Ok(()) } - fn GetOffsetParent(&self) -> Option> { + fn GetOffsetParent(&self) -> Option> { None } diff --git a/src/components/script/dom/htmlembedelement.rs b/src/components/script/dom/htmlembedelement.rs index 715f113987e..334c7320295 100644 --- a/src/components/script/dom/htmlembedelement.rs +++ b/src/components/script/dom/htmlembedelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLEmbedElementBinding; use dom::bindings::codegen::InheritTypes::HTMLEmbedElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLEmbedElementTypeId; @@ -34,7 +34,7 @@ impl HTMLEmbedElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLEmbedElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLEmbedElementBinding::Wrap) } @@ -53,7 +53,7 @@ pub trait HTMLEmbedElementMethods { fn SetAlign(&mut self, _type: DOMString) -> ErrorResult; fn Name(&self) -> DOMString; fn SetName(&mut self, _type: DOMString) -> ErrorResult; - fn GetSVGDocument(&self) -> Option>; + fn GetSVGDocument(&self) -> Option>; } impl<'a> HTMLEmbedElementMethods for JSRef<'a, HTMLEmbedElement> { @@ -105,7 +105,7 @@ impl<'a> HTMLEmbedElementMethods for JSRef<'a, HTMLEmbedElement> { Ok(()) } - fn GetSVGDocument(&self) -> Option> { + fn GetSVGDocument(&self) -> Option> { None } } diff --git a/src/components/script/dom/htmlfieldsetelement.rs b/src/components/script/dom/htmlfieldsetelement.rs index 8da6d36b803..f3872235f27 100644 --- a/src/components/script/dom/htmlfieldsetelement.rs +++ b/src/components/script/dom/htmlfieldsetelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLFieldSetElementBinding; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFieldSetElementDerived, NodeCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::{Element, HTMLFieldSetElementTypeId}; @@ -37,7 +37,7 @@ impl HTMLFieldSetElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLFieldSetElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLFieldSetElementBinding::Wrap) } @@ -46,13 +46,13 @@ impl HTMLFieldSetElement { pub trait HTMLFieldSetElementMethods { fn Disabled(&self) -> bool; fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult; - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn Name(&self) -> DOMString; fn SetName(&mut self, _name: DOMString) -> ErrorResult; fn Type(&self) -> DOMString; - fn Elements(&self) -> Unrooted; + fn Elements(&self) -> Temporary; fn WillValidate(&self) -> bool; - fn Validity(&self) -> Unrooted; + fn Validity(&self) -> Temporary; fn ValidationMessage(&self) -> DOMString; fn CheckValidity(&self) -> bool; fn SetCustomValidity(&mut self, _error: DOMString); @@ -67,7 +67,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> { Ok(()) } - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } @@ -84,7 +84,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> { } // http://www.whatwg.org/html/#dom-fieldset-elements - fn Elements(&self) -> Unrooted { + fn Elements(&self) -> Temporary { struct ElementsFilter; impl CollectionFilter for ElementsFilter { fn filter(&self, elem: &JSRef, root: &JSRef) -> bool { @@ -105,7 +105,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> { false } - fn Validity(&self) -> Unrooted { + fn Validity(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); ValidityState::new(&*window) diff --git a/src/components/script/dom/htmlfontelement.rs b/src/components/script/dom/htmlfontelement.rs index eca6b946b23..5d6ececb57d 100644 --- a/src/components/script/dom/htmlfontelement.rs +++ b/src/components/script/dom/htmlfontelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLFontElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFontElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLFontElementTypeId; @@ -34,7 +34,7 @@ impl HTMLFontElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLFontElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLFontElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlformelement.rs b/src/components/script/dom/htmlformelement.rs index d69cbcf3a48..c7773bdf68a 100644 --- a/src/components/script/dom/htmlformelement.rs +++ b/src/components/script/dom/htmlformelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLFormElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFormElementDerived; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::{Element, HTMLFormElementTypeId}; @@ -35,7 +35,7 @@ impl HTMLFormElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLFormElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLFormElementBinding::Wrap) } @@ -60,12 +60,12 @@ pub trait HTMLFormElementMethods { fn SetNoValidate(&mut self, _no_validate: bool) -> ErrorResult; fn Target(&self) -> DOMString; fn SetTarget(&mut self, _target: DOMString) -> ErrorResult; - fn Elements(&self) -> Unrooted; + fn Elements(&self) -> Temporary; fn Length(&self) -> i32; fn Submit(&self) -> ErrorResult; fn Reset(&self); fn CheckValidity(&self) -> bool; - fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Unrooted; + fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Temporary; } impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> { @@ -141,7 +141,7 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> { Ok(()) } - fn Elements(&self) -> Unrooted { + fn Elements(&self) -> Temporary { // FIXME: https://github.com/mozilla/servo/issues/1844 let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); @@ -163,7 +163,7 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> { false } - fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Unrooted { + fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Temporary { fail!("Not implemented.") } } diff --git a/src/components/script/dom/htmlframeelement.rs b/src/components/script/dom/htmlframeelement.rs index 5dd705b494f..2f3aa886bcf 100644 --- a/src/components/script/dom/htmlframeelement.rs +++ b/src/components/script/dom/htmlframeelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLFrameElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFrameElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLFrameElementTypeId; @@ -35,7 +35,7 @@ impl HTMLFrameElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLFrameElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLFrameElementBinding::Wrap) } @@ -54,8 +54,8 @@ pub trait HTMLFrameElementMethods { fn SetLongDesc(&mut self, _longdesc: DOMString) -> ErrorResult; fn NoResize(&self) -> bool; fn SetNoResize(&mut self, _no_resize: bool) -> ErrorResult; - fn GetContentDocument(&self) -> Option>; - fn GetContentWindow(&self) -> Option>; + fn GetContentDocument(&self) -> Option>; + fn GetContentWindow(&self) -> Option>; fn MarginHeight(&self) -> DOMString; fn SetMarginHeight(&mut self, _height: DOMString) -> ErrorResult; fn MarginWidth(&self) -> DOMString; @@ -111,11 +111,11 @@ impl<'a> HTMLFrameElementMethods for JSRef<'a, HTMLFrameElement> { Ok(()) } - fn GetContentDocument(&self) -> Option> { + fn GetContentDocument(&self) -> Option> { None } - fn GetContentWindow(&self) -> Option> { + fn GetContentWindow(&self) -> Option> { None } diff --git a/src/components/script/dom/htmlframesetelement.rs b/src/components/script/dom/htmlframesetelement.rs index 1e58cba197a..32860c79562 100644 --- a/src/components/script/dom/htmlframesetelement.rs +++ b/src/components/script/dom/htmlframesetelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLFrameSetElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFrameSetElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLFrameSetElementTypeId; @@ -34,7 +34,7 @@ impl HTMLFrameSetElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLFrameSetElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLFrameSetElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlheadelement.rs b/src/components/script/dom/htmlheadelement.rs index 440a95310f6..1cfb2d4ea6e 100644 --- a/src/components/script/dom/htmlheadelement.rs +++ b/src/components/script/dom/htmlheadelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLHeadElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHeadElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLHeadElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLHeadElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLHeadElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLHeadElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlheadingelement.rs b/src/components/script/dom/htmlheadingelement.rs index f05ef59a211..98142aaaa6a 100644 --- a/src/components/script/dom/htmlheadingelement.rs +++ b/src/components/script/dom/htmlheadingelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLHeadingElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHeadingElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLHeadingElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -45,7 +45,7 @@ impl HTMLHeadingElement { } } - pub fn new(localName: DOMString, document: &JSRef, level: HeadingLevel) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef, level: HeadingLevel) -> Temporary { let element = HTMLHeadingElement::new_inherited(localName, document.unrooted(), level); Node::reflect_node(~element, document, HTMLHeadingElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlhrelement.rs b/src/components/script/dom/htmlhrelement.rs index 2ad58999b61..9031566d4d8 100644 --- a/src/components/script/dom/htmlhrelement.rs +++ b/src/components/script/dom/htmlhrelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLHRElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHRElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLHRElementTypeId; @@ -34,7 +34,7 @@ impl HTMLHRElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLHRElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLHRElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlhtmlelement.rs b/src/components/script/dom/htmlhtmlelement.rs index e30968f91f4..5a11183e80c 100644 --- a/src/components/script/dom/htmlhtmlelement.rs +++ b/src/components/script/dom/htmlhtmlelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLHtmlElementBinding; use dom::bindings::codegen::InheritTypes::HTMLHtmlElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLHtmlElementTypeId; @@ -34,7 +34,7 @@ impl HTMLHtmlElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLHtmlElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLHtmlElementBinding::Wrap) } diff --git a/src/components/script/dom/htmliframeelement.rs b/src/components/script/dom/htmliframeelement.rs index aa6fc3ceaf3..18a47de9ee7 100644 --- a/src/components/script/dom/htmliframeelement.rs +++ b/src/components/script/dom/htmliframeelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLIFrameElementBinding; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLIFrameElementDerived, HTMLElementCast}; use dom::bindings::error::ErrorResult; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::trace::Untraceable; use dom::document::Document; use dom::element::{HTMLIFrameElementTypeId, Element}; @@ -79,7 +79,7 @@ impl HTMLIFrameElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLIFrameElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLIFrameElementBinding::Wrap) } @@ -100,8 +100,8 @@ pub trait HTMLIFrameElementMethods { fn SetWidth(&mut self, _width: DOMString) -> ErrorResult; fn Height(&self) -> DOMString; fn SetHeight(&mut self, _height: DOMString) -> ErrorResult; - fn GetContentDocument(&self) -> Option>; - fn GetContentWindow(&self) -> Option>; + fn GetContentDocument(&self) -> Option>; + fn GetContentWindow(&self) -> Option>; fn Align(&self) -> DOMString; fn SetAlign(&mut self, _align: DOMString) -> ErrorResult; fn Scrolling(&self) -> DOMString; @@ -114,7 +114,7 @@ pub trait HTMLIFrameElementMethods { fn SetMarginHeight(&mut self, _marginheight: DOMString) -> ErrorResult; fn MarginWidth(&self) -> DOMString; fn SetMarginWidth(&mut self, _marginwidth: DOMString) -> ErrorResult; - fn GetSVGDocument(&self) -> Option>; + fn GetSVGDocument(&self) -> Option>; } impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> { @@ -176,11 +176,11 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> { Ok(()) } - fn GetContentDocument(&self) -> Option> { + fn GetContentDocument(&self) -> Option> { None } - fn GetContentWindow(&self) -> Option> { + fn GetContentWindow(&self) -> Option> { None } @@ -232,7 +232,7 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> { Ok(()) } - fn GetSVGDocument(&self) -> Option> { + fn GetSVGDocument(&self) -> Option> { None } } diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs index 423f49a8f14..956a923f7c0 100644 --- a/src/components/script/dom/htmlimageelement.rs +++ b/src/components/script/dom/htmlimageelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLImageElementBinding; use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLElementCast, HTMLImageElementDerived}; use dom::bindings::error::ErrorResult; -use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::trace::Untraceable; use dom::document::Document; use dom::element::{Element, HTMLImageElementTypeId}; @@ -76,7 +76,7 @@ impl HTMLImageElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLImageElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLImageElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlinputelement.rs b/src/components/script/dom/htmlinputelement.rs index f56578c6cdd..a50e73137ae 100644 --- a/src/components/script/dom/htmlinputelement.rs +++ b/src/components/script/dom/htmlinputelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLInputElementBinding; use dom::bindings::codegen::InheritTypes::HTMLInputElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::{ErrorResult, Fallible}; use dom::document::Document; use dom::element::HTMLInputElementTypeId; @@ -34,7 +34,7 @@ impl HTMLInputElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLInputElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLInputElementBinding::Wrap) } diff --git a/src/components/script/dom/htmllabelelement.rs b/src/components/script/dom/htmllabelelement.rs index c11132a7e9b..f994d73331b 100644 --- a/src/components/script/dom/htmllabelelement.rs +++ b/src/components/script/dom/htmllabelelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLLabelElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLabelElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLLabelElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLLabelElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLLabelElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLLabelElementBinding::Wrap) } diff --git a/src/components/script/dom/htmllegendelement.rs b/src/components/script/dom/htmllegendelement.rs index 22ddb92aca5..20af8e0bcf5 100644 --- a/src/components/script/dom/htmllegendelement.rs +++ b/src/components/script/dom/htmllegendelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLLegendElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLegendElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLLegendElementTypeId; @@ -34,7 +34,7 @@ impl HTMLLegendElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLLegendElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLLegendElementBinding::Wrap) } diff --git a/src/components/script/dom/htmllielement.rs b/src/components/script/dom/htmllielement.rs index 97dee3e3f25..33f46ddebc2 100644 --- a/src/components/script/dom/htmllielement.rs +++ b/src/components/script/dom/htmllielement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLLIElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLIElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLLIElementTypeId; @@ -34,7 +34,7 @@ impl HTMLLIElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLLIElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLLIElementBinding::Wrap) } diff --git a/src/components/script/dom/htmllinkelement.rs b/src/components/script/dom/htmllinkelement.rs index f40bd112585..df96b58d19f 100644 --- a/src/components/script/dom/htmllinkelement.rs +++ b/src/components/script/dom/htmllinkelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLLinkElementBinding; use dom::bindings::codegen::InheritTypes::HTMLLinkElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLLinkElementTypeId; @@ -34,7 +34,7 @@ impl HTMLLinkElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLLinkElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLLinkElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlmainelement.rs b/src/components/script/dom/htmlmainelement.rs index 4024f1ee7fa..ffd5c6cb523 100644 --- a/src/components/script/dom/htmlmainelement.rs +++ b/src/components/script/dom/htmlmainelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLMainElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMainElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLMainElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLMainElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLMainElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLMainElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlmapelement.rs b/src/components/script/dom/htmlmapelement.rs index 7c6e4b59151..681056a6be6 100644 --- a/src/components/script/dom/htmlmapelement.rs +++ b/src/components/script/dom/htmlmapelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLMapElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMapElementDerived; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLMapElementTypeId; @@ -35,7 +35,7 @@ impl HTMLMapElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLMapElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLMapElementBinding::Wrap) } @@ -44,7 +44,7 @@ impl HTMLMapElement { pub trait HTMLMapElementMethods { fn Name(&self) -> DOMString; fn SetName(&mut self, _name: DOMString) -> ErrorResult; - fn Areas(&self) -> Unrooted; + fn Areas(&self) -> Temporary; } impl<'a> HTMLMapElementMethods for JSRef<'a, HTMLMapElement> { @@ -56,7 +56,7 @@ impl<'a> HTMLMapElementMethods for JSRef<'a, HTMLMapElement> { Ok(()) } - fn Areas(&self) -> Unrooted { + fn Areas(&self) -> Temporary { let roots = RootCollection::new(); // FIXME: https://github.com/mozilla/servo/issues/1845 let window = window_from_node(self).root(&roots); diff --git a/src/components/script/dom/htmlmetaelement.rs b/src/components/script/dom/htmlmetaelement.rs index 89520346b53..cb9e6d603c1 100644 --- a/src/components/script/dom/htmlmetaelement.rs +++ b/src/components/script/dom/htmlmetaelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLMetaElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMetaElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLMetaElementTypeId; @@ -34,7 +34,7 @@ impl HTMLMetaElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLMetaElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLMetaElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlmeterelement.rs b/src/components/script/dom/htmlmeterelement.rs index 685d96f7a0b..7e4c7f42f9f 100644 --- a/src/components/script/dom/htmlmeterelement.rs +++ b/src/components/script/dom/htmlmeterelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLMeterElementBinding; use dom::bindings::codegen::InheritTypes::HTMLMeterElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLMeterElementTypeId; @@ -34,7 +34,7 @@ impl HTMLMeterElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLMeterElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLMeterElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlmodelement.rs b/src/components/script/dom/htmlmodelement.rs index 6a9b33106a2..5e77c3c8636 100644 --- a/src/components/script/dom/htmlmodelement.rs +++ b/src/components/script/dom/htmlmodelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLModElementBinding; use dom::bindings::codegen::InheritTypes::HTMLModElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLModElementTypeId; @@ -34,7 +34,7 @@ impl HTMLModElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLModElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLModElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlobjectelement.rs b/src/components/script/dom/htmlobjectelement.rs index 085bd492b11..18f8acce6b2 100644 --- a/src/components/script/dom/htmlobjectelement.rs +++ b/src/components/script/dom/htmlobjectelement.rs @@ -6,7 +6,7 @@ use dom::attr::AttrMethods; use dom::bindings::codegen::BindingDeclarations::HTMLObjectElementBinding; use dom::bindings::codegen::InheritTypes::HTMLObjectElementDerived; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::{Element, HTMLObjectElementTypeId}; @@ -48,7 +48,7 @@ impl HTMLObjectElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLObjectElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLObjectElementBinding::Wrap) } @@ -89,15 +89,15 @@ pub trait HTMLObjectElementMethods { fn SetName(&mut self, _name: DOMString) -> ErrorResult; fn UseMap(&self) -> DOMString; fn SetUseMap(&mut self, _use_map: DOMString) -> ErrorResult; - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn Width(&self) -> DOMString; fn SetWidth(&mut self, _width: DOMString) -> ErrorResult; fn Height(&self) -> DOMString; fn SetHeight(&mut self, _height: DOMString) -> ErrorResult; - fn GetContentDocument(&self) -> Option>; - fn GetContentWindow(&self) -> Option>; + fn GetContentDocument(&self) -> Option>; + fn GetContentWindow(&self) -> Option>; fn WillValidate(&self) -> bool; - fn Validity(&self) -> Unrooted; + fn Validity(&self) -> Temporary; fn ValidationMessage(&self) -> DOMString; fn CheckValidity(&self) -> bool; fn SetCustomValidity(&mut self, _error: DOMString); @@ -121,7 +121,7 @@ pub trait HTMLObjectElementMethods { fn SetCodeType(&mut self, _codetype: DOMString) -> ErrorResult; fn Border(&self) -> DOMString; fn SetBorder(&mut self, _border: DOMString) -> ErrorResult; - fn GetSVGDocument(&self) -> Option>; + fn GetSVGDocument(&self) -> Option>; } impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> { @@ -157,7 +157,7 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> { Ok(()) } - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } @@ -177,11 +177,11 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> { Ok(()) } - fn GetContentDocument(&self) -> Option> { + fn GetContentDocument(&self) -> Option> { None } - fn GetContentWindow(&self) -> Option> { + fn GetContentWindow(&self) -> Option> { None } @@ -189,7 +189,7 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> { false } - fn Validity(&self) -> Unrooted { + fn Validity(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); ValidityState::new(&*window) @@ -286,7 +286,7 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> { Ok(()) } - fn GetSVGDocument(&self) -> Option> { + fn GetSVGDocument(&self) -> Option> { None } } diff --git a/src/components/script/dom/htmlolistelement.rs b/src/components/script/dom/htmlolistelement.rs index a7191eb4f31..6b4133513b9 100644 --- a/src/components/script/dom/htmlolistelement.rs +++ b/src/components/script/dom/htmlolistelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLOListElementBinding; use dom::bindings::codegen::InheritTypes::HTMLOListElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLOListElementTypeId; @@ -34,7 +34,7 @@ impl HTMLOListElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLOListElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLOListElementBinding::Wrap) } diff --git a/src/components/script/dom/htmloptgroupelement.rs b/src/components/script/dom/htmloptgroupelement.rs index 05f4cb5ef03..74c0bde0156 100644 --- a/src/components/script/dom/htmloptgroupelement.rs +++ b/src/components/script/dom/htmloptgroupelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLOptGroupElementBinding; use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLOptGroupElementTypeId; @@ -34,7 +34,7 @@ impl HTMLOptGroupElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLOptGroupElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLOptGroupElementBinding::Wrap) } diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs index e9793fc1690..dc0c6c291d8 100644 --- a/src/components/script/dom/htmloptionelement.rs +++ b/src/components/script/dom/htmloptionelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLOptionElementBinding; use dom::bindings::codegen::InheritTypes::HTMLOptionElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLOptionElementTypeId; @@ -35,7 +35,7 @@ impl HTMLOptionElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLOptionElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLOptionElementBinding::Wrap) } @@ -44,7 +44,7 @@ impl HTMLOptionElement { pub trait HTMLOptionElementMethods { fn Disabled(&self) -> bool; fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult; - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn Label(&self) -> DOMString; fn SetLabel(&mut self, _label: DOMString) -> ErrorResult; fn DefaultSelected(&self) -> bool; @@ -67,7 +67,7 @@ impl<'a> HTMLOptionElementMethods for JSRef<'a, HTMLOptionElement> { Ok(()) } - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs index 605bb2eeab2..5bed0a4fb49 100644 --- a/src/components/script/dom/htmloutputelement.rs +++ b/src/components/script/dom/htmloutputelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLOutputElementBinding; use dom::bindings::codegen::InheritTypes::HTMLOutputElementDerived; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLOutputElementTypeId; @@ -36,14 +36,14 @@ impl HTMLOutputElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLOutputElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLOutputElementBinding::Wrap) } } pub trait HTMLOutputElementMethods { - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn Name(&self) -> DOMString; fn SetName(&mut self, _name: DOMString) -> ErrorResult; fn Type(&self) -> DOMString; @@ -53,7 +53,7 @@ pub trait HTMLOutputElementMethods { fn SetValue(&mut self, _value: DOMString) -> ErrorResult; fn WillValidate(&self) -> bool; fn SetWillValidate(&mut self, _will_validate: bool); - fn Validity(&self) -> Unrooted; + fn Validity(&self) -> Temporary; fn SetValidity(&mut self, _validity: JS); fn ValidationMessage(&self) -> DOMString; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; @@ -62,7 +62,7 @@ pub trait HTMLOutputElementMethods { } impl<'a> HTMLOutputElementMethods for JSRef<'a, HTMLOutputElement> { - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } @@ -101,7 +101,7 @@ impl<'a> HTMLOutputElementMethods for JSRef<'a, HTMLOutputElement> { fn SetWillValidate(&mut self, _will_validate: bool) { } - fn Validity(&self) -> Unrooted { + fn Validity(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); ValidityState::new(&*window) diff --git a/src/components/script/dom/htmlparagraphelement.rs b/src/components/script/dom/htmlparagraphelement.rs index 90e3282c915..9bb6160d300 100644 --- a/src/components/script/dom/htmlparagraphelement.rs +++ b/src/components/script/dom/htmlparagraphelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLParagraphElementBinding; use dom::bindings::codegen::InheritTypes::HTMLParagraphElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLParagraphElementTypeId; @@ -34,7 +34,7 @@ impl HTMLParagraphElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLParagraphElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLParagraphElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlparamelement.rs b/src/components/script/dom/htmlparamelement.rs index 41f45b31d17..c5a727c12a5 100644 --- a/src/components/script/dom/htmlparamelement.rs +++ b/src/components/script/dom/htmlparamelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLParamElementBinding; use dom::bindings::codegen::InheritTypes::HTMLParamElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLParamElementTypeId; @@ -34,7 +34,7 @@ impl HTMLParamElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLParamElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLParamElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlpreelement.rs b/src/components/script/dom/htmlpreelement.rs index 34eb9923a52..b43b18c3028 100644 --- a/src/components/script/dom/htmlpreelement.rs +++ b/src/components/script/dom/htmlpreelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLPreElementBinding; use dom::bindings::codegen::InheritTypes::HTMLPreElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLPreElementTypeId; @@ -34,7 +34,7 @@ impl HTMLPreElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLPreElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLPreElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlprogresselement.rs b/src/components/script/dom/htmlprogresselement.rs index 891df6918fe..800bd7df9ff 100644 --- a/src/components/script/dom/htmlprogresselement.rs +++ b/src/components/script/dom/htmlprogresselement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLProgressElementBinding; use dom::bindings::codegen::InheritTypes::HTMLProgressElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::{ErrorResult, Fallible}; use dom::document::Document; use dom::element::HTMLProgressElementTypeId; @@ -34,7 +34,7 @@ impl HTMLProgressElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLProgressElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLProgressElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlquoteelement.rs b/src/components/script/dom/htmlquoteelement.rs index db7edcbede4..a2c50a8082d 100644 --- a/src/components/script/dom/htmlquoteelement.rs +++ b/src/components/script/dom/htmlquoteelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLQuoteElementBinding; use dom::bindings::codegen::InheritTypes::HTMLQuoteElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLQuoteElementTypeId; @@ -34,7 +34,7 @@ impl HTMLQuoteElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLQuoteElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLQuoteElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlscriptelement.rs b/src/components/script/dom/htmlscriptelement.rs index 4d7780d49f7..b392fbb95d2 100644 --- a/src/components/script/dom/htmlscriptelement.rs +++ b/src/components/script/dom/htmlscriptelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLScriptElementBinding; use dom::bindings::codegen::InheritTypes::HTMLScriptElementDerived; use dom::bindings::codegen::InheritTypes::ElementCast; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::{HTMLScriptElementTypeId, Element, AttributeHandlers}; @@ -35,7 +35,7 @@ impl HTMLScriptElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLScriptElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLScriptElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlselectelement.rs b/src/components/script/dom/htmlselectelement.rs index ed99506f01d..8c349315849 100644 --- a/src/components/script/dom/htmlselectelement.rs +++ b/src/components/script/dom/htmlselectelement.rs @@ -5,7 +5,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLSelectElementBinding; use dom::bindings::codegen::InheritTypes::HTMLSelectElementDerived; use dom::bindings::codegen::UnionTypes::{HTMLElementOrLong, HTMLOptionElementOrHTMLOptGroupElement}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::{Element, HTMLSelectElementTypeId}; @@ -38,7 +38,7 @@ impl HTMLSelectElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLSelectElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLSelectElementBinding::Wrap) } @@ -49,7 +49,7 @@ pub trait HTMLSelectElementMethods { fn SetAutofocus(&mut self, _autofocus: bool) -> ErrorResult; fn Disabled(&self) -> bool; fn SetDisabled(&mut self, _disabled: bool) -> ErrorResult; - fn GetForm(&self) -> Option>; + fn GetForm(&self) -> Option>; fn Multiple(&self) -> bool; fn SetMultiple(&mut self, _multiple: bool) -> ErrorResult; fn Name(&self) -> DOMString; @@ -61,9 +61,9 @@ pub trait HTMLSelectElementMethods { fn Type(&self) -> DOMString; fn Length(&self) -> u32; fn SetLength(&mut self, _length: u32) -> ErrorResult; - fn Item(&self, _index: u32) -> Option>; - fn NamedItem(&self, _name: DOMString) -> Option>; - fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option>; + fn Item(&self, _index: u32) -> Option>; + fn NamedItem(&self, _name: DOMString) -> Option>; + fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option>; fn IndexedSetter(&mut self, _index: u32, _option: Option>) -> ErrorResult; fn Remove_(&self); fn Remove(&self, _index: i32); @@ -73,7 +73,7 @@ pub trait HTMLSelectElementMethods { fn SetValue(&mut self, _value: DOMString); fn WillValidate(&self) -> bool; fn SetWillValidate(&mut self, _will_validate: bool); - fn Validity(&self) -> Unrooted; + fn Validity(&self) -> Temporary; fn SetValidity(&mut self, _validity: JS); fn ValidationMessage(&self) -> DOMString; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; @@ -99,7 +99,7 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> { Ok(()) } - fn GetForm(&self) -> Option> { + fn GetForm(&self) -> Option> { None } @@ -147,15 +147,15 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> { Ok(()) } - fn Item(&self, _index: u32) -> Option> { + fn Item(&self, _index: u32) -> Option> { None } - fn NamedItem(&self, _name: DOMString) -> Option> { + fn NamedItem(&self, _name: DOMString) -> Option> { None } - fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option> { + fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option> { None } @@ -191,7 +191,7 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> { fn SetWillValidate(&mut self, _will_validate: bool) { } - fn Validity(&self) -> Unrooted { + fn Validity(&self) -> Temporary { let roots = RootCollection::new(); let window = window_from_node(self).root(&roots); ValidityState::new(&*window) diff --git a/src/components/script/dom/htmlsourceelement.rs b/src/components/script/dom/htmlsourceelement.rs index 76d7cb28bab..41586e55401 100644 --- a/src/components/script/dom/htmlsourceelement.rs +++ b/src/components/script/dom/htmlsourceelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLSourceElementBinding; use dom::bindings::codegen::InheritTypes::HTMLSourceElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLSourceElementTypeId; @@ -34,7 +34,7 @@ impl HTMLSourceElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLSourceElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLSourceElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlspanelement.rs b/src/components/script/dom/htmlspanelement.rs index dac10e30b68..79beef28cab 100644 --- a/src/components/script/dom/htmlspanelement.rs +++ b/src/components/script/dom/htmlspanelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLSpanElementBinding; use dom::bindings::codegen::InheritTypes::HTMLSpanElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLSpanElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLSpanElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLSpanElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLSpanElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlstyleelement.rs b/src/components/script/dom/htmlstyleelement.rs index 94255fe92a9..1ee1408e9ef 100644 --- a/src/components/script/dom/htmlstyleelement.rs +++ b/src/components/script/dom/htmlstyleelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLStyleElementBinding; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLStyleElementDerived, NodeCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLStyleElementTypeId; @@ -37,7 +37,7 @@ impl HTMLStyleElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLStyleElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLStyleElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index 45f3d6ec079..cc99c839e80 100644 --- a/src/components/script/dom/htmltablecaptionelement.rs +++ b/src/components/script/dom/htmltablecaptionelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableCaptionElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableCaptionElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTableCaptionElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTableCaptionElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableCaptionElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableCaptionElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index 97c85275ee9..e387e5ad2cc 100644 --- a/src/components/script/dom/htmltablecolelement.rs +++ b/src/components/script/dom/htmltablecolelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableColElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableColElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTableColElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTableColElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableColElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableColElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltabledatacellelement.rs b/src/components/script/dom/htmltabledatacellelement.rs index 359e2837744..d9c0f208bff 100644 --- a/src/components/script/dom/htmltabledatacellelement.rs +++ b/src/components/script/dom/htmltabledatacellelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableDataCellElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableDataCellElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLTableDataCellElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLTableDataCellElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableDataCellElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableDataCellElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltableelement.rs b/src/components/script/dom/htmltableelement.rs index 6451e2d7276..bebf407b73a 100644 --- a/src/components/script/dom/htmltableelement.rs +++ b/src/components/script/dom/htmltableelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTableElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTableElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltableheadercellelement.rs b/src/components/script/dom/htmltableheadercellelement.rs index ce1dc6a8241..beb9c5e2f97 100644 --- a/src/components/script/dom/htmltableheadercellelement.rs +++ b/src/components/script/dom/htmltableheadercellelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableHeaderCellElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableHeaderCellElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLTableHeaderCellElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLTableHeaderCellElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableHeaderCellElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableHeaderCellElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltablerowelement.rs b/src/components/script/dom/htmltablerowelement.rs index d7d05516798..0d949741b4c 100644 --- a/src/components/script/dom/htmltablerowelement.rs +++ b/src/components/script/dom/htmltablerowelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableRowElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableRowElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTableRowElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTableRowElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableRowElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableRowElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltablesectionelement.rs b/src/components/script/dom/htmltablesectionelement.rs index 62dd52e9758..5eefa98722a 100644 --- a/src/components/script/dom/htmltablesectionelement.rs +++ b/src/components/script/dom/htmltablesectionelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTableSectionElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTableSectionElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTableSectionElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTableSectionElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTableSectionElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltemplateelement.rs b/src/components/script/dom/htmltemplateelement.rs index 245ce104439..8e3b8d115ed 100644 --- a/src/components/script/dom/htmltemplateelement.rs +++ b/src/components/script/dom/htmltemplateelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTemplateElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTemplateElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLTemplateElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLTemplateElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTemplateElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTemplateElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltextareaelement.rs b/src/components/script/dom/htmltextareaelement.rs index 2005a6384e4..7e221cbbd3e 100644 --- a/src/components/script/dom/htmltextareaelement.rs +++ b/src/components/script/dom/htmltextareaelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTextAreaElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTextAreaElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::{ErrorResult, Fallible}; use dom::document::Document; use dom::element::HTMLTextAreaElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTextAreaElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTextAreaElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTextAreaElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltimeelement.rs b/src/components/script/dom/htmltimeelement.rs index dd2a9b28f97..15e8101561f 100644 --- a/src/components/script/dom/htmltimeelement.rs +++ b/src/components/script/dom/htmltimeelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTimeElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTimeElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTimeElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTimeElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTimeElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTimeElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltitleelement.rs b/src/components/script/dom/htmltitleelement.rs index c78b26ee4cb..5f7016bc96c 100644 --- a/src/components/script/dom/htmltitleelement.rs +++ b/src/components/script/dom/htmltitleelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTitleElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTitleElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTitleElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTitleElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTitleElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTitleElementBinding::Wrap) } diff --git a/src/components/script/dom/htmltrackelement.rs b/src/components/script/dom/htmltrackelement.rs index db25ab17130..b2b2b077c78 100644 --- a/src/components/script/dom/htmltrackelement.rs +++ b/src/components/script/dom/htmltrackelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLTrackElementBinding; use dom::bindings::codegen::InheritTypes::HTMLTrackElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLTrackElementTypeId; @@ -34,7 +34,7 @@ impl HTMLTrackElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLTrackElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLTrackElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlulistelement.rs b/src/components/script/dom/htmlulistelement.rs index bed085157ce..5d5bd0b61da 100644 --- a/src/components/script/dom/htmlulistelement.rs +++ b/src/components/script/dom/htmlulistelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLUListElementBinding; use dom::bindings::codegen::InheritTypes::HTMLUListElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLUListElementTypeId; @@ -34,7 +34,7 @@ impl HTMLUListElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLUListElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLUListElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlunknownelement.rs b/src/components/script/dom/htmlunknownelement.rs index da14d35b69f..2fbf2906c3d 100644 --- a/src/components/script/dom/htmlunknownelement.rs +++ b/src/components/script/dom/htmlunknownelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLUnknownElementBinding; use dom::bindings::codegen::InheritTypes::HTMLUnknownElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::document::Document; use dom::element::HTMLUnknownElementTypeId; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -33,7 +33,7 @@ impl HTMLUnknownElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLUnknownElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLUnknownElementBinding::Wrap) } diff --git a/src/components/script/dom/htmlvideoelement.rs b/src/components/script/dom/htmlvideoelement.rs index 60e9d6a09cf..68925daacee 100644 --- a/src/components/script/dom/htmlvideoelement.rs +++ b/src/components/script/dom/htmlvideoelement.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::HTMLVideoElementBinding; use dom::bindings::codegen::InheritTypes::HTMLVideoElementDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::error::ErrorResult; use dom::document::Document; use dom::element::HTMLVideoElementTypeId; @@ -34,7 +34,7 @@ impl HTMLVideoElement { } } - pub fn new(localName: DOMString, document: &JSRef) -> Unrooted { + pub fn new(localName: DOMString, document: &JSRef) -> Temporary { let element = HTMLVideoElement::new_inherited(localName, document.unrooted()); Node::reflect_node(~element, document, HTMLVideoElementBinding::Wrap) } diff --git a/src/components/script/dom/location.rs b/src/components/script/dom/location.rs index 4a28e1c449d..72769bc0a37 100644 --- a/src/components/script/dom/location.rs +++ b/src/components/script/dom/location.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::LocationBinding; -use dom::bindings::js::{JSRef, Unrooted}; +use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::Fallible; use dom::window::Window; @@ -29,7 +29,7 @@ impl Location { } } - pub fn new(window: &JSRef, page: Rc) -> Unrooted { + pub fn new(window: &JSRef, page: Rc) -> Temporary { reflect_dom_object(~Location::new_inherited(page), window, LocationBinding::Wrap) diff --git a/src/components/script/dom/mouseevent.rs b/src/components/script/dom/mouseevent.rs index fbfc9cf783d..ce46cd47680 100644 --- a/src/components/script/dom/mouseevent.rs +++ b/src/components/script/dom/mouseevent.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::MouseEventBinding; use dom::bindings::codegen::InheritTypes::{UIEventCast, MouseEventDerived}; -use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Temporary}; use dom::bindings::error::Fallible; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::event::{Event, MouseEventTypeId}; @@ -51,7 +51,7 @@ impl MouseEvent { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~MouseEvent::new_inherited(), window, MouseEventBinding::Wrap) @@ -59,7 +59,7 @@ impl MouseEvent { pub fn Constructor(owner: &JSRef, type_: DOMString, - init: &MouseEventBinding::MouseEventInit) -> Fallible> { + init: &MouseEventBinding::MouseEventInit) -> Fallible> { let roots = RootCollection::new(); let mut ev = MouseEvent::new(owner).root(&roots); let view = init.view.as_ref().map(|view| view.root(&roots)); @@ -69,7 +69,7 @@ impl MouseEvent { init.clientX, init.clientY, init.ctrlKey, init.altKey, init.shiftKey, init.metaKey, init.button, related_target.root_ref()); - Ok(Unrooted::new_rooted(&*ev)) + Ok(Temporary::new_rooted(&*ev)) } } @@ -84,7 +84,7 @@ pub trait MouseEventMethods { fn MetaKey(&self) -> bool; fn Button(&self) -> u16; fn Buttons(&self)-> u16; - fn GetRelatedTarget(&self) -> Option>; + fn GetRelatedTarget(&self) -> Option>; fn GetModifierState(&self, _keyArg: DOMString) -> bool; fn InitMouseEvent(&mut self, typeArg: DOMString, @@ -146,8 +146,8 @@ impl<'a> MouseEventMethods for JSRef<'a, MouseEvent> { 0 } - fn GetRelatedTarget(&self) -> Option> { - self.related_target.clone().map(|target| Unrooted::new(target)) + fn GetRelatedTarget(&self) -> Option> { + self.related_target.clone().map(|target| Temporary::new(target)) } fn GetModifierState(&self, _keyArg: DOMString) -> bool { diff --git a/src/components/script/dom/navigator.rs b/src/components/script/dom/navigator.rs index 9e54bffb0c1..2e31fbe8cbb 100644 --- a/src/components/script/dom/navigator.rs +++ b/src/components/script/dom/navigator.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::NavigatorBinding; -use dom::bindings::js::{JSRef, Unrooted}; +use dom::bindings::js::{JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::Fallible; use dom::window::Window; @@ -21,7 +21,7 @@ impl Navigator { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~Navigator::new_inherited(), window, NavigatorBinding::Wrap) diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs index 99daa05e1a5..07b9ecd111d 100644 --- a/src/components/script/dom/node.rs +++ b/src/components/script/dom/node.rs @@ -10,8 +10,8 @@ use dom::bindings::codegen::InheritTypes::{ElementCast, TextCast, NodeCast, Elem use dom::bindings::codegen::InheritTypes::{CharacterDataCast, NodeBase, NodeDerived}; use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, EventTargetCast}; use dom::bindings::codegen::BindingDeclarations::NodeBinding::NodeConstants; -use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Unrooted, Root}; -use dom::bindings::js::{OptionalAssignable, UnrootedPushable, OptionalRootedRootable}; +use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Temporary, Root}; +use dom::bindings::js::{OptionalAssignable, TemporaryPushable, OptionalRootedRootable}; use dom::bindings::js::{ResultRootable, OptionalRootable}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::error::{ErrorResult, Fallible, NotFound, HierarchyRequest}; @@ -403,13 +403,13 @@ pub trait NodeHelpers { fn type_id(&self) -> NodeTypeId; - fn parent_node(&self) -> Option>; - fn first_child(&self) -> Option>; - fn last_child(&self) -> Option>; - fn prev_sibling(&self) -> Option>; - fn next_sibling(&self) -> Option>; + fn parent_node(&self) -> Option>; + fn first_child(&self) -> Option>; + fn last_child(&self) -> Option>; + fn prev_sibling(&self) -> Option>; + fn next_sibling(&self) -> Option>; - fn owner_doc(&self) -> Unrooted; + fn owner_doc(&self) -> Temporary; fn set_owner_doc(&mut self, document: &JSRef); fn wait_until_safe_to_modify_dom(&self); @@ -473,26 +473,26 @@ impl<'a> NodeHelpers for JSRef<'a, Node> { self.get().type_id } - fn parent_node(&self) -> Option> { - self.get().parent_node.clone().map(|node| Unrooted::new(node)) + fn parent_node(&self) -> Option> { + self.get().parent_node.clone().map(|node| Temporary::new(node)) } - fn first_child(&self) -> Option> { - self.get().first_child.clone().map(|node| Unrooted::new(node)) + fn first_child(&self) -> Option> { + self.get().first_child.clone().map(|node| Temporary::new(node)) } - fn last_child(&self) -> Option> { - self.get().last_child.clone().map(|node| Unrooted::new(node)) + fn last_child(&self) -> Option> { + self.get().last_child.clone().map(|node| Temporary::new(node)) } /// Returns the previous sibling of this node. Fails if this node is borrowed mutably. - fn prev_sibling(&self) -> Option> { - self.get().prev_sibling.clone().map(|node| Unrooted::new(node)) + fn prev_sibling(&self) -> Option> { + self.get().prev_sibling.clone().map(|node| Temporary::new(node)) } /// Returns the next sibling of this node. Fails if this node is borrowed mutably. - fn next_sibling(&self) -> Option> { - self.get().next_sibling.clone().map(|node| Unrooted::new(node)) + fn next_sibling(&self) -> Option> { + self.get().next_sibling.clone().map(|node| Temporary::new(node)) } #[inline] @@ -581,7 +581,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> { fn is_parent_of(&self, child: &JSRef) -> bool { match child.parent_node() { - Some(ref parent) if *parent == Unrooted::new_rooted(self) => true, + Some(ref parent) if *parent == Temporary::new_rooted(self) => true, _ => false } } @@ -618,8 +618,8 @@ impl<'a> NodeHelpers for JSRef<'a, Node> { } } - fn owner_doc(&self) -> Unrooted { - Unrooted::new(self.owner_doc.get_ref().clone()) + fn owner_doc(&self) -> Temporary { + Temporary::new(self.owner_doc.get_ref().clone()) } fn set_owner_doc(&mut self, document: &JSRef) { @@ -656,7 +656,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> { /// If the given untrusted node address represents a valid DOM node in the given runtime, /// returns it. pub fn from_untrusted_node_address(runtime: *JSRuntime, candidate: UntrustedNodeAddress) - -> Unrooted { + -> Temporary { unsafe { let candidate: uintptr_t = cast::transmute(candidate); let object: *JSObject = jsfriendapi::bindgen::JS_GetAddressableObject(runtime, @@ -665,7 +665,7 @@ pub fn from_untrusted_node_address(runtime: *JSRuntime, candidate: UntrustedNode fail!("Attempted to create a `JS` from an invalid pointer!") } let boxed_node: *mut Node = utils::unwrap(object); - Unrooted::new(JS::from_raw(boxed_node)) + Temporary::new(JS::from_raw(boxed_node)) } } @@ -913,13 +913,13 @@ impl Node { (node: ~N, document: &JSRef, wrap_fn: extern "Rust" fn(*JSContext, &JSRef, ~N) -> JS) - -> Unrooted { + -> Temporary { let roots = RootCollection::new(); assert!(node.reflector().get_jsobject().is_null()); let window = document.get().window.root(&roots); let node = reflect_dom_object(node, &window.root_ref(), wrap_fn).root(&roots); assert!(node.reflector().get_jsobject().is_not_null()); - Unrooted::new_rooted(&*node) + Temporary::new_rooted(&*node) } pub fn new_inherited(type_id: NodeTypeId, doc: JS) -> Node { @@ -977,7 +977,7 @@ impl Node { // http://dom.spec.whatwg.org/#concept-node-pre-insert fn pre_insert(node: &mut JSRef, parent: &mut JSRef, child: Option>) - -> Fallible> { + -> Fallible> { let roots = RootCollection::new(); // Step 1. match parent.type_id() { @@ -1110,7 +1110,7 @@ impl Node { Node::insert(node, parent, referenceChild, Unsuppressed); // Step 11. - return Ok(Unrooted::new_rooted(node)) + return Ok(Temporary::new_rooted(node)) } // http://dom.spec.whatwg.org/#concept-node-insert @@ -1203,10 +1203,10 @@ impl Node { } // http://dom.spec.whatwg.org/#concept-node-pre-remove - fn pre_remove(child: &mut JSRef, parent: &mut JSRef) -> Fallible> { + fn pre_remove(child: &mut JSRef, parent: &mut JSRef) -> Fallible> { // Step 1. match child.parent_node() { - Some(ref node) if *node != Unrooted::new_rooted(parent) => return Err(NotFound), + Some(ref node) if *node != Temporary::new_rooted(parent) => return Err(NotFound), _ => () } @@ -1214,12 +1214,12 @@ impl Node { Node::remove(child, parent, Unsuppressed); // Step 3. - Ok(Unrooted::new_rooted(child)) + Ok(Temporary::new_rooted(child)) } // http://dom.spec.whatwg.org/#concept-node-remove fn remove(node: &mut JSRef, parent: &mut JSRef, suppress_observers: SuppressObserver) { - assert!(node.parent_node().map_or(false, |node_parent| node_parent == Unrooted::new_rooted(parent))); + assert!(node.parent_node().map_or(false, |node_parent| node_parent == Temporary::new_rooted(parent))); // Step 1-5: ranges. // Step 6-7: mutation observers. @@ -1236,7 +1236,7 @@ impl Node { // http://dom.spec.whatwg.org/#concept-node-clone pub fn clone(node: &JSRef, maybe_doc: Option<&JSRef>, - clone_children: CloneChildrenFlag) -> Unrooted { + clone_children: CloneChildrenFlag) -> Temporary { let roots = RootCollection::new(); // Step 1. @@ -1349,7 +1349,7 @@ impl Node { } // Step 7. - Unrooted::new_rooted(&*copy) + Temporary::new_rooted(&*copy) } /// Sends layout data, if any, back to the script task to be destroyed. @@ -1372,25 +1372,25 @@ pub trait NodeMethods { fn NodeType(&self) -> u16; fn NodeName(&self) -> DOMString; fn GetBaseURI(&self) -> Option; - fn GetOwnerDocument(&self) -> Option>; - fn GetParentNode(&self) -> Option>; - fn GetParentElement(&self) -> Option>; + fn GetOwnerDocument(&self) -> Option>; + fn GetParentNode(&self) -> Option>; + fn GetParentElement(&self) -> Option>; fn HasChildNodes(&self) -> bool; - fn ChildNodes(&mut self) -> Unrooted; - fn GetFirstChild(&self) -> Option>; - fn GetLastChild(&self) -> Option>; - fn GetPreviousSibling(&self) -> Option>; - fn GetNextSibling(&self) -> Option>; + fn ChildNodes(&mut self) -> Temporary; + fn GetFirstChild(&self) -> Option>; + fn GetLastChild(&self) -> Option>; + fn GetPreviousSibling(&self) -> Option>; + fn GetNextSibling(&self) -> Option>; fn GetNodeValue(&self) -> Option; fn SetNodeValue(&mut self, val: Option) -> ErrorResult; fn GetTextContent(&self) -> Option; fn SetTextContent(&mut self, value: Option) -> ErrorResult; - fn InsertBefore(&mut self, node: &mut JSRef, child: Option>) -> Fallible>; - fn AppendChild(&mut self, node: &mut JSRef) -> Fallible>; - fn ReplaceChild(&mut self, node: &mut JSRef, child: &mut JSRef) -> Fallible>; - fn RemoveChild(&mut self, node: &mut JSRef) -> Fallible>; + fn InsertBefore(&mut self, node: &mut JSRef, child: Option>) -> Fallible>; + fn AppendChild(&mut self, node: &mut JSRef) -> Fallible>; + fn ReplaceChild(&mut self, node: &mut JSRef, child: &mut JSRef) -> Fallible>; + fn RemoveChild(&mut self, node: &mut JSRef) -> Fallible>; fn Normalize(&mut self); - fn CloneNode(&self, deep: bool) -> Unrooted; + fn CloneNode(&self, deep: bool) -> Temporary; fn IsEqualNode(&self, maybe_node: Option>) -> bool; fn CompareDocumentPosition(&self, other: &JSRef) -> u16; fn Contains(&self, maybe_other: Option>) -> bool; @@ -1443,7 +1443,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-node-ownerdocument - fn GetOwnerDocument(&self) -> Option> { + fn GetOwnerDocument(&self) -> Option> { match self.type_id { ElementNodeTypeId(..) | CommentNodeTypeId | @@ -1456,18 +1456,18 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-node-parentnode - fn GetParentNode(&self) -> Option> { - self.parent_node.clone().map(|node| Unrooted::new(node)) + fn GetParentNode(&self) -> Option> { + self.parent_node.clone().map(|node| Temporary::new(node)) } // http://dom.spec.whatwg.org/#dom-node-parentelement - fn GetParentElement(&self) -> Option> { + fn GetParentElement(&self) -> Option> { let roots = RootCollection::new(); self.parent_node.clone() .and_then(|parent| { let parent = parent.root(&roots); ElementCast::to_ref(&*parent).map(|elem| { - Unrooted::new_rooted(elem) + Temporary::new_rooted(elem) }) }) } @@ -1478,38 +1478,38 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-node-childnodes - fn ChildNodes(&mut self) -> Unrooted { + fn ChildNodes(&mut self) -> Temporary { let roots = RootCollection::new(); match self.child_list { None => (), - Some(ref list) => return Unrooted::new(list.clone()), + Some(ref list) => return Temporary::new(list.clone()), } let doc = self.owner_doc().root(&roots); let window = doc.deref().window.root(&roots); let child_list = NodeList::new_child_list(&*window, self); self.child_list.assign(Some(child_list)); - Unrooted::new(self.child_list.get_ref().clone()) + Temporary::new(self.child_list.get_ref().clone()) } // http://dom.spec.whatwg.org/#dom-node-firstchild - fn GetFirstChild(&self) -> Option> { - self.first_child.clone().map(|node| Unrooted::new(node)) + fn GetFirstChild(&self) -> Option> { + self.first_child.clone().map(|node| Temporary::new(node)) } // http://dom.spec.whatwg.org/#dom-node-lastchild - fn GetLastChild(&self) -> Option> { - self.last_child.clone().map(|node| Unrooted::new(node)) + fn GetLastChild(&self) -> Option> { + self.last_child.clone().map(|node| Temporary::new(node)) } // http://dom.spec.whatwg.org/#dom-node-previoussibling - fn GetPreviousSibling(&self) -> Option> { - self.prev_sibling.clone().map(|node| Unrooted::new(node)) + fn GetPreviousSibling(&self) -> Option> { + self.prev_sibling.clone().map(|node| Temporary::new(node)) } // http://dom.spec.whatwg.org/#dom-node-nextsibling - fn GetNextSibling(&self) -> Option> { - self.next_sibling.clone().map(|node| Unrooted::new(node)) + fn GetNextSibling(&self) -> Option> { + self.next_sibling.clone().map(|node| Temporary::new(node)) } // http://dom.spec.whatwg.org/#dom-node-nodevalue @@ -1608,17 +1608,17 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-node-insertbefore - fn InsertBefore(&mut self, node: &mut JSRef, child: Option>) -> Fallible> { + fn InsertBefore(&mut self, node: &mut JSRef, child: Option>) -> Fallible> { Node::pre_insert(node, self, child) } // http://dom.spec.whatwg.org/#dom-node-appendchild - fn AppendChild(&mut self, node: &mut JSRef) -> Fallible> { + fn AppendChild(&mut self, node: &mut JSRef) -> Fallible> { Node::pre_insert(node, self, None) } // http://dom.spec.whatwg.org/#concept-node-replace - fn ReplaceChild(&mut self, node: &mut JSRef, child: &mut JSRef) -> Fallible> { + fn ReplaceChild(&mut self, node: &mut JSRef, child: &mut JSRef) -> Fallible> { let roots = RootCollection::new(); // Step 1. @@ -1710,7 +1710,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> { // Ok if not caught by previous error checks. if node.unrooted() == child.unrooted() { - return Ok(Unrooted::new_rooted(child)); + return Ok(Temporary::new_rooted(child)); } // Step 7-8. @@ -1744,12 +1744,12 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // Step 15. - Ok(Unrooted::new_rooted(child)) + Ok(Temporary::new_rooted(child)) } // http://dom.spec.whatwg.org/#dom-node-removechild fn RemoveChild(&mut self, node: &mut JSRef) - -> Fallible> { + -> Fallible> { Node::pre_remove(node, self) } @@ -1782,7 +1782,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> { } // http://dom.spec.whatwg.org/#dom-node-clonenode - fn CloneNode(&self, deep: bool) -> Unrooted { + fn CloneNode(&self, deep: bool) -> Temporary { match deep { true => Node::clone(self, None, CloneChildren), false => Node::clone(self, None, DoNotCloneChildren) @@ -1959,15 +1959,15 @@ impl Reflectable for Node { } } -pub fn document_from_node(derived: &JSRef) -> Unrooted { +pub fn document_from_node(derived: &JSRef) -> Temporary { let node: &JSRef = NodeCast::from_ref(derived); node.owner_doc() } -pub fn window_from_node(derived: &JSRef) -> Unrooted { +pub fn window_from_node(derived: &JSRef) -> Temporary { let roots = RootCollection::new(); let document = document_from_node(derived).root(&roots); - Unrooted::new(document.deref().window.clone()) + Temporary::new(document.deref().window.clone()) } impl<'a> VirtualMethods for JSRef<'a, Node> { diff --git a/src/components/script/dom/nodelist.rs b/src/components/script/dom/nodelist.rs index a874a068b65..7157c7ec061 100644 --- a/src/components/script/dom/nodelist.rs +++ b/src/components/script/dom/nodelist.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::NodeListBinding; -use dom::bindings::js::{JS, JSRef, Unrooted, RootCollection}; +use dom::bindings::js::{JS, JSRef, Temporary, RootCollection}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::node::{Node, NodeHelpers}; use dom::window::Window; @@ -32,24 +32,24 @@ impl NodeList { } pub fn new(window: &JSRef, - list_type: NodeListType) -> Unrooted { + list_type: NodeListType) -> Temporary { reflect_dom_object(~NodeList::new_inherited(window.unrooted(), list_type), window, NodeListBinding::Wrap) } - pub fn new_simple_list(window: &JSRef, elements: Vec>) -> Unrooted { + pub fn new_simple_list(window: &JSRef, elements: Vec>) -> Temporary { NodeList::new(window, Simple(elements.iter().map(|element| element.unrooted()).collect())) } - pub fn new_child_list(window: &JSRef, node: &JSRef) -> Unrooted { + pub fn new_child_list(window: &JSRef, node: &JSRef) -> Temporary { NodeList::new(window, Children(node.unrooted())) } } pub trait NodeListMethods { fn Length(&self) -> u32; - fn Item(&self, index: u32) -> Option>; - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; + fn Item(&self, index: u32) -> Option>; + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option>; } impl<'a> NodeListMethods for JSRef<'a, NodeList> { @@ -64,20 +64,20 @@ impl<'a> NodeListMethods for JSRef<'a, NodeList> { } } - fn Item(&self, index: u32) -> Option> { + fn Item(&self, index: u32) -> Option> { let roots = RootCollection::new(); match self.list_type { _ if index >= self.Length() => None, - Simple(ref elems) => Some(Unrooted::new(elems.get(index as uint).clone())), + Simple(ref elems) => Some(Temporary::new(elems.get(index as uint).clone())), Children(ref node) => { let node = node.root(&roots); node.deref().children().nth(index as uint) - .map(|child| Unrooted::new_rooted(&child)) + .map(|child| Temporary::new_rooted(&child)) } } } - fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { + fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option> { let item = self.Item(index); *found = item.is_some(); item diff --git a/src/components/script/dom/processinginstruction.rs b/src/components/script/dom/processinginstruction.rs index ee88cb51bf6..9a00333fd93 100644 --- a/src/components/script/dom/processinginstruction.rs +++ b/src/components/script/dom/processinginstruction.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::ProcessingInstructionBinding; use dom::bindings::codegen::InheritTypes::ProcessingInstructionDerived; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::characterdata::CharacterData; use dom::document::Document; use dom::eventtarget::{EventTarget, NodeTargetTypeId}; @@ -35,7 +35,7 @@ impl ProcessingInstruction { } } - pub fn new(target: DOMString, data: DOMString, document: &JSRef) -> Unrooted { + pub fn new(target: DOMString, data: DOMString, document: &JSRef) -> Temporary { let node = ProcessingInstruction::new_inherited(target, data, document.unrooted()); Node::reflect_node(~node, document, ProcessingInstructionBinding::Wrap) } diff --git a/src/components/script/dom/testbinding.rs b/src/components/script/dom/testbinding.rs index 3ad4f8fa202..2c012c1b911 100644 --- a/src/components/script/dom/testbinding.rs +++ b/src/components/script/dom/testbinding.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::codegen::BindingDeclarations::TestBindingBinding; use dom::bindings::codegen::UnionTypes::HTMLElementOrLong; use self::TestBindingBinding::TestEnum; @@ -51,7 +51,7 @@ pub trait TestBindingMethods { fn SetByteStringAttribute(&self, _: ByteString); fn EnumAttribute(&self) -> TestEnum; fn SetEnumAttribute(&self, _: TestEnum); - fn InterfaceAttribute(&self) -> Unrooted; + fn InterfaceAttribute(&self) -> Temporary; fn SetInterfaceAttribute(&self, _: &JSRef); fn AnyAttribute(&self, _: *JSContext) -> JSVal; fn SetAnyAttribute(&self, _: *JSContext, _: JSVal); @@ -83,7 +83,7 @@ pub trait TestBindingMethods { fn GetStringAttributeNullable(&self) -> Option; fn SetStringAttributeNullable(&self, _: Option); fn GetEnumAttributeNullable(&self) -> Option; - fn GetInterfaceAttributeNullable(&self) -> Option>; + fn GetInterfaceAttributeNullable(&self) -> Option>; fn SetInterfaceAttributeNullable(&self, _: Option>); fn PassBoolean(&self, _: bool); @@ -231,7 +231,7 @@ impl<'a> TestBindingMethods for JSRef<'a, TestBinding> { fn SetByteStringAttribute(&self, _: ByteString) {} fn EnumAttribute(&self) -> TestEnum { _empty } fn SetEnumAttribute(&self, _: TestEnum) {} - fn InterfaceAttribute(&self) -> Unrooted { + fn InterfaceAttribute(&self) -> Temporary { let roots = RootCollection::new(); let window = self.window.root(&roots); Blob::new(&*window) @@ -267,7 +267,7 @@ impl<'a> TestBindingMethods for JSRef<'a, TestBinding> { fn GetStringAttributeNullable(&self) -> Option { Some(~"") } fn SetStringAttributeNullable(&self, _: Option) {} fn GetEnumAttributeNullable(&self) -> Option { Some(_empty) } - fn GetInterfaceAttributeNullable(&self) -> Option> { + fn GetInterfaceAttributeNullable(&self) -> Option> { let roots = RootCollection::new(); let window = self.window.root(&roots); Some(Blob::new(&(*window))) diff --git a/src/components/script/dom/text.rs b/src/components/script/dom/text.rs index 570c1412833..be62565f965 100644 --- a/src/components/script/dom/text.rs +++ b/src/components/script/dom/text.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::TextBinding; use dom::bindings::codegen::InheritTypes::TextDerived; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary}; use dom::bindings::error::Fallible; use dom::characterdata::CharacterData; use dom::document::Document; @@ -35,12 +35,12 @@ impl Text { } } - pub fn new(text: DOMString, document: &JSRef) -> Unrooted { + pub fn new(text: DOMString, document: &JSRef) -> Temporary { let node = Text::new_inherited(text, document.unrooted()); Node::reflect_node(~node, document, TextBinding::Wrap) } - pub fn Constructor(owner: &JSRef, text: DOMString) -> Fallible> { + pub fn Constructor(owner: &JSRef, text: DOMString) -> Fallible> { let roots = RootCollection::new(); let document = owner.Document().root(&roots); Ok(Text::new(text.clone(), &*document)) @@ -48,12 +48,12 @@ impl Text { } pub trait TextMethods { - fn SplitText(&self, _offset: u32) -> Fallible>; + fn SplitText(&self, _offset: u32) -> Fallible>; fn GetWholeText(&self) -> Fallible; } impl<'a> TextMethods for JSRef<'a, Text> { - fn SplitText(&self, _offset: u32) -> Fallible> { + fn SplitText(&self, _offset: u32) -> Fallible> { fail!("unimplemented") } diff --git a/src/components/script/dom/uievent.rs b/src/components/script/dom/uievent.rs index cb1365181e5..03140504400 100644 --- a/src/components/script/dom/uievent.rs +++ b/src/components/script/dom/uievent.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::BindingDeclarations::UIEventBinding; use dom::bindings::codegen::InheritTypes::{EventCast, UIEventDerived}; -use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Unrooted}; +use dom::bindings::js::{JS, JSRef, RootCollection, RootedReference, Temporary}; use dom::bindings::error::Fallible; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::event::{Event, EventMethods, EventTypeId, UIEventTypeId}; @@ -36,7 +36,7 @@ impl UIEvent { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~UIEvent::new_inherited(UIEventTypeId), window, UIEventBinding::Wrap) @@ -44,25 +44,25 @@ impl UIEvent { pub fn Constructor(owner: &JSRef, type_: DOMString, - init: &UIEventBinding::UIEventInit) -> Fallible> { + init: &UIEventBinding::UIEventInit) -> Fallible> { let roots = RootCollection::new(); let mut ev = UIEvent::new(owner).root(&roots); let view = init.view.as_ref().map(|view| view.root(&roots)); ev.InitUIEvent(type_, init.parent.bubbles, init.parent.cancelable, view.root_ref(), init.detail); - Ok(Unrooted::new_rooted(&*ev)) + Ok(Temporary::new_rooted(&*ev)) } } pub trait UIEventMethods { - fn GetView(&self) -> Option>; + fn GetView(&self) -> Option>; fn Detail(&self) -> i32; fn LayerX(&self) -> i32; fn LayerY(&self) -> i32; fn PageX(&self) -> i32; fn PageY(&self) -> i32; fn Which(&self) -> u32; - fn GetRangeParent(&self) -> Option>; + fn GetRangeParent(&self) -> Option>; fn RangeOffset(&self) -> i32; fn CancelBubble(&self) -> bool; fn SetCancelBubble(&mut self, _val: bool); @@ -76,8 +76,8 @@ pub trait UIEventMethods { } impl<'a> UIEventMethods for JSRef<'a, UIEvent> { - fn GetView(&self) -> Option> { - self.view.clone().map(|view| Unrooted::new(view)) + fn GetView(&self) -> Option> { + self.view.clone().map(|view| Temporary::new(view)) } fn Detail(&self) -> i32 { @@ -123,7 +123,7 @@ impl<'a> UIEventMethods for JSRef<'a, UIEvent> { 0 } - fn GetRangeParent(&self) -> Option> { + fn GetRangeParent(&self) -> Option> { //TODO None } diff --git a/src/components/script/dom/validitystate.rs b/src/components/script/dom/validitystate.rs index d4d829f842b..f60e646b3ff 100644 --- a/src/components/script/dom/validitystate.rs +++ b/src/components/script/dom/validitystate.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::ValidityStateBinding; -use dom::bindings::js::{JS, JSRef, Unrooted}; +use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::window::Window; @@ -23,7 +23,7 @@ impl ValidityState { } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~ValidityState::new_inherited(window.unrooted()), window, ValidityStateBinding::Wrap) diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs index 04108330cb8..d3ef0769431 100644 --- a/src/components/script/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::BindingDeclarations::WindowBinding; -use dom::bindings::js::{JS, JSRef, Unrooted, OptionalAssignable}; +use dom::bindings::js::{JS, JSRef, Temporary, OptionalAssignable}; use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::utils::{Reflectable, Reflector}; use dom::browsercontext::BrowserContext; @@ -108,7 +108,7 @@ pub struct TimerData { pub trait WindowMethods { fn Alert(&self, s: DOMString); fn Close(&self); - fn Document(&self) -> Unrooted; + fn Document(&self) -> Temporary; fn Name(&self) -> DOMString; fn SetName(&self, _name: DOMString); fn Status(&self) -> DOMString; @@ -117,10 +117,10 @@ pub trait WindowMethods { fn Stop(&self); fn Focus(&self); fn Blur(&self); - fn GetFrameElement(&self) -> Option>; - fn Location(&mut self) -> Unrooted; - fn Console(&mut self) -> Unrooted; - fn Navigator(&mut self) -> Unrooted; + fn GetFrameElement(&self) -> Option>; + fn Location(&mut self) -> Temporary; + fn Console(&mut self) -> Temporary; + fn Navigator(&mut self) -> Temporary; fn Confirm(&self, _message: DOMString) -> bool; fn Prompt(&self, _message: DOMString, _default: DOMString) -> Option; fn Print(&self); @@ -129,8 +129,8 @@ pub trait WindowMethods { fn ClearTimeout(&mut self, handle: i32); fn SetInterval(&mut self, _cx: *JSContext, callback: JSVal, timeout: i32) -> i32; fn ClearInterval(&mut self, handle: i32); - fn Window(&self) -> Unrooted; - fn Self(&self) -> Unrooted; + fn Window(&self) -> Temporary; + fn Self(&self) -> Temporary; } impl<'a> WindowMethods for JSRef<'a, Window> { @@ -144,9 +144,9 @@ impl<'a> WindowMethods for JSRef<'a, Window> { chan.send(ExitWindowMsg(self.page.id.clone())); } - fn Document(&self) -> Unrooted { + fn Document(&self) -> Temporary { let frame = self.page().frame(); - Unrooted::new(frame.get_ref().document.clone()) + Temporary::new(frame.get_ref().document.clone()) } fn Name(&self) -> DOMString { @@ -176,33 +176,33 @@ impl<'a> WindowMethods for JSRef<'a, Window> { fn Blur(&self) { } - fn GetFrameElement(&self) -> Option> { + fn GetFrameElement(&self) -> Option> { None } - fn Location(&mut self) -> Unrooted { + fn Location(&mut self) -> Temporary { if self.location.is_none() { let page = self.deref().page.clone(); let location = Location::new(self, page); self.location.assign(Some(location)); } - Unrooted::new(self.location.get_ref().clone()) + Temporary::new(self.location.get_ref().clone()) } - fn Console(&mut self) -> Unrooted { + fn Console(&mut self) -> Temporary { if self.console.is_none() { let console = Console::new(self); self.console.assign(Some(console)); } - Unrooted::new(self.console.get_ref().clone()) + Temporary::new(self.console.get_ref().clone()) } - fn Navigator(&mut self) -> Unrooted { + fn Navigator(&mut self) -> Temporary { if self.navigator.is_none() { let navigator = Navigator::new(self); self.navigator.assign(Some(navigator)); } - Unrooted::new(self.navigator.get_ref().clone()) + Temporary::new(self.navigator.get_ref().clone()) } fn Confirm(&self, _message: DOMString) -> bool { @@ -241,11 +241,11 @@ impl<'a> WindowMethods for JSRef<'a, Window> { self.ClearTimeout(handle); } - fn Window(&self) -> Unrooted { - Unrooted::new_rooted(self) + fn Window(&self) -> Temporary { + Temporary::new_rooted(self) } - fn Self(&self) -> Unrooted { + fn Self(&self) -> Temporary { self.Window() } } @@ -342,7 +342,7 @@ impl Window { script_chan: ScriptChan, compositor: ~ScriptListener, image_cache_task: ImageCacheTask) - -> Unrooted { + -> Temporary { let win = ~Window { eventtarget: EventTarget::new_inherited(WindowTypeId), script_chan: script_chan, @@ -357,6 +357,6 @@ impl Window { browser_context: None, }; - Unrooted::new(WindowBinding::Wrap(cx, win)) + Temporary::new(WindowBinding::Wrap(cx, win)) } } diff --git a/src/components/script/dom/xmlhttprequest.rs b/src/components/script/dom/xmlhttprequest.rs index a0ffa15c772..7e949a4b2b9 100644 --- a/src/components/script/dom/xmlhttprequest.rs +++ b/src/components/script/dom/xmlhttprequest.rs @@ -10,7 +10,7 @@ use dom::bindings::codegen::InheritTypes::XMLHttpRequestDerived; use dom::document::Document; use dom::eventtarget::{EventTarget, XMLHttpRequestTargetTypeId}; use dom::bindings::error::Fallible; -use dom::bindings::js::{JS, JSRef, Unrooted, OptionalAssignable}; +use dom::bindings::js::{JS, JSRef, Temporary, OptionalAssignable}; use js::jsapi::JSContext; use js::jsval::{JSVal, NullValue}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; @@ -58,12 +58,12 @@ impl XMLHttpRequest { xhr.upload.assign(Some(XMLHttpRequestUpload::new(owner))); xhr } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~XMLHttpRequest::new_inherited(window), window, XMLHttpRequestBinding::Wrap) } - pub fn Constructor(owner: &JSRef) -> Fallible> { + pub fn Constructor(owner: &JSRef) -> Fallible> { Ok(XMLHttpRequest::new(owner)) } } @@ -78,7 +78,7 @@ pub trait XMLHttpRequestMethods { fn SetTimeout(&mut self, timeout: u32); fn WithCredentials(&self) -> bool; fn SetWithCredentials(&mut self, with_credentials: bool); - fn Upload(&self) -> Unrooted; + fn Upload(&self) -> Temporary; fn Send(&self, _data: Option); fn Abort(&self); fn ResponseURL(&self) -> DOMString; @@ -91,7 +91,7 @@ pub trait XMLHttpRequestMethods { fn SetResponseType(&mut self, response_type: XMLHttpRequestResponseType); fn Response(&self, _cx: *JSContext) -> JSVal; fn ResponseText(&self) -> DOMString; - fn GetResponseXML(&self) -> Option>; + fn GetResponseXML(&self) -> Option>; } impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { @@ -120,8 +120,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { fn SetWithCredentials(&mut self, with_credentials: bool) { self.with_credentials = with_credentials } - fn Upload(&self) -> Unrooted { - Unrooted::new(self.upload.get_ref().clone()) + fn Upload(&self) -> Temporary { + Temporary::new(self.upload.get_ref().clone()) } fn Send(&self, _data: Option) { @@ -159,8 +159,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { fn ResponseText(&self) -> DOMString { self.response_text.clone() } - fn GetResponseXML(&self) -> Option> { - self.response_xml.clone().map(|response| Unrooted::new(response)) + fn GetResponseXML(&self) -> Option> { + self.response_xml.clone().map(|response| Temporary::new(response)) } } diff --git a/src/components/script/dom/xmlhttprequestupload.rs b/src/components/script/dom/xmlhttprequestupload.rs index c2332d84ee0..6f373ab0a65 100644 --- a/src/components/script/dom/xmlhttprequestupload.rs +++ b/src/components/script/dom/xmlhttprequestupload.rs @@ -4,7 +4,7 @@ use dom::bindings::codegen::InheritTypes::XMLHttpRequestUploadDerived; use dom::bindings::codegen::BindingDeclarations::XMLHttpRequestUploadBinding; -use dom::bindings::js::{Unrooted, JSRef}; +use dom::bindings::js::{Temporary, JSRef}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::eventtarget::{EventTarget, XMLHttpRequestTargetTypeId}; use dom::window::Window; @@ -22,7 +22,7 @@ impl XMLHttpRequestUpload { eventtarget:XMLHttpRequestEventTarget::new_inherited(XMLHttpRequestUploadTypeId) } } - pub fn new(window: &JSRef) -> Unrooted { + pub fn new(window: &JSRef) -> Temporary { reflect_dom_object(~XMLHttpRequestUpload::new_inherited(), window, XMLHttpRequestUploadBinding::Wrap) diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 9326ed6cb15..a0490c1621f 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -5,7 +5,7 @@ use dom::attr::AttrMethods; use dom::bindings::codegen::InheritTypes::{NodeBase, NodeCast, TextCast, ElementCast}; use dom::bindings::codegen::InheritTypes::HTMLIFrameElementCast; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, OptionalRootable, Root}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalRootable, Root}; use dom::bindings::utils::Reflectable; use dom::document::{Document, DocumentHelpers}; use dom::element::{AttributeHandlers, HTMLLinkElementTypeId, HTMLIFrameElementTypeId}; @@ -87,10 +87,10 @@ impl<'a, T: NodeBase+Reflectable> NodeWrapping for JSRef<'a, T> { } unsafe fn from_hubbub_node(n: hubbub::NodeDataPtr, - roots: Option<&RootCollection>) -> Unrooted { + roots: Option<&RootCollection>) -> Temporary { let js = JS::from_raw(cast::transmute(n)); let _ = roots.map(|roots| roots.unroot_raw(js.reflector().get_jsobject())); - Unrooted::new(js) + Temporary::new(js) } /** @@ -165,7 +165,7 @@ fn js_script_listener(to_parent: Sender, // Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized // via atomization (issue #85). -pub fn build_element_from_tag(tag: DOMString, document: &JSRef) -> Unrooted { +pub fn build_element_from_tag(tag: DOMString, document: &JSRef) -> Temporary { // TODO (Issue #85): use atoms handle_element!(document, tag, "a", HTMLAnchorElement); handle_element!(document, tag, "applet", HTMLAppletElement); diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index e319ef18837..c945f8c3451 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -8,7 +8,7 @@ use dom::attr::AttrMethods; use dom::bindings::codegen::RegisterBindings; use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, ElementCast, EventCast}; -use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted, OptionalAssignable}; +use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalAssignable}; use dom::bindings::js::OptionalRootable; use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::utils::{Reflectable, GlobalStaticData, wrap_for_same_compartment}; @@ -407,7 +407,7 @@ impl Page { } } - fn find_fragment_node(&self, fragid: ~str) -> Option> { + fn find_fragment_node(&self, fragid: ~str) -> Option> { let roots = RootCollection::new(); let document = self.frame().get_ref().document.root(&roots); match document.deref().GetElementById(fragid.to_owned()) { @@ -421,7 +421,7 @@ impl Page { elem.get_attribute(Null, "name").root(&roots).map_or(false, |attr| { attr.get().value_ref() == fragid }) - }).map(|node| Unrooted::new_rooted(ElementCast::to_ref(&node).unwrap())) + }).map(|node| Temporary::new_rooted(ElementCast::to_ref(&node).unwrap())) } } } @@ -1050,7 +1050,7 @@ impl ScriptTask { None => {} } - frame.as_ref().map(|frame| Unrooted::new(frame.window.clone())) + frame.as_ref().map(|frame| Temporary::new(frame.window.clone())) }; match window.root(&roots) {