mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
s/Unrooted/Temporary/g
This commit is contained in:
parent
bbfed38168
commit
522d3f167b
104 changed files with 565 additions and 565 deletions
|
@ -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<Window>, local_name: DOMString, value: DOMString,
|
||||
name: DOMString, namespace: Namespace,
|
||||
prefix: Option<DOMString>, owner: &JSRef<Element>) -> Unrooted<Attr> {
|
||||
prefix: Option<DOMString>, owner: &JSRef<Element>) -> Temporary<Attr> {
|
||||
let attr = Attr::new_inherited(local_name, value, name, namespace, prefix, owner);
|
||||
reflect_dom_object(~attr, window, AttrBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Window>, elem: &JSRef<Element>) -> Unrooted<AttrList> {
|
||||
pub fn new(window: &JSRef<Window>, elem: &JSRef<Element>) -> Temporary<AttrList> {
|
||||
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<Unrooted<Attr>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Unrooted<Attr>>;
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Attr>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>>;
|
||||
}
|
||||
|
||||
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<Unrooted<Attr>> {
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Attr>> {
|
||||
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<Unrooted<Attr>> {
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>> {
|
||||
let item = self.Item(index);
|
||||
*found = item.is_some();
|
||||
item
|
||||
|
|
|
@ -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<T: ${fromBound}+Reflectable>(derived: Unrooted<T>) -> Unrooted<Self> {
|
||||
fn from_unrooted<T: ${fromBound}+Reflectable>(derived: Temporary<T>) -> Temporary<Self> {
|
||||
unsafe { derived.transmute() }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<T> types) safely via the
|
||||
/// `JS<T>::assign` method or `OptionalAssignable::assign` (for Option<JS<T>> fields).
|
||||
pub struct Unrooted<T> {
|
||||
pub struct Temporary<T> {
|
||||
inner: JS<T>
|
||||
}
|
||||
|
||||
impl<T> Eq for Unrooted<T> {
|
||||
fn eq(&self, other: &Unrooted<T>) -> bool {
|
||||
impl<T> Eq for Temporary<T> {
|
||||
fn eq(&self, other: &Temporary<T>) -> bool {
|
||||
self.inner == other.inner
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Reflectable> Unrooted<T> {
|
||||
/// Create a new Unrooted value from a JS-owned value.
|
||||
pub fn new(inner: JS<T>) -> Unrooted<T> {
|
||||
Unrooted {
|
||||
impl<T: Reflectable> Temporary<T> {
|
||||
/// Create a new Temporary value from a JS-owned value.
|
||||
pub fn new(inner: JS<T>) -> Temporary<T> {
|
||||
Temporary {
|
||||
inner: inner
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new Unrooted value from a rooted value.
|
||||
pub fn new_rooted<'a>(root: &JSRef<'a, T>) -> Unrooted<T> {
|
||||
Unrooted {
|
||||
/// Create a new Temporary value from a rooted value.
|
||||
pub fn new_rooted<'a>(root: &JSRef<'a, T>) -> Temporary<T> {
|
||||
Temporary {
|
||||
inner: root.unrooted()
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ impl<T: Reflectable> Unrooted<T> {
|
|||
}
|
||||
|
||||
//XXXjdm It would be lovely if this could be private.
|
||||
pub unsafe fn transmute<To>(self) -> Unrooted<To> {
|
||||
pub unsafe fn transmute<To>(self) -> Temporary<To> {
|
||||
cast::transmute(self)
|
||||
}
|
||||
}
|
||||
|
@ -75,12 +75,12 @@ impl <T> Clone for JS<T> {
|
|||
}
|
||||
|
||||
impl<T: Reflectable> JS<T> {
|
||||
/// 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<Window>,
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~T) -> JS<T>) -> Unrooted<T> {
|
||||
Unrooted::new(wrap_fn(window.get().get_cx(), window, obj))
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~T) -> JS<T>) -> Temporary<T> {
|
||||
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<T: Reflectable> JS<T> {
|
|||
/// Store an unrooted value in this field. This is safe under the assumption that JS<T>
|
||||
/// 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<T>) {
|
||||
pub fn assign(&mut self, val: Temporary<T>) {
|
||||
*self = unsafe { val.inner() };
|
||||
}
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ impl<'a, T> Assignable<T> 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<T: Reflectable> Assignable<T> for Unrooted<T> {
|
||||
impl<T: Reflectable> Assignable<T> for Temporary<T> {
|
||||
fn get_js(&self) -> JS<T> {
|
||||
unsafe { self.inner() }
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ pub trait OptionalRootable<T> {
|
|||
fn root<'a, 'b>(self, roots: &'a RootCollection) -> Option<Root<'a, 'b, T>>;
|
||||
}
|
||||
|
||||
impl<T: Reflectable> OptionalRootable<T> for Option<Unrooted<T>> {
|
||||
impl<T: Reflectable> OptionalRootable<T> for Option<Temporary<T>> {
|
||||
fn root<'a, 'b>(self, roots: &'a RootCollection) -> Option<Root<'a, 'b, T>> {
|
||||
self.map(|inner| inner.root(roots))
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ pub trait ResultRootable<T,U> {
|
|||
fn root<'a, 'b>(self, roots: &'a RootCollection) -> Result<Root<'a, 'b, T>, U>;
|
||||
}
|
||||
|
||||
impl<T: Reflectable, U> ResultRootable<T, U> for Result<Unrooted<T>, U> {
|
||||
impl<T: Reflectable, U> ResultRootable<T, U> for Result<Temporary<T>, U> {
|
||||
fn root<'a, 'b>(self, roots: &'a RootCollection) -> Result<Root<'a, 'b, T>, U> {
|
||||
self.map(|inner| inner.root(roots))
|
||||
}
|
||||
|
@ -227,12 +227,12 @@ impl<T: Reflectable, U> ResultRootable<T, U> for Result<Unrooted<T>, 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<T> {
|
||||
fn push_unrooted(&mut self, val: Unrooted<T>);
|
||||
pub trait TemporaryPushable<T> {
|
||||
fn push_unrooted(&mut self, val: Temporary<T>);
|
||||
}
|
||||
|
||||
impl<T: Reflectable> UnrootedPushable<T> for Vec<JS<T>> {
|
||||
fn push_unrooted(&mut self, val: Unrooted<T>) {
|
||||
impl<T: Reflectable> TemporaryPushable<T> for Vec<JS<T>> {
|
||||
fn push_unrooted(&mut self, val: Temporary<T>) {
|
||||
unsafe { self.push(val.inner()) };
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<T: Reflectable>
|
|||
(obj: ~T,
|
||||
window: &JSRef<window::Window>,
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<window::Window>, ~T) -> JS<T>)
|
||||
-> Unrooted<T> {
|
||||
-> Temporary<T> {
|
||||
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<window::Window> {
|
||||
pub fn global_object_for_js_object(obj: *JSObject) -> Temporary<window::Window> {
|
||||
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"))
|
||||
}
|
||||
|
|
|
@ -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<Window>) -> Unrooted<Blob> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<Blob> {
|
||||
reflect_dom_object(~Blob::new_inherited(window.unrooted()),
|
||||
window,
|
||||
BlobBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(window: &JSRef<Window>) -> Fallible<Unrooted<Blob>> {
|
||||
pub fn Constructor(window: &JSRef<Window>) -> Fallible<Temporary<Blob>> {
|
||||
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<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Unrooted<Blob>;
|
||||
fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Temporary<Blob>;
|
||||
fn Close(&self);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ impl<'a> BlobMethods for JSRef<'a, Blob> {
|
|||
~""
|
||||
}
|
||||
|
||||
fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Unrooted<Blob> {
|
||||
fn Slice(&self, _start: Option<i64>, _end: Option<i64>, _contentType: Option<DOMString>) -> Temporary<Blob> {
|
||||
let roots = RootCollection::new();
|
||||
let window = self.window.root(&roots);
|
||||
Blob::new(&window.root_ref())
|
||||
|
|
|
@ -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<Document> {
|
||||
Unrooted::new(self.history.get(self.active_index).document.clone())
|
||||
pub fn active_document(&self) -> Temporary<Document> {
|
||||
Temporary::new(self.history.get(self.active_index).document.clone())
|
||||
}
|
||||
|
||||
pub fn active_window(&self) -> Unrooted<Window> {
|
||||
pub fn active_window(&self) -> Temporary<Window> {
|
||||
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 {
|
||||
|
|
|
@ -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<Window>,
|
||||
top: Au, bottom: Au,
|
||||
left: Au, right: Au) -> Unrooted<ClientRect> {
|
||||
left: Au, right: Au) -> Temporary<ClientRect> {
|
||||
let rect = ClientRect::new_inherited(window.unrooted(), top, bottom, left, right);
|
||||
reflect_dom_object(~rect, window, ClientRectBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Window>,
|
||||
rects: Vec<JSRef<ClientRect>>) -> Unrooted<ClientRectList> {
|
||||
rects: Vec<JSRef<ClientRect>>) -> Temporary<ClientRectList> {
|
||||
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<Unrooted<ClientRect>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Unrooted<ClientRect>>;
|
||||
fn Item(&self, index: u32) -> Option<Temporary<ClientRect>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<ClientRect>>;
|
||||
}
|
||||
|
||||
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<Unrooted<ClientRect>> {
|
||||
fn Item(&self, index: u32) -> Option<Temporary<ClientRect>> {
|
||||
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<Unrooted<ClientRect>> {
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<ClientRect>> {
|
||||
*found = index < self.rects.len() as u32;
|
||||
self.Item(index)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<Comment> {
|
||||
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Comment> {
|
||||
let node = Comment::new_inherited(text, document.unrooted());
|
||||
Node::reflect_node(~node, document, CommentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JSRef<Window>, data: DOMString) -> Fallible<Unrooted<Comment>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>, data: DOMString) -> Fallible<Temporary<Comment>> {
|
||||
let roots = RootCollection::new();
|
||||
let document = owner.Document().root(&roots);
|
||||
Ok(Comment::new(data, &*document))
|
||||
|
|
|
@ -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<Window>) -> Unrooted<Console> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<Console> {
|
||||
reflect_dom_object(~Console::new_inherited(), window, ConsoleBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Window>,
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~Document) -> JS<Document>)
|
||||
-> Unrooted<Document> {
|
||||
-> Temporary<Document> {
|
||||
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<Node> = 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<Window>,
|
||||
|
@ -230,11 +230,11 @@ impl Document {
|
|||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-document
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Unrooted<Document>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Temporary<Document>> {
|
||||
Ok(Document::new(owner, None, NonHTMLDocument, None))
|
||||
}
|
||||
|
||||
pub fn new(window: &JSRef<Window>, url: Option<Url>, doctype: IsHTMLDocument, content_type: Option<DOMString>) -> Unrooted<Document> {
|
||||
pub fn new(window: &JSRef<Window>, url: Option<Url>, doctype: IsHTMLDocument, content_type: Option<DOMString>) -> Temporary<Document> {
|
||||
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<Node>| -> bool) -> Unrooted<NodeList>;
|
||||
fn get_html_element(&self) -> Option<Unrooted<HTMLHtmlElement>>;
|
||||
fn createNodeList(&self, callback: |node: &JSRef<Node>| -> bool) -> Temporary<NodeList>;
|
||||
fn get_html_element(&self) -> Option<Temporary<HTMLHtmlElement>>;
|
||||
}
|
||||
|
||||
impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> {
|
||||
fn createNodeList(&self, callback: |node: &JSRef<Node>| -> bool) -> Unrooted<NodeList> {
|
||||
fn createNodeList(&self, callback: |node: &JSRef<Node>| -> bool) -> Temporary<NodeList> {
|
||||
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<Unrooted<HTMLHtmlElement>> {
|
||||
fn get_html_element(&self) -> Option<Temporary<HTMLHtmlElement>> {
|
||||
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<DOMImplementation>;
|
||||
fn Implementation(&mut self) -> Temporary<DOMImplementation>;
|
||||
fn URL(&self) -> DOMString;
|
||||
fn DocumentURI(&self) -> DOMString;
|
||||
fn CompatMode(&self) -> DOMString;
|
||||
fn CharacterSet(&self) -> DOMString;
|
||||
fn ContentType(&self) -> DOMString;
|
||||
fn GetDoctype(&self) -> Option<Unrooted<DocumentType>>;
|
||||
fn GetDocumentElement(&self) -> Option<Unrooted<Element>>;
|
||||
fn GetElementsByTagName(&self, tag_name: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementsByTagNameNS(&self, maybe_ns: Option<DOMString>, tag_name: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementById(&self, id: DOMString) -> Option<Unrooted<Element>>;
|
||||
fn CreateElement(&self, local_name: DOMString) -> Fallible<Unrooted<Element>>;
|
||||
fn CreateElementNS(&self, namespace: Option<DOMString>, qualified_name: DOMString) -> Fallible<Unrooted<Element>>;
|
||||
fn CreateDocumentFragment(&self) -> Unrooted<DocumentFragment>;
|
||||
fn CreateTextNode(&self, data: DOMString) -> Unrooted<Text>;
|
||||
fn CreateComment(&self, data: DOMString) -> Unrooted<Comment>;
|
||||
fn CreateProcessingInstruction(&self, target: DOMString, data: DOMString) -> Fallible<Unrooted<ProcessingInstruction>>;
|
||||
fn ImportNode(&self, node: &JSRef<Node>, deep: bool) -> Fallible<Unrooted<Node>>;
|
||||
fn AdoptNode(&self, node: &mut JSRef<Node>) -> Fallible<Unrooted<Node>>;
|
||||
fn CreateEvent(&self, interface: DOMString) -> Fallible<Unrooted<Event>>;
|
||||
fn GetDoctype(&self) -> Option<Temporary<DocumentType>>;
|
||||
fn GetDocumentElement(&self) -> Option<Temporary<Element>>;
|
||||
fn GetElementsByTagName(&self, tag_name: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetElementsByTagNameNS(&self, maybe_ns: Option<DOMString>, tag_name: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetElementById(&self, id: DOMString) -> Option<Temporary<Element>>;
|
||||
fn CreateElement(&self, local_name: DOMString) -> Fallible<Temporary<Element>>;
|
||||
fn CreateElementNS(&self, namespace: Option<DOMString>, qualified_name: DOMString) -> Fallible<Temporary<Element>>;
|
||||
fn CreateDocumentFragment(&self) -> Temporary<DocumentFragment>;
|
||||
fn CreateTextNode(&self, data: DOMString) -> Temporary<Text>;
|
||||
fn CreateComment(&self, data: DOMString) -> Temporary<Comment>;
|
||||
fn CreateProcessingInstruction(&self, target: DOMString, data: DOMString) -> Fallible<Temporary<ProcessingInstruction>>;
|
||||
fn ImportNode(&self, node: &JSRef<Node>, deep: bool) -> Fallible<Temporary<Node>>;
|
||||
fn AdoptNode(&self, node: &mut JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||
fn CreateEvent(&self, interface: DOMString) -> Fallible<Temporary<Event>>;
|
||||
fn Title(&self) -> DOMString;
|
||||
fn SetTitle(&self, title: DOMString) -> ErrorResult;
|
||||
fn GetHead(&self) -> Option<Unrooted<HTMLHeadElement>>;
|
||||
fn GetBody(&self) -> Option<Unrooted<HTMLElement>>;
|
||||
fn GetHead(&self) -> Option<Temporary<HTMLHeadElement>>;
|
||||
fn GetBody(&self) -> Option<Temporary<HTMLElement>>;
|
||||
fn SetBody(&self, new_body: Option<JSRef<HTMLElement>>) -> ErrorResult;
|
||||
fn GetElementsByName(&self, name: DOMString) -> Unrooted<NodeList>;
|
||||
fn Images(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Embeds(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Plugins(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Links(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Forms(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Scripts(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Anchors(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Applets(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Location(&mut self) -> Unrooted<Location>;
|
||||
fn Children(&self) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementsByName(&self, name: DOMString) -> Temporary<NodeList>;
|
||||
fn Images(&self) -> Temporary<HTMLCollection>;
|
||||
fn Embeds(&self) -> Temporary<HTMLCollection>;
|
||||
fn Plugins(&self) -> Temporary<HTMLCollection>;
|
||||
fn Links(&self) -> Temporary<HTMLCollection>;
|
||||
fn Forms(&self) -> Temporary<HTMLCollection>;
|
||||
fn Scripts(&self) -> Temporary<HTMLCollection>;
|
||||
fn Anchors(&self) -> Temporary<HTMLCollection>;
|
||||
fn Applets(&self) -> Temporary<HTMLCollection>;
|
||||
fn Location(&mut self) -> Temporary<Location>;
|
||||
fn Children(&self) -> Temporary<HTMLCollection>;
|
||||
}
|
||||
|
||||
impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||
// http://dom.spec.whatwg.org/#dom-document-implementation
|
||||
fn Implementation(&mut self) -> Unrooted<DOMImplementation> {
|
||||
fn Implementation(&mut self) -> Temporary<DOMImplementation> {
|
||||
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<Unrooted<DocumentType>> {
|
||||
fn GetDoctype(&self) -> Option<Temporary<DocumentType>> {
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
node.children().find(|child| {
|
||||
child.is_doctype()
|
||||
}).map(|node| {
|
||||
let doctype: &JSRef<DocumentType> = 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<Unrooted<Element>> {
|
||||
fn GetDocumentElement(&self) -> Option<Temporary<Element>> {
|
||||
let node: &JSRef<Node> = 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<HTMLCollection> {
|
||||
fn GetElementsByTagName(&self, tag_name: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<DOMString>, tag_name: DOMString) -> Unrooted<HTMLCollection> {
|
||||
fn GetElementsByTagNameNS(&self, maybe_ns: Option<DOMString>, tag_name: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<Unrooted<Element>> {
|
||||
fn GetElementById(&self, id: DOMString) -> Option<Temporary<Element>> {
|
||||
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<Unrooted<Element>> {
|
||||
fn CreateElement(&self, local_name: DOMString) -> Fallible<Temporary<Element>> {
|
||||
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<DOMString>,
|
||||
qualified_name: DOMString) -> Fallible<Unrooted<Element>> {
|
||||
qualified_name: DOMString) -> Fallible<Temporary<Element>> {
|
||||
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<DocumentFragment> {
|
||||
fn CreateDocumentFragment(&self) -> Temporary<DocumentFragment> {
|
||||
DocumentFragment::new(self)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-document-createtextnode
|
||||
fn CreateTextNode(&self, data: DOMString)
|
||||
-> Unrooted<Text> {
|
||||
-> Temporary<Text> {
|
||||
Text::new(data, self)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-document-createcomment
|
||||
fn CreateComment(&self, data: DOMString) -> Unrooted<Comment> {
|
||||
fn CreateComment(&self, data: DOMString) -> Temporary<Comment> {
|
||||
Comment::new(data, self)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
|
||||
fn CreateProcessingInstruction(&self, target: DOMString,
|
||||
data: DOMString) -> Fallible<Unrooted<ProcessingInstruction>> {
|
||||
data: DOMString) -> Fallible<Temporary<ProcessingInstruction>> {
|
||||
// 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<Node>, deep: bool) -> Fallible<Unrooted<Node>> {
|
||||
fn ImportNode(&self, node: &JSRef<Node>, deep: bool) -> Fallible<Temporary<Node>> {
|
||||
// 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<Node>) -> Fallible<Unrooted<Node>> {
|
||||
fn AdoptNode(&self, node: &mut JSRef<Node>) -> Fallible<Temporary<Node>> {
|
||||
// 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<Unrooted<Event>> {
|
||||
fn CreateEvent(&self, interface: DOMString) -> Fallible<Temporary<Event>> {
|
||||
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<Unrooted<HTMLHeadElement>> {
|
||||
fn GetHead(&self) -> Option<Temporary<HTMLHeadElement>> {
|
||||
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<Unrooted<HTMLElement>> {
|
||||
fn GetBody(&self) -> Option<Temporary<HTMLElement>> {
|
||||
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<NodeList> {
|
||||
fn GetElementsByName(&self, name: DOMString) -> Temporary<NodeList> {
|
||||
let roots = RootCollection::new();
|
||||
|
||||
self.createNodeList(|node| {
|
||||
|
@ -703,7 +703,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
})
|
||||
}
|
||||
|
||||
fn Images(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Images(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Embeds(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Plugins(&self) -> Temporary<HTMLCollection> {
|
||||
// FIXME: https://github.com/mozilla/servo/issues/1847
|
||||
self.Embeds()
|
||||
}
|
||||
|
||||
fn Links(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Links(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Forms(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Scripts(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Anchors(&self) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn Applets(&self) -> Temporary<HTMLCollection> {
|
||||
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<Location> {
|
||||
fn Location(&mut self) -> Temporary<Location> {
|
||||
let roots = RootCollection::new();
|
||||
let mut window = self.window.root(&roots);
|
||||
window.Location()
|
||||
}
|
||||
|
||||
fn Children(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Children(&self) -> Temporary<HTMLCollection> {
|
||||
let roots = RootCollection::new();
|
||||
let window = self.window.root(&roots);
|
||||
HTMLCollection::children(&*window, NodeCast::from_ref(self))
|
||||
|
|
|
@ -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<Document>) -> Unrooted<DocumentFragment> {
|
||||
pub fn new(document: &JSRef<Document>) -> Temporary<DocumentFragment> {
|
||||
let node = DocumentFragment::new_inherited(document.unrooted());
|
||||
Node::reflect_node(~node, document, DocumentFragmentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Unrooted<DocumentFragment>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Temporary<DocumentFragment>> {
|
||||
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<HTMLCollection>;
|
||||
fn Children(&self) -> Temporary<HTMLCollection>;
|
||||
}
|
||||
|
||||
impl<'a> DocumentFragmentMethods for JSRef<'a, DocumentFragment> {
|
||||
fn Children(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Children(&self) -> Temporary<HTMLCollection> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
HTMLCollection::children(&window.root_ref(), NodeCast::from_ref(self))
|
||||
|
|
|
@ -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<DOMString>,
|
||||
system_id: Option<DOMString>,
|
||||
document: &JSRef<Document>)
|
||||
-> Unrooted<DocumentType> {
|
||||
-> Temporary<DocumentType> {
|
||||
let documenttype = DocumentType::new_inherited(name,
|
||||
public_id,
|
||||
system_id,
|
||||
|
|
|
@ -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<Window>, code: DOMErrorName) -> Unrooted<DOMException> {
|
||||
pub fn new(window: &JSRef<Window>, code: DOMErrorName) -> Temporary<DOMException> {
|
||||
reflect_dom_object(~DOMException::new_inherited(code), window, DOMExceptionBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Window>) -> Unrooted<DOMImplementation> {
|
||||
pub fn new(owner: &JSRef<Window>) -> Temporary<DOMImplementation> {
|
||||
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<Unrooted<DocumentType>>;
|
||||
fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible<Temporary<DocumentType>>;
|
||||
fn CreateDocument(&self, namespace: Option<DOMString>, qname: DOMString,
|
||||
mut maybe_doctype: Option<JSRef<DocumentType>>) -> Fallible<Unrooted<Document>>;
|
||||
fn CreateHTMLDocument(&self, title: Option<DOMString>) -> Unrooted<Document>;
|
||||
mut maybe_doctype: Option<JSRef<DocumentType>>) -> Fallible<Temporary<Document>>;
|
||||
fn CreateHTMLDocument(&self, title: Option<DOMString>) -> Temporary<Document>;
|
||||
}
|
||||
|
||||
// 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<Unrooted<DocumentType>> {
|
||||
fn CreateDocumentType(&self, qname: DOMString, pubid: DOMString, sysid: DOMString) -> Fallible<Temporary<DocumentType>> {
|
||||
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<DOMString>, qname: DOMString,
|
||||
mut maybe_doctype: Option<JSRef<DocumentType>>) -> Fallible<Unrooted<Document>> {
|
||||
mut maybe_doctype: Option<JSRef<DocumentType>>) -> Fallible<Temporary<Document>> {
|
||||
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<DOMString>) -> Unrooted<Document> {
|
||||
fn CreateHTMLDocument(&self, title: Option<DOMString>) -> Temporary<Document> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Window>) -> Unrooted<DOMParser> {
|
||||
pub fn new(owner: &JSRef<Window>) -> Temporary<DOMParser> {
|
||||
reflect_dom_object(~DOMParser::new_inherited(owner.unrooted()), owner,
|
||||
DOMParserBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Unrooted<DOMParser>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>) -> Fallible<Temporary<DOMParser>> {
|
||||
Ok(DOMParser::new(owner))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait DOMParserMethods {
|
||||
fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible<Unrooted<Document>>;
|
||||
fn ParseFromString(&self, _s: DOMString, ty: DOMParserBinding::SupportedType) -> Fallible<Temporary<Document>>;
|
||||
}
|
||||
|
||||
impl<'a> DOMParserMethods for JSRef<'a, DOMParser> {
|
||||
fn ParseFromString(&self,
|
||||
_s: DOMString,
|
||||
ty: DOMParserBinding::SupportedType)
|
||||
-> Fallible<Unrooted<Document>> {
|
||||
-> Fallible<Temporary<Document>> {
|
||||
let roots = RootCollection::new();
|
||||
let owner = self.owner.root(&roots);
|
||||
match ty {
|
||||
|
|
|
@ -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<DOMString>, document: &JSRef<Document>) -> Unrooted<Element> {
|
||||
pub fn new(local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: &JSRef<Document>) -> Temporary<Element> {
|
||||
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<Unrooted<Attr>>;
|
||||
fn get_attribute(&self, namespace: Namespace, name: &str) -> Option<Temporary<Attr>>;
|
||||
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<Unrooted<Attr>> {
|
||||
fn get_attribute(&self, namespace: Namespace, name: &str) -> Option<Temporary<Attr>> {
|
||||
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<AttrList>;
|
||||
fn Attributes(&mut self) -> Temporary<AttrList>;
|
||||
fn GetAttribute(&self, name: DOMString) -> Option<DOMString>;
|
||||
fn GetAttributeNS(&self, namespace: Option<DOMString>, local_name: DOMString) -> Option<DOMString>;
|
||||
fn SetAttribute(&mut self, name: DOMString, value: DOMString) -> ErrorResult;
|
||||
|
@ -403,14 +403,14 @@ pub trait ElementMethods {
|
|||
fn RemoveAttributeNS(&mut self, namespace: Option<DOMString>, localname: DOMString) -> ErrorResult;
|
||||
fn HasAttribute(&self, name: DOMString) -> bool;
|
||||
fn HasAttributeNS(&self, namespace: Option<DOMString>, local_name: DOMString) -> bool;
|
||||
fn GetElementsByTagName(&self, localname: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementsByTagNameNS(&self, maybe_ns: Option<DOMString>, localname: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Unrooted<HTMLCollection>;
|
||||
fn GetClientRects(&self) -> Unrooted<ClientRectList>;
|
||||
fn GetBoundingClientRect(&self) -> Unrooted<ClientRect>;
|
||||
fn GetElementsByTagName(&self, localname: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetElementsByTagNameNS(&self, maybe_ns: Option<DOMString>, localname: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Temporary<HTMLCollection>;
|
||||
fn GetClientRects(&self) -> Temporary<ClientRectList>;
|
||||
fn GetBoundingClientRect(&self) -> Temporary<ClientRect>;
|
||||
fn GetInnerHTML(&self) -> Fallible<DOMString>;
|
||||
fn GetOuterHTML(&self) -> Fallible<DOMString>;
|
||||
fn Children(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Children(&self) -> Temporary<HTMLCollection>;
|
||||
}
|
||||
|
||||
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<AttrList> {
|
||||
fn Attributes(&mut self) -> Temporary<AttrList> {
|
||||
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<HTMLCollection> {
|
||||
fn GetElementsByTagName(&self, localname: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<DOMString>,
|
||||
localname: DOMString) -> Unrooted<HTMLCollection> {
|
||||
localname: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<HTMLCollection> {
|
||||
fn GetElementsByClassName(&self, classes: DOMString) -> Temporary<HTMLCollection> {
|
||||
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<ClientRectList> {
|
||||
fn GetClientRects(&self) -> Temporary<ClientRectList> {
|
||||
let roots = RootCollection::new();
|
||||
let win = window_from_node(self).root(&roots);
|
||||
let node: &JSRef<Node> = 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<ClientRect> {
|
||||
fn GetBoundingClientRect(&self) -> Temporary<ClientRect> {
|
||||
let roots = RootCollection::new();
|
||||
let win = window_from_node(self).root(&roots);
|
||||
let node: &JSRef<Node> = 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<HTMLCollection> {
|
||||
fn Children(&self) -> Temporary<HTMLCollection> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
HTMLCollection::children(&*window, NodeCast::from_ref(self))
|
||||
|
|
|
@ -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<Window>) -> Unrooted<Event> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<Event> {
|
||||
reflect_dom_object(~Event::new_inherited(HTMLEventTypeId),
|
||||
window,
|
||||
EventBinding::Wrap)
|
||||
|
@ -88,19 +88,19 @@ impl Event {
|
|||
|
||||
pub fn Constructor(global: &JSRef<Window>,
|
||||
type_: DOMString,
|
||||
init: &EventBinding::EventInit) -> Fallible<Unrooted<Event>> {
|
||||
init: &EventBinding::EventInit) -> Fallible<Temporary<Event>> {
|
||||
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<Unrooted<EventTarget>>;
|
||||
fn GetCurrentTarget(&self) -> Option<Unrooted<EventTarget>>;
|
||||
fn GetTarget(&self) -> Option<Temporary<EventTarget>>;
|
||||
fn GetCurrentTarget(&self) -> Option<Temporary<EventTarget>>;
|
||||
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<Unrooted<EventTarget>> {
|
||||
self.target.as_ref().map(|target| Unrooted::new(target.clone()))
|
||||
fn GetTarget(&self) -> Option<Temporary<EventTarget>> {
|
||||
self.target.as_ref().map(|target| Temporary::new(target.clone()))
|
||||
}
|
||||
|
||||
fn GetCurrentTarget(&self) -> Option<Unrooted<EventTarget>> {
|
||||
self.current_target.as_ref().map(|target| Unrooted::new(target.clone()))
|
||||
fn GetCurrentTarget(&self) -> Option<Temporary<EventTarget>> {
|
||||
self.current_target.as_ref().map(|target| Temporary::new(target.clone()))
|
||||
}
|
||||
|
||||
fn DefaultPrevented(&self) -> bool {
|
||||
|
|
|
@ -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<JSRef<HTMLFormElement>>, window: &JSRef<Window>) -> Unrooted<FormData> {
|
||||
pub fn new(form: Option<JSRef<HTMLFormElement>>, window: &JSRef<Window>) -> Temporary<FormData> {
|
||||
reflect_dom_object(~FormData::new_inherited(form, window.unrooted()), window, FormDataBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(window: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Unrooted<FormData>> {
|
||||
pub fn Constructor(window: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Temporary<FormData>> {
|
||||
Ok(FormData::new(form, window))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLAnchorElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAnchorElement> {
|
||||
let element = HTMLAnchorElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLAnchorElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLAppletElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAppletElement> {
|
||||
let element = HTMLAppletElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLAppletElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLAreaElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAreaElement> {
|
||||
let element = HTMLAreaElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLAudioElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAudioElement> {
|
||||
let element = HTMLAudioElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLAudioElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLBaseElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBaseElement> {
|
||||
let element = HTMLBaseElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLBaseElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLBodyElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBodyElement> {
|
||||
let element = HTMLBodyElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLBodyElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLBRElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBRElement> {
|
||||
let element = HTMLBRElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLBRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLButtonElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLButtonElement> {
|
||||
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<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
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<ValidityState>;
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
fn SetValidity(&mut self, _validity: JS<ValidityState>);
|
||||
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<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
|
|||
fn SetWillValidate(&mut self, _will_validate: bool) {
|
||||
}
|
||||
|
||||
fn Validity(&self) -> Unrooted<ValidityState> {
|
||||
fn Validity(&self) -> Temporary<ValidityState> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
ValidityState::new(&*window)
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLCanvasElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLCanvasElement> {
|
||||
let element = HTMLCanvasElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLCanvasElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Window>, collection: CollectionTypeId) -> Unrooted<HTMLCollection> {
|
||||
pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> {
|
||||
reflect_dom_object(~HTMLCollection::new_inherited(window.unrooted(), collection),
|
||||
window, HTMLCollectionBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
impl HTMLCollection {
|
||||
pub fn create(window: &JSRef<Window>, root: &JSRef<Node>, filter: ~CollectionFilter) -> Unrooted<HTMLCollection> {
|
||||
pub fn create(window: &JSRef<Window>, root: &JSRef<Node>, filter: ~CollectionFilter) -> Temporary<HTMLCollection> {
|
||||
HTMLCollection::new(window, Live(root.unrooted(), filter))
|
||||
}
|
||||
|
||||
pub fn by_tag_name(window: &JSRef<Window>, root: &JSRef<Node>, tag: DOMString)
|
||||
-> Unrooted<HTMLCollection> {
|
||||
-> Temporary<HTMLCollection> {
|
||||
struct TagNameFilter {
|
||||
tag: DOMString
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
pub fn by_tag_name_ns(window: &JSRef<Window>, root: &JSRef<Node>, tag: DOMString,
|
||||
namespace: Namespace) -> Unrooted<HTMLCollection> {
|
||||
namespace: Namespace) -> Temporary<HTMLCollection> {
|
||||
struct TagNameNSFilter {
|
||||
tag: DOMString,
|
||||
namespace: Namespace
|
||||
|
@ -92,7 +92,7 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
pub fn by_class_name(window: &JSRef<Window>, root: &JSRef<Node>, classes: DOMString)
|
||||
-> Unrooted<HTMLCollection> {
|
||||
-> Temporary<HTMLCollection> {
|
||||
struct ClassNameFilter {
|
||||
classes: Vec<DOMString>
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ impl HTMLCollection {
|
|||
HTMLCollection::create(window, root, ~filter)
|
||||
}
|
||||
|
||||
pub fn children(window: &JSRef<Window>, root: &JSRef<Node>) -> Unrooted<HTMLCollection> {
|
||||
pub fn children(window: &JSRef<Window>, root: &JSRef<Node>) -> Temporary<HTMLCollection> {
|
||||
struct ElementChildFilter;
|
||||
impl CollectionFilter for ElementChildFilter {
|
||||
fn filter(&self, elem: &JSRef<Element>, root: &JSRef<Node>) -> bool {
|
||||
|
@ -120,10 +120,10 @@ impl HTMLCollection {
|
|||
|
||||
pub trait HTMLCollectionMethods {
|
||||
fn Length(&self) -> u32;
|
||||
fn Item(&self, index: u32) -> Option<Unrooted<Element>>;
|
||||
fn NamedItem(&self, key: DOMString) -> Option<Unrooted<Element>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Unrooted<Element>>;
|
||||
fn NamedGetter(&self, maybe_name: Option<DOMString>, found: &mut bool) -> Option<Unrooted<Element>>;
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Element>>;
|
||||
fn NamedItem(&self, key: DOMString) -> Option<Temporary<Element>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Element>>;
|
||||
fn NamedGetter(&self, maybe_name: Option<DOMString>, found: &mut bool) -> Option<Temporary<Element>>;
|
||||
}
|
||||
|
||||
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<Unrooted<Element>> {
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Element>> {
|
||||
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<Unrooted<Element>> {
|
||||
fn NamedItem(&self, key: DOMString) -> Option<Temporary<Element>> {
|
||||
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<Unrooted<Element>> {
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Element>> {
|
||||
let maybe_elem = self.Item(index);
|
||||
*found = maybe_elem.is_some();
|
||||
maybe_elem
|
||||
}
|
||||
|
||||
fn NamedGetter(&self, maybe_name: Option<DOMString>, found: &mut bool) -> Option<Unrooted<Element>> {
|
||||
fn NamedGetter(&self, maybe_name: Option<DOMString>, found: &mut bool) -> Option<Temporary<Element>> {
|
||||
match maybe_name {
|
||||
Some(name) => {
|
||||
let maybe_elem = self.NamedItem(name);
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLDataElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataElement> {
|
||||
let element = HTMLDataElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLDataElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLDataListElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataListElement> {
|
||||
let element = HTMLDataListElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLDataListElementBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HTMLDataListElementMethods {
|
||||
fn Options(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Options(&self) -> Temporary<HTMLCollection>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLDataListElementMethods for JSRef<'a, HTMLDataListElement> {
|
||||
fn Options(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Options(&self) -> Temporary<HTMLCollection> {
|
||||
struct HTMLDataListOptionsFilter;
|
||||
impl CollectionFilter for HTMLDataListOptionsFilter {
|
||||
fn filter(&self, elem: &JSRef<Element>, _root: &JSRef<Node>) -> bool {
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLDirectoryElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDirectoryElement> {
|
||||
let element = HTMLDirectoryElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLDirectoryElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLDivElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDivElement> {
|
||||
let element = HTMLDivElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLDivElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLDListElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDListElement> {
|
||||
let element = HTMLDListElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLDListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLElement> {
|
||||
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<Unrooted<Element>>;
|
||||
fn GetOffsetParent(&self) -> Option<Temporary<Element>>;
|
||||
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<Unrooted<Element>> {
|
||||
fn GetOffsetParent(&self) -> Option<Temporary<Element>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLEmbedElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLEmbedElement> {
|
||||
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<Unrooted<Document>>;
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLEmbedElementMethods for JSRef<'a, HTMLEmbedElement> {
|
||||
|
@ -105,7 +105,7 @@ impl<'a> HTMLEmbedElementMethods for JSRef<'a, HTMLEmbedElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn GetSVGDocument(&self) -> Option<Unrooted<Document>> {
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLFieldSetElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFieldSetElement> {
|
||||
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<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
fn Name(&self) -> DOMString;
|
||||
fn SetName(&mut self, _name: DOMString) -> ErrorResult;
|
||||
fn Type(&self) -> DOMString;
|
||||
fn Elements(&self) -> Unrooted<HTMLCollection>;
|
||||
fn Elements(&self) -> Temporary<HTMLCollection>;
|
||||
fn WillValidate(&self) -> bool;
|
||||
fn Validity(&self) -> Unrooted<ValidityState>;
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
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<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> {
|
|||
}
|
||||
|
||||
// http://www.whatwg.org/html/#dom-fieldset-elements
|
||||
fn Elements(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Elements(&self) -> Temporary<HTMLCollection> {
|
||||
struct ElementsFilter;
|
||||
impl CollectionFilter for ElementsFilter {
|
||||
fn filter(&self, elem: &JSRef<Element>, root: &JSRef<Node>) -> bool {
|
||||
|
@ -105,7 +105,7 @@ impl<'a> HTMLFieldSetElementMethods for JSRef<'a, HTMLFieldSetElement> {
|
|||
false
|
||||
}
|
||||
|
||||
fn Validity(&self) -> Unrooted<ValidityState> {
|
||||
fn Validity(&self) -> Temporary<ValidityState> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
ValidityState::new(&*window)
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLFontElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFontElement> {
|
||||
let element = HTMLFontElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLFontElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLFormElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFormElement> {
|
||||
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<HTMLCollection>;
|
||||
fn Elements(&self) -> Temporary<HTMLCollection>;
|
||||
fn Length(&self) -> i32;
|
||||
fn Submit(&self) -> ErrorResult;
|
||||
fn Reset(&self);
|
||||
fn CheckValidity(&self) -> bool;
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Unrooted<Element>;
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Temporary<Element>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> {
|
||||
|
@ -141,7 +141,7 @@ impl<'a> HTMLFormElementMethods for JSRef<'a, HTMLFormElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn Elements(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Elements(&self) -> Temporary<HTMLCollection> {
|
||||
// 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<Element> {
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Temporary<Element> {
|
||||
fail!("Not implemented.")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLFrameElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameElement> {
|
||||
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<Unrooted<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>>;
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>>;
|
||||
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<Unrooted<Document>> {
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>> {
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLFrameSetElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameSetElement> {
|
||||
let element = HTMLFrameSetElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLFrameSetElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLHeadElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHeadElement> {
|
||||
let element = HTMLHeadElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLHeadElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>, level: HeadingLevel) -> Unrooted<HTMLHeadingElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> Temporary<HTMLHeadingElement> {
|
||||
let element = HTMLHeadingElement::new_inherited(localName, document.unrooted(), level);
|
||||
Node::reflect_node(~element, document, HTMLHeadingElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLHRElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHRElement> {
|
||||
let element = HTMLHRElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLHRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLHtmlElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHtmlElement> {
|
||||
let element = HTMLHtmlElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLHtmlElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLIFrameElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLIFrameElement> {
|
||||
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<Unrooted<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>>;
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>>;
|
||||
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<Unrooted<Document>>;
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
|
||||
|
@ -176,11 +176,11 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn GetContentDocument(&self) -> Option<Unrooted<Document>> {
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>> {
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn GetSVGDocument(&self) -> Option<Unrooted<Document>> {
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLImageElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLImageElement> {
|
||||
let element = HTMLImageElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLImageElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLInputElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLInputElement> {
|
||||
let element = HTMLInputElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLInputElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLLabelElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLabelElement> {
|
||||
let element = HTMLLabelElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLLabelElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLLegendElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLegendElement> {
|
||||
let element = HTMLLegendElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLLegendElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLLIElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLIElement> {
|
||||
let element = HTMLLIElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLLIElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLLinkElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLinkElement> {
|
||||
let element = HTMLLinkElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLLinkElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLMainElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMainElement> {
|
||||
let element = HTMLMainElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLMainElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLMapElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMapElement> {
|
||||
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<HTMLCollection>;
|
||||
fn Areas(&self) -> Temporary<HTMLCollection>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLMapElementMethods for JSRef<'a, HTMLMapElement> {
|
||||
|
@ -56,7 +56,7 @@ impl<'a> HTMLMapElementMethods for JSRef<'a, HTMLMapElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn Areas(&self) -> Unrooted<HTMLCollection> {
|
||||
fn Areas(&self) -> Temporary<HTMLCollection> {
|
||||
let roots = RootCollection::new();
|
||||
// FIXME: https://github.com/mozilla/servo/issues/1845
|
||||
let window = window_from_node(self).root(&roots);
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLMetaElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMetaElement> {
|
||||
let element = HTMLMetaElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLMetaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLMeterElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMeterElement> {
|
||||
let element = HTMLMeterElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLMeterElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLModElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLModElement> {
|
||||
let element = HTMLModElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLModElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLObjectElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLObjectElement> {
|
||||
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<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
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<Unrooted<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>>;
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>>;
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>>;
|
||||
fn WillValidate(&self) -> bool;
|
||||
fn Validity(&self) -> Unrooted<ValidityState>;
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
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<Unrooted<Document>>;
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>>;
|
||||
}
|
||||
|
||||
impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> {
|
||||
|
@ -157,7 +157,7 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn GetForm(&self) -> Option<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -177,11 +177,11 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn GetContentDocument(&self) -> Option<Unrooted<Document>> {
|
||||
fn GetContentDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn GetContentWindow(&self) -> Option<Unrooted<Window>> {
|
||||
fn GetContentWindow(&self) -> Option<Temporary<Window>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ impl<'a> HTMLObjectElementMethods for JSRef<'a, HTMLObjectElement> {
|
|||
false
|
||||
}
|
||||
|
||||
fn Validity(&self) -> Unrooted<ValidityState> {
|
||||
fn Validity(&self) -> Temporary<ValidityState> {
|
||||
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<Unrooted<Document>> {
|
||||
fn GetSVGDocument(&self) -> Option<Temporary<Document>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLOListElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOListElement> {
|
||||
let element = HTMLOListElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLOListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLOptGroupElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptGroupElement> {
|
||||
let element = HTMLOptGroupElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLOptGroupElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLOptionElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptionElement> {
|
||||
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<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
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<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLOutputElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOutputElement> {
|
||||
let element = HTMLOutputElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLOutputElementBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait HTMLOutputElementMethods {
|
||||
fn GetForm(&self) -> Option<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
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<ValidityState>;
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
fn SetValidity(&mut self, _validity: JS<ValidityState>);
|
||||
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<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ impl<'a> HTMLOutputElementMethods for JSRef<'a, HTMLOutputElement> {
|
|||
fn SetWillValidate(&mut self, _will_validate: bool) {
|
||||
}
|
||||
|
||||
fn Validity(&self) -> Unrooted<ValidityState> {
|
||||
fn Validity(&self) -> Temporary<ValidityState> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
ValidityState::new(&*window)
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLParagraphElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParagraphElement> {
|
||||
let element = HTMLParagraphElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLParagraphElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLParamElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParamElement> {
|
||||
let element = HTMLParamElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLParamElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLPreElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLPreElement> {
|
||||
let element = HTMLPreElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLPreElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLProgressElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLProgressElement> {
|
||||
let element = HTMLProgressElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLProgressElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLQuoteElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLQuoteElement> {
|
||||
let element = HTMLQuoteElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLQuoteElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLScriptElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLScriptElement> {
|
||||
let element = HTMLScriptElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLScriptElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLSelectElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSelectElement> {
|
||||
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<Unrooted<HTMLFormElement>>;
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>>;
|
||||
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<Unrooted<Element>>;
|
||||
fn NamedItem(&self, _name: DOMString) -> Option<Unrooted<HTMLOptionElement>>;
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Unrooted<Element>>;
|
||||
fn Item(&self, _index: u32) -> Option<Temporary<Element>>;
|
||||
fn NamedItem(&self, _name: DOMString) -> Option<Temporary<HTMLOptionElement>>;
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Temporary<Element>>;
|
||||
fn IndexedSetter(&mut self, _index: u32, _option: Option<JSRef<HTMLOptionElement>>) -> 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<ValidityState>;
|
||||
fn Validity(&self) -> Temporary<ValidityState>;
|
||||
fn SetValidity(&mut self, _validity: JS<ValidityState>);
|
||||
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<Unrooted<HTMLFormElement>> {
|
||||
fn GetForm(&self) -> Option<Temporary<HTMLFormElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -147,15 +147,15 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn Item(&self, _index: u32) -> Option<Unrooted<Element>> {
|
||||
fn Item(&self, _index: u32) -> Option<Temporary<Element>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn NamedItem(&self, _name: DOMString) -> Option<Unrooted<HTMLOptionElement>> {
|
||||
fn NamedItem(&self, _name: DOMString) -> Option<Temporary<HTMLOptionElement>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Unrooted<Element>> {
|
||||
fn IndexedGetter(&self, _index: u32, _found: &mut bool) -> Option<Temporary<Element>> {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
|
|||
fn SetWillValidate(&mut self, _will_validate: bool) {
|
||||
}
|
||||
|
||||
fn Validity(&self) -> Unrooted<ValidityState> {
|
||||
fn Validity(&self) -> Temporary<ValidityState> {
|
||||
let roots = RootCollection::new();
|
||||
let window = window_from_node(self).root(&roots);
|
||||
ValidityState::new(&*window)
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLSourceElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSourceElement> {
|
||||
let element = HTMLSourceElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLSourceElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLSpanElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSpanElement> {
|
||||
let element = HTMLSpanElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLSpanElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLStyleElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLStyleElement> {
|
||||
let element = HTMLStyleElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLStyleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableCaptionElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableCaptionElement> {
|
||||
let element = HTMLTableCaptionElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableCaptionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableColElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableColElement> {
|
||||
let element = HTMLTableColElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableColElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableDataCellElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableDataCellElement> {
|
||||
let element = HTMLTableDataCellElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableDataCellElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> {
|
||||
let element = HTMLTableElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableHeaderCellElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableHeaderCellElement> {
|
||||
let element = HTMLTableHeaderCellElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableHeaderCellElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableRowElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableRowElement> {
|
||||
let element = HTMLTableRowElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableRowElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTableSectionElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableSectionElement> {
|
||||
let element = HTMLTableSectionElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTableSectionElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTemplateElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTemplateElement> {
|
||||
let element = HTMLTemplateElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTemplateElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTextAreaElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTextAreaElement> {
|
||||
let element = HTMLTextAreaElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTextAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTimeElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTimeElement> {
|
||||
let element = HTMLTimeElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTimeElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTitleElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTitleElement> {
|
||||
let element = HTMLTitleElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTitleElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLTrackElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTrackElement> {
|
||||
let element = HTMLTrackElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLTrackElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLUListElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUListElement> {
|
||||
let element = HTMLUListElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLUListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLUnknownElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUnknownElement> {
|
||||
let element = HTMLUnknownElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLUnknownElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Document>) -> Unrooted<HTMLVideoElement> {
|
||||
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLVideoElement> {
|
||||
let element = HTMLVideoElement::new_inherited(localName, document.unrooted());
|
||||
Node::reflect_node(~element, document, HTMLVideoElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Window>, page: Rc<Page>) -> Unrooted<Location> {
|
||||
pub fn new(window: &JSRef<Window>, page: Rc<Page>) -> Temporary<Location> {
|
||||
reflect_dom_object(~Location::new_inherited(page),
|
||||
window,
|
||||
LocationBinding::Wrap)
|
||||
|
|
|
@ -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<Window>) -> Unrooted<MouseEvent> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<MouseEvent> {
|
||||
reflect_dom_object(~MouseEvent::new_inherited(),
|
||||
window,
|
||||
MouseEventBinding::Wrap)
|
||||
|
@ -59,7 +59,7 @@ impl MouseEvent {
|
|||
|
||||
pub fn Constructor(owner: &JSRef<Window>,
|
||||
type_: DOMString,
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<Unrooted<MouseEvent>> {
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<Temporary<MouseEvent>> {
|
||||
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<Unrooted<EventTarget>>;
|
||||
fn GetRelatedTarget(&self) -> Option<Temporary<EventTarget>>;
|
||||
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<Unrooted<EventTarget>> {
|
||||
self.related_target.clone().map(|target| Unrooted::new(target))
|
||||
fn GetRelatedTarget(&self) -> Option<Temporary<EventTarget>> {
|
||||
self.related_target.clone().map(|target| Temporary::new(target))
|
||||
}
|
||||
|
||||
fn GetModifierState(&self, _keyArg: DOMString) -> bool {
|
||||
|
|
|
@ -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<Window>) -> Unrooted<Navigator> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<Navigator> {
|
||||
reflect_dom_object(~Navigator::new_inherited(),
|
||||
window,
|
||||
NavigatorBinding::Wrap)
|
||||
|
|
|
@ -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<Unrooted<Node>>;
|
||||
fn first_child(&self) -> Option<Unrooted<Node>>;
|
||||
fn last_child(&self) -> Option<Unrooted<Node>>;
|
||||
fn prev_sibling(&self) -> Option<Unrooted<Node>>;
|
||||
fn next_sibling(&self) -> Option<Unrooted<Node>>;
|
||||
fn parent_node(&self) -> Option<Temporary<Node>>;
|
||||
fn first_child(&self) -> Option<Temporary<Node>>;
|
||||
fn last_child(&self) -> Option<Temporary<Node>>;
|
||||
fn prev_sibling(&self) -> Option<Temporary<Node>>;
|
||||
fn next_sibling(&self) -> Option<Temporary<Node>>;
|
||||
|
||||
fn owner_doc(&self) -> Unrooted<Document>;
|
||||
fn owner_doc(&self) -> Temporary<Document>;
|
||||
fn set_owner_doc(&mut self, document: &JSRef<Document>);
|
||||
|
||||
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<Unrooted<Node>> {
|
||||
self.get().parent_node.clone().map(|node| Unrooted::new(node))
|
||||
fn parent_node(&self) -> Option<Temporary<Node>> {
|
||||
self.get().parent_node.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
fn first_child(&self) -> Option<Unrooted<Node>> {
|
||||
self.get().first_child.clone().map(|node| Unrooted::new(node))
|
||||
fn first_child(&self) -> Option<Temporary<Node>> {
|
||||
self.get().first_child.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
fn last_child(&self) -> Option<Unrooted<Node>> {
|
||||
self.get().last_child.clone().map(|node| Unrooted::new(node))
|
||||
fn last_child(&self) -> Option<Temporary<Node>> {
|
||||
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<Unrooted<Node>> {
|
||||
self.get().prev_sibling.clone().map(|node| Unrooted::new(node))
|
||||
fn prev_sibling(&self) -> Option<Temporary<Node>> {
|
||||
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<Unrooted<Node>> {
|
||||
self.get().next_sibling.clone().map(|node| Unrooted::new(node))
|
||||
fn next_sibling(&self) -> Option<Temporary<Node>> {
|
||||
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<Node>) -> 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<Document> {
|
||||
Unrooted::new(self.owner_doc.get_ref().clone())
|
||||
fn owner_doc(&self) -> Temporary<Document> {
|
||||
Temporary::new(self.owner_doc.get_ref().clone())
|
||||
}
|
||||
|
||||
fn set_owner_doc(&mut self, document: &JSRef<Document>) {
|
||||
|
@ -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<Node> {
|
||||
-> Temporary<Node> {
|
||||
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<Node>` 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<Document>,
|
||||
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~N) -> JS<N>)
|
||||
-> Unrooted<N> {
|
||||
-> Temporary<N> {
|
||||
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<Document>) -> Node {
|
||||
|
@ -977,7 +977,7 @@ impl Node {
|
|||
|
||||
// http://dom.spec.whatwg.org/#concept-node-pre-insert
|
||||
fn pre_insert(node: &mut JSRef<Node>, parent: &mut JSRef<Node>, child: Option<JSRef<Node>>)
|
||||
-> Fallible<Unrooted<Node>> {
|
||||
-> Fallible<Temporary<Node>> {
|
||||
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<Node>, parent: &mut JSRef<Node>) -> Fallible<Unrooted<Node>> {
|
||||
fn pre_remove(child: &mut JSRef<Node>, parent: &mut JSRef<Node>) -> Fallible<Temporary<Node>> {
|
||||
// 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<Node>, parent: &mut JSRef<Node>, 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<Node>, maybe_doc: Option<&JSRef<Document>>,
|
||||
clone_children: CloneChildrenFlag) -> Unrooted<Node> {
|
||||
clone_children: CloneChildrenFlag) -> Temporary<Node> {
|
||||
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<DOMString>;
|
||||
fn GetOwnerDocument(&self) -> Option<Unrooted<Document>>;
|
||||
fn GetParentNode(&self) -> Option<Unrooted<Node>>;
|
||||
fn GetParentElement(&self) -> Option<Unrooted<Element>>;
|
||||
fn GetOwnerDocument(&self) -> Option<Temporary<Document>>;
|
||||
fn GetParentNode(&self) -> Option<Temporary<Node>>;
|
||||
fn GetParentElement(&self) -> Option<Temporary<Element>>;
|
||||
fn HasChildNodes(&self) -> bool;
|
||||
fn ChildNodes(&mut self) -> Unrooted<NodeList>;
|
||||
fn GetFirstChild(&self) -> Option<Unrooted<Node>>;
|
||||
fn GetLastChild(&self) -> Option<Unrooted<Node>>;
|
||||
fn GetPreviousSibling(&self) -> Option<Unrooted<Node>>;
|
||||
fn GetNextSibling(&self) -> Option<Unrooted<Node>>;
|
||||
fn ChildNodes(&mut self) -> Temporary<NodeList>;
|
||||
fn GetFirstChild(&self) -> Option<Temporary<Node>>;
|
||||
fn GetLastChild(&self) -> Option<Temporary<Node>>;
|
||||
fn GetPreviousSibling(&self) -> Option<Temporary<Node>>;
|
||||
fn GetNextSibling(&self) -> Option<Temporary<Node>>;
|
||||
fn GetNodeValue(&self) -> Option<DOMString>;
|
||||
fn SetNodeValue(&mut self, val: Option<DOMString>) -> ErrorResult;
|
||||
fn GetTextContent(&self) -> Option<DOMString>;
|
||||
fn SetTextContent(&mut self, value: Option<DOMString>) -> ErrorResult;
|
||||
fn InsertBefore(&mut self, node: &mut JSRef<Node>, child: Option<JSRef<Node>>) -> Fallible<Unrooted<Node>>;
|
||||
fn AppendChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Unrooted<Node>>;
|
||||
fn ReplaceChild(&mut self, node: &mut JSRef<Node>, child: &mut JSRef<Node>) -> Fallible<Unrooted<Node>>;
|
||||
fn RemoveChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Unrooted<Node>>;
|
||||
fn InsertBefore(&mut self, node: &mut JSRef<Node>, child: Option<JSRef<Node>>) -> Fallible<Temporary<Node>>;
|
||||
fn AppendChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||
fn ReplaceChild(&mut self, node: &mut JSRef<Node>, child: &mut JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||
fn RemoveChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Temporary<Node>>;
|
||||
fn Normalize(&mut self);
|
||||
fn CloneNode(&self, deep: bool) -> Unrooted<Node>;
|
||||
fn CloneNode(&self, deep: bool) -> Temporary<Node>;
|
||||
fn IsEqualNode(&self, maybe_node: Option<JSRef<Node>>) -> bool;
|
||||
fn CompareDocumentPosition(&self, other: &JSRef<Node>) -> u16;
|
||||
fn Contains(&self, maybe_other: Option<JSRef<Node>>) -> bool;
|
||||
|
@ -1443,7 +1443,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
|||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-ownerdocument
|
||||
fn GetOwnerDocument(&self) -> Option<Unrooted<Document>> {
|
||||
fn GetOwnerDocument(&self) -> Option<Temporary<Document>> {
|
||||
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<Unrooted<Node>> {
|
||||
self.parent_node.clone().map(|node| Unrooted::new(node))
|
||||
fn GetParentNode(&self) -> Option<Temporary<Node>> {
|
||||
self.parent_node.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-parentelement
|
||||
fn GetParentElement(&self) -> Option<Unrooted<Element>> {
|
||||
fn GetParentElement(&self) -> Option<Temporary<Element>> {
|
||||
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<NodeList> {
|
||||
fn ChildNodes(&mut self) -> Temporary<NodeList> {
|
||||
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<Unrooted<Node>> {
|
||||
self.first_child.clone().map(|node| Unrooted::new(node))
|
||||
fn GetFirstChild(&self) -> Option<Temporary<Node>> {
|
||||
self.first_child.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-lastchild
|
||||
fn GetLastChild(&self) -> Option<Unrooted<Node>> {
|
||||
self.last_child.clone().map(|node| Unrooted::new(node))
|
||||
fn GetLastChild(&self) -> Option<Temporary<Node>> {
|
||||
self.last_child.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-previoussibling
|
||||
fn GetPreviousSibling(&self) -> Option<Unrooted<Node>> {
|
||||
self.prev_sibling.clone().map(|node| Unrooted::new(node))
|
||||
fn GetPreviousSibling(&self) -> Option<Temporary<Node>> {
|
||||
self.prev_sibling.clone().map(|node| Temporary::new(node))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-nextsibling
|
||||
fn GetNextSibling(&self) -> Option<Unrooted<Node>> {
|
||||
self.next_sibling.clone().map(|node| Unrooted::new(node))
|
||||
fn GetNextSibling(&self) -> Option<Temporary<Node>> {
|
||||
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<Node>, child: Option<JSRef<Node>>) -> Fallible<Unrooted<Node>> {
|
||||
fn InsertBefore(&mut self, node: &mut JSRef<Node>, child: Option<JSRef<Node>>) -> Fallible<Temporary<Node>> {
|
||||
Node::pre_insert(node, self, child)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-node-appendchild
|
||||
fn AppendChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Unrooted<Node>> {
|
||||
fn AppendChild(&mut self, node: &mut JSRef<Node>) -> Fallible<Temporary<Node>> {
|
||||
Node::pre_insert(node, self, None)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#concept-node-replace
|
||||
fn ReplaceChild(&mut self, node: &mut JSRef<Node>, child: &mut JSRef<Node>) -> Fallible<Unrooted<Node>> {
|
||||
fn ReplaceChild(&mut self, node: &mut JSRef<Node>, child: &mut JSRef<Node>) -> Fallible<Temporary<Node>> {
|
||||
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<Node>)
|
||||
-> Fallible<Unrooted<Node>> {
|
||||
-> Fallible<Temporary<Node>> {
|
||||
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<Node> {
|
||||
fn CloneNode(&self, deep: bool) -> Temporary<Node> {
|
||||
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<T: NodeBase>(derived: &JSRef<T>) -> Unrooted<Document> {
|
||||
pub fn document_from_node<T: NodeBase>(derived: &JSRef<T>) -> Temporary<Document> {
|
||||
let node: &JSRef<Node> = NodeCast::from_ref(derived);
|
||||
node.owner_doc()
|
||||
}
|
||||
|
||||
pub fn window_from_node<T: NodeBase>(derived: &JSRef<T>) -> Unrooted<Window> {
|
||||
pub fn window_from_node<T: NodeBase>(derived: &JSRef<T>) -> Temporary<Window> {
|
||||
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> {
|
||||
|
|
|
@ -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<Window>,
|
||||
list_type: NodeListType) -> Unrooted<NodeList> {
|
||||
list_type: NodeListType) -> Temporary<NodeList> {
|
||||
reflect_dom_object(~NodeList::new_inherited(window.unrooted(), list_type),
|
||||
window, NodeListBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn new_simple_list(window: &JSRef<Window>, elements: Vec<JSRef<Node>>) -> Unrooted<NodeList> {
|
||||
pub fn new_simple_list(window: &JSRef<Window>, elements: Vec<JSRef<Node>>) -> Temporary<NodeList> {
|
||||
NodeList::new(window, Simple(elements.iter().map(|element| element.unrooted()).collect()))
|
||||
}
|
||||
|
||||
pub fn new_child_list(window: &JSRef<Window>, node: &JSRef<Node>) -> Unrooted<NodeList> {
|
||||
pub fn new_child_list(window: &JSRef<Window>, node: &JSRef<Node>) -> Temporary<NodeList> {
|
||||
NodeList::new(window, Children(node.unrooted()))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait NodeListMethods {
|
||||
fn Length(&self) -> u32;
|
||||
fn Item(&self, index: u32) -> Option<Unrooted<Node>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Unrooted<Node>>;
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Node>>;
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Node>>;
|
||||
}
|
||||
|
||||
impl<'a> NodeListMethods for JSRef<'a, NodeList> {
|
||||
|
@ -64,20 +64,20 @@ impl<'a> NodeListMethods for JSRef<'a, NodeList> {
|
|||
}
|
||||
}
|
||||
|
||||
fn Item(&self, index: u32) -> Option<Unrooted<Node>> {
|
||||
fn Item(&self, index: u32) -> Option<Temporary<Node>> {
|
||||
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<Unrooted<Node>> {
|
||||
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Node>> {
|
||||
let item = self.Item(index);
|
||||
*found = item.is_some();
|
||||
item
|
||||
|
|
|
@ -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<Document>) -> Unrooted<ProcessingInstruction> {
|
||||
pub fn new(target: DOMString, data: DOMString, document: &JSRef<Document>) -> Temporary<ProcessingInstruction> {
|
||||
let node = ProcessingInstruction::new_inherited(target, data, document.unrooted());
|
||||
Node::reflect_node(~node, document, ProcessingInstructionBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -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<Blob>;
|
||||
fn InterfaceAttribute(&self) -> Temporary<Blob>;
|
||||
fn SetInterfaceAttribute(&self, _: &JSRef<Blob>);
|
||||
fn AnyAttribute(&self, _: *JSContext) -> JSVal;
|
||||
fn SetAnyAttribute(&self, _: *JSContext, _: JSVal);
|
||||
|
@ -83,7 +83,7 @@ pub trait TestBindingMethods {
|
|||
fn GetStringAttributeNullable(&self) -> Option<DOMString>;
|
||||
fn SetStringAttributeNullable(&self, _: Option<DOMString>);
|
||||
fn GetEnumAttributeNullable(&self) -> Option<TestEnum>;
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Unrooted<Blob>>;
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Temporary<Blob>>;
|
||||
fn SetInterfaceAttributeNullable(&self, _: Option<JSRef<Blob>>);
|
||||
|
||||
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<Blob> {
|
||||
fn InterfaceAttribute(&self) -> Temporary<Blob> {
|
||||
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<DOMString> { Some(~"") }
|
||||
fn SetStringAttributeNullable(&self, _: Option<DOMString>) {}
|
||||
fn GetEnumAttributeNullable(&self) -> Option<TestEnum> { Some(_empty) }
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Unrooted<Blob>> {
|
||||
fn GetInterfaceAttributeNullable(&self) -> Option<Temporary<Blob>> {
|
||||
let roots = RootCollection::new();
|
||||
let window = self.window.root(&roots);
|
||||
Some(Blob::new(&(*window)))
|
||||
|
|
|
@ -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<Document>) -> Unrooted<Text> {
|
||||
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Text> {
|
||||
let node = Text::new_inherited(text, document.unrooted());
|
||||
Node::reflect_node(~node, document, TextBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JSRef<Window>, text: DOMString) -> Fallible<Unrooted<Text>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>, text: DOMString) -> Fallible<Temporary<Text>> {
|
||||
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<Unrooted<Text>>;
|
||||
fn SplitText(&self, _offset: u32) -> Fallible<Temporary<Text>>;
|
||||
fn GetWholeText(&self) -> Fallible<DOMString>;
|
||||
}
|
||||
|
||||
impl<'a> TextMethods for JSRef<'a, Text> {
|
||||
fn SplitText(&self, _offset: u32) -> Fallible<Unrooted<Text>> {
|
||||
fn SplitText(&self, _offset: u32) -> Fallible<Temporary<Text>> {
|
||||
fail!("unimplemented")
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Window>) -> Unrooted<UIEvent> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<UIEvent> {
|
||||
reflect_dom_object(~UIEvent::new_inherited(UIEventTypeId),
|
||||
window,
|
||||
UIEventBinding::Wrap)
|
||||
|
@ -44,25 +44,25 @@ impl UIEvent {
|
|||
|
||||
pub fn Constructor(owner: &JSRef<Window>,
|
||||
type_: DOMString,
|
||||
init: &UIEventBinding::UIEventInit) -> Fallible<Unrooted<UIEvent>> {
|
||||
init: &UIEventBinding::UIEventInit) -> Fallible<Temporary<UIEvent>> {
|
||||
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<Unrooted<Window>>;
|
||||
fn GetView(&self) -> Option<Temporary<Window>>;
|
||||
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<Unrooted<Node>>;
|
||||
fn GetRangeParent(&self) -> Option<Temporary<Node>>;
|
||||
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<Unrooted<Window>> {
|
||||
self.view.clone().map(|view| Unrooted::new(view))
|
||||
fn GetView(&self) -> Option<Temporary<Window>> {
|
||||
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<Unrooted<Node>> {
|
||||
fn GetRangeParent(&self) -> Option<Temporary<Node>> {
|
||||
//TODO
|
||||
None
|
||||
}
|
||||
|
|
|
@ -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<Window>) -> Unrooted<ValidityState> {
|
||||
pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> {
|
||||
reflect_dom_object(~ValidityState::new_inherited(window.unrooted()),
|
||||
window,
|
||||
ValidityStateBinding::Wrap)
|
||||
|
|
|
@ -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<Document>;
|
||||
fn Document(&self) -> Temporary<Document>;
|
||||
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<Unrooted<Element>>;
|
||||
fn Location(&mut self) -> Unrooted<Location>;
|
||||
fn Console(&mut self) -> Unrooted<Console>;
|
||||
fn Navigator(&mut self) -> Unrooted<Navigator>;
|
||||
fn GetFrameElement(&self) -> Option<Temporary<Element>>;
|
||||
fn Location(&mut self) -> Temporary<Location>;
|
||||
fn Console(&mut self) -> Temporary<Console>;
|
||||
fn Navigator(&mut self) -> Temporary<Navigator>;
|
||||
fn Confirm(&self, _message: DOMString) -> bool;
|
||||
fn Prompt(&self, _message: DOMString, _default: DOMString) -> Option<DOMString>;
|
||||
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<Window>;
|
||||
fn Self(&self) -> Unrooted<Window>;
|
||||
fn Window(&self) -> Temporary<Window>;
|
||||
fn Self(&self) -> Temporary<Window>;
|
||||
}
|
||||
|
||||
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<Document> {
|
||||
fn Document(&self) -> Temporary<Document> {
|
||||
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<Unrooted<Element>> {
|
||||
fn GetFrameElement(&self) -> Option<Temporary<Element>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn Location(&mut self) -> Unrooted<Location> {
|
||||
fn Location(&mut self) -> Temporary<Location> {
|
||||
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<Console> {
|
||||
fn Console(&mut self) -> Temporary<Console> {
|
||||
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<Navigator> {
|
||||
fn Navigator(&mut self) -> Temporary<Navigator> {
|
||||
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<Window> {
|
||||
Unrooted::new_rooted(self)
|
||||
fn Window(&self) -> Temporary<Window> {
|
||||
Temporary::new_rooted(self)
|
||||
}
|
||||
|
||||
fn Self(&self) -> Unrooted<Window> {
|
||||
fn Self(&self) -> Temporary<Window> {
|
||||
self.Window()
|
||||
}
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ impl Window {
|
|||
script_chan: ScriptChan,
|
||||
compositor: ~ScriptListener,
|
||||
image_cache_task: ImageCacheTask)
|
||||
-> Unrooted<Window> {
|
||||
-> Temporary<Window> {
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue