Address review comments.

This commit is contained in:
Josh Matthews 2014-04-18 00:12:52 -04:00
parent 7b3e6d1f21
commit 0f2d0b1dc3
99 changed files with 388 additions and 380 deletions

View file

@ -17,16 +17,16 @@ pub struct AttrList {
} }
impl AttrList { impl AttrList {
pub fn new_inherited(window: JS<Window>, elem: JS<Element>) -> AttrList { pub fn new_inherited(window: &JSRef<Window>, elem: &JSRef<Element>) -> AttrList {
AttrList { AttrList {
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
owner: elem owner: elem.unrooted(),
} }
} }
pub fn new(window: &JSRef<Window>, elem: &JSRef<Element>) -> Temporary<AttrList> { pub fn new(window: &JSRef<Window>, elem: &JSRef<Element>) -> Temporary<AttrList> {
reflect_dom_object(~AttrList::new_inherited(window.unrooted(), elem.unrooted()), reflect_dom_object(~AttrList::new_inherited(window, elem),
window, AttrListBinding::Wrap) window, AttrListBinding::Wrap)
} }
} }
@ -37,7 +37,7 @@ pub trait AttrListMethods {
fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>>; fn IndexedGetter(&self, index: u32, found: &mut bool) -> Option<Temporary<Attr>>;
} }
impl<'a> AttrListMethods for JSRef<'a, AttrList> { impl<'a> AttrListMethods for JSRef<'a, AttrList> {
fn Length(&self) -> u32 { fn Length(&self) -> u32 {
self.owner.root().attrs.len() as u32 self.owner.root().attrs.len() as u32
} }

View file

@ -558,15 +558,6 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
else: else:
assert(defaultValue is None) assert(defaultValue is None)
#if type.isGeckoInterface() and not type.unroll().inner.isCallback():
# if type.nullable() or isOptional:
#
# else:
#
# templateBody = CGList([CGGeneric(templateBody),
# CGGeneric("\n"),
# CGGeneric(rootBody)]).define()
return templateBody return templateBody
assert not (isEnforceRange and isClamp) # These are mutually exclusive assert not (isEnforceRange and isClamp) # These are mutually exclusive
@ -901,12 +892,7 @@ def instantiateJSToNativeConversionTemplate(templateTuple, replacements,
type = declType.define() if declType else None type = declType.define() if declType else None
if type and 'JS<' in type: if type and 'JS<' in type:
if dealWithOptional or 'Option<' in type: rootBody = "let ${simpleDeclName} = ${declName}.root();"
rootBody = """let ${simpleDeclName} = ${declName}.as_ref().map(|inner| {
inner.root() //second root code
});"""
else:
rootBody = "let ${simpleDeclName} = ${declName}.root(); //third root code"
result.append(CGGeneric(string.Template(rootBody).substitute(replacements))) result.append(CGGeneric(string.Template(rootBody).substitute(replacements)))
result.append(CGGeneric("")) result.append(CGGeneric(""))
@ -1725,8 +1711,6 @@ class Argument():
A class for outputting the type and name of an argument A class for outputting the type and name of an argument
""" """
def __init__(self, argType, name, default=None, mutable=False): def __init__(self, argType, name, default=None, mutable=False):
if argType and 'JS<' in argType:
argType = argType.replace('JS<', 'JSRef<')
self.argType = argType self.argType = argType
self.name = name self.name = name
self.default = default self.default = default
@ -4321,7 +4305,7 @@ class CGBindingRoot(CGThing):
'js::glue::{RUST_JS_NumberValue, RUST_JSID_IS_STRING}', 'js::glue::{RUST_JS_NumberValue, RUST_JSID_IS_STRING}',
'dom::types::*', 'dom::types::*',
'dom::bindings', 'dom::bindings',
'dom::bindings::js::{JS, JSRef, RootedReference, Temporary, OptionalRootable}', 'dom::bindings::js::{JS, JSRef, RootedReference, Temporary, OptionalRootable, OptionalRootedRootable}',
'dom::bindings::utils::{CreateDOMGlobal, CreateInterfaceObjects2}', 'dom::bindings::utils::{CreateDOMGlobal, CreateInterfaceObjects2}',
'dom::bindings::utils::{ConstantSpec, cx_for_dom_object, Default}', 'dom::bindings::utils::{ConstantSpec, cx_for_dom_object, Default}',
'dom::bindings::utils::{dom_object_slot, DOM_OBJECT_SLOT, DOMClass}', 'dom::bindings::utils::{dom_object_slot, DOM_OBJECT_SLOT, DOMClass}',
@ -4603,7 +4587,7 @@ class CGNativeMember(ClassMethod):
else: else:
typeDecl = "%s" typeDecl = "%s"
descriptor = self.descriptorProvider.getDescriptor(iface.identifier.name) descriptor = self.descriptorProvider.getDescriptor(iface.identifier.name)
return (typeDecl % descriptor.nativeType, return (typeDecl % descriptor.argumentType,
False, False) False, False)
if type.isSpiderMonkeyInterface(): if type.isSpiderMonkeyInterface():

View file

@ -134,6 +134,7 @@ class Descriptor(DescriptorProvider):
nativeTypeDefault = 'JS<%s>' % ifaceName nativeTypeDefault = 'JS<%s>' % ifaceName
self.returnType = "Temporary<%s>" % ifaceName self.returnType = "Temporary<%s>" % ifaceName
self.argumentType = "JSRef<%s>" % ifaceName
self.nativeType = desc.get('nativeType', nativeTypeDefault) self.nativeType = desc.get('nativeType', nativeTypeDefault)
self.concreteType = desc.get('concreteType', ifaceName) self.concreteType = desc.get('concreteType', ifaceName)
self.createGlobal = desc.get('createGlobal', False) self.createGlobal = desc.get('createGlobal', False)

View file

@ -2,6 +2,43 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/// The DOM is made up of Rust types whose lifetime is entirely controlled by the whims of
/// the SpiderMonkey garbage collector. The types in this module are designed to ensure
/// that any interactions with said Rust types only occur on values that will remain alive
/// the entire time.
///
/// Here is a brief overview of the important types:
/// - JSRef<T>: a freely-copyable reference to a rooted value.
/// - JS<T>: a pointer to JS-owned memory that can automatically be traced by the GC when
/// encountered as a field of a Rust structure.
/// - Temporary<T>: a value that will remain rooted for the duration of its lifetime.
///
/// The rule of thumb is as follows:
/// - All methods return Temporary<T>, to ensure the value remains alive until it is stored
/// somewhere that is reachable by the GC.
/// - All functions take &JSRef<T> arguments, to ensure that they will remain uncollected for
/// the duration of their usage.
/// - All types contain JS<T> fields and derive the Encodable trait, to ensure that they are
/// transitively marked as reachable by the GC if the enclosing value is reachable.
/// - All methods for type T are implemented for JSRef<T>, to ensure that the self value
/// will not be collected for the duration of the method call.
///
/// Both Temporary<T> and JS<T> do not allow access to their inner value without explicitly
/// creating a stack-based root via the `root` method. This returns a Root<T>, which causes
/// the JS-owned value to be uncollectable for the duration of the Root type's lifetime.
/// A JSRef<T> can be obtained from a Root<T> either by dereferencing the Root<T> (`*rooted`)
/// or explicitly calling the `root_ref` method. These JSRef<T> values are not allowed to
/// outlive their originating Root<T>, to ensure that all interactions with the enclosed value
/// only occur when said value is uncollectable, and will cause static lifetime errors if
/// misused.
///
/// Other miscellaneous helper traits:
/// - OptionalRootable and OptionalRootedRootable: make rooting Option values easy via a `root` method
/// - ResultRootable: make rooting successful Result values easy
/// - TemporaryPushable: allows mutating vectors of JS<T> with new elements of JSRef/Temporary
/// - OptionalSettable: allows assigning Option values of JSRef/Temporary to fields of Option<JS<T>>
/// - RootedReference: makes obtaining an Option<JSRef<T>> from an Option<Root<T>> easy
use dom::bindings::utils::{Reflector, Reflectable, cx_for_dom_object}; use dom::bindings::utils::{Reflector, Reflectable, cx_for_dom_object};
use dom::window::Window; use dom::window::Window;
use js::jsapi::{JSObject, JSContext, JS_AddObjectRoot, JS_RemoveObjectRoot}; use js::jsapi::{JSObject, JSContext, JS_AddObjectRoot, JS_RemoveObjectRoot};
@ -15,7 +52,7 @@ use std::local_data;
/// A type that represents a JS-owned value that is rooted for the lifetime of this value. /// A type that represents a JS-owned value that is rooted for the lifetime of this value.
/// Importantly, it requires explicit rooting in order to interact with the inner value. /// Importantly, it requires explicit rooting in order to interact with the inner value.
/// Can be assigned into JS-owned member fields (ie. JS<T> types) safely via the /// 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). /// `JS<T>::assign` method or `OptionalSettable::assign` (for Option<JS<T>> fields).
pub struct Temporary<T> { pub struct Temporary<T> {
inner: JS<T>, inner: JS<T>,
} }
@ -49,7 +86,7 @@ impl<T: Reflectable> Temporary<T> {
} }
/// Create a new Temporary value from a rooted value. /// Create a new Temporary value from a rooted value.
pub fn new_rooted<'a>(root: &JSRef<'a, T>) -> Temporary<T> { pub fn from_rooted<'a>(root: &JSRef<'a, T>) -> Temporary<T> {
Temporary::new(root.unrooted()) Temporary::new(root.unrooted())
} }
@ -182,39 +219,38 @@ impl<'a, 'b, T: Reflectable> RootedReference<T> for Option<Root<'a, 'b, T>> {
} }
} }
// This trait should never be public; it allows access to unrooted values, and is thus /// Trait that allows extracting a JS<T> value from a variety of rooting-related containers,
// easy to misuse. /// which in general is an unsafe operation since they can outlive the rooted lifetime of the
/// original value.
/*definitely not public*/ trait Assignable<T> { /*definitely not public*/ trait Assignable<T> {
fn get_js(&self) -> JS<T>; unsafe fn get_js(&self) -> JS<T>;
} }
impl<T> Assignable<T> for JS<T> { impl<T> Assignable<T> for JS<T> {
fn get_js(&self) -> JS<T> { unsafe fn get_js(&self) -> JS<T> {
self.clone() self.clone()
} }
} }
impl<'a, T> Assignable<T> for JSRef<'a, T> { impl<'a, T> Assignable<T> for JSRef<'a, T> {
fn get_js(&self) -> JS<T> { unsafe fn get_js(&self) -> JS<T> {
self.unrooted() self.unrooted()
} }
} }
// 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 Temporary<T> { impl<T: Reflectable> Assignable<T> for Temporary<T> {
fn get_js(&self) -> JS<T> { unsafe fn get_js(&self) -> JS<T> {
unsafe { self.inner() } self.inner()
} }
} }
pub trait OptionalAssignable<T> { pub trait OptionalSettable<T> {
fn assign(&mut self, val: Option<T>); fn assign(&mut self, val: Option<T>);
} }
impl<T: Assignable<U>, U: Reflectable> OptionalAssignable<T> for Option<JS<U>> { impl<T: Assignable<U>, U: Reflectable> OptionalSettable<T> for Option<JS<U>> {
fn assign(&mut self, val: Option<T>) { fn assign(&mut self, val: Option<T>) {
*self = val.map(|val| val.get_js()); *self = val.map(|val| unsafe { val.get_js() });
} }
} }
@ -252,12 +288,17 @@ impl<T: Reflectable, U> ResultRootable<T, U> for Result<Temporary<T>, U> {
/// under the assumption that said lists are reachable via the GC graph, and therefore the /// 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. /// new values are transitively rooted for the lifetime of their new owner.
pub trait TemporaryPushable<T> { pub trait TemporaryPushable<T> {
fn push_unrooted(&mut self, val: Temporary<T>); fn push_unrooted(&mut self, val: &T);
fn insert_unrooted(&mut self, index: uint, val: &T);
} }
impl<T: Reflectable> TemporaryPushable<T> for Vec<JS<T>> { impl<T: Assignable<U>, U: Reflectable> TemporaryPushable<T> for Vec<JS<U>> {
fn push_unrooted(&mut self, val: Temporary<T>) { fn push_unrooted(&mut self, val: &T) {
unsafe { self.push(val.inner()) }; self.push(unsafe { val.get_js() });
}
fn insert_unrooted(&mut self, index: uint, val: &T) {
self.insert(index, unsafe { val.get_js() });
} }
} }
@ -277,26 +318,16 @@ impl RootCollection {
Root::new(self, unrooted) Root::new(self, unrooted)
} }
fn root<'a, 'b, T: Reflectable>(&self, unrooted: &Root<'a, 'b, T>) { fn root<'a, 'b, T: Reflectable>(&self, untracked: &Root<'a, 'b, T>) {
self.root_raw(unrooted.js_ptr);
}
/// Root a raw JS pointer.
pub fn root_raw(&self, unrooted: *JSObject) {
let mut roots = self.roots.borrow_mut(); let mut roots = self.roots.borrow_mut();
roots.push(unrooted); roots.push(untracked.js_ptr);
debug!(" rooting {:?}", unrooted); debug!(" rooting {:?}", untracked.js_ptr);
} }
fn unroot<'a, 'b, T: Reflectable>(&self, rooted: &Root<'a, 'b, T>) { fn unroot<'a, 'b, T: Reflectable>(&self, rooted: &Root<'a, 'b, T>) {
self.unroot_raw(rooted.js_ptr);
}
/// Unroot a raw JS pointer. Must occur in reverse order to its rooting.
pub fn unroot_raw(&self, rooted: *JSObject) {
let mut roots = self.roots.borrow_mut(); let mut roots = self.roots.borrow_mut();
debug!("unrooting {:?} (expecting {:?}", roots.last().unwrap(), rooted); debug!("unrooting {:?} (expecting {:?}", roots.last().unwrap(), rooted.js_ptr);
assert!(*roots.last().unwrap() == rooted); assert!(*roots.last().unwrap() == rooted.js_ptr);
roots.pop().unwrap(); roots.pop().unwrap();
} }
} }

View file

@ -412,6 +412,9 @@ impl Reflector {
self.object = object; self.object = object;
} }
/// Return a pointer to the memory location at which the JS reflector object is stored.
/// Used by Temporary values to root the reflector, as required by the JSAPI rooting
/// APIs.
pub fn rootable(&self) -> **JSObject { pub fn rootable(&self) -> **JSObject {
&self.object as **JSObject &self.object as **JSObject
} }

View file

@ -16,15 +16,15 @@ pub struct Blob {
} }
impl Blob { impl Blob {
pub fn new_inherited(window: JS<Window>) -> Blob { pub fn new_inherited(window: &JSRef<Window>) -> Blob {
Blob { Blob {
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window window: window.unrooted()
} }
} }
pub fn new(window: &JSRef<Window>) -> Temporary<Blob> { pub fn new(window: &JSRef<Window>) -> Temporary<Blob> {
reflect_dom_object(~Blob::new_inherited(window.unrooted()), reflect_dom_object(~Blob::new_inherited(window),
window, window,
BlobBinding::Wrap) BlobBinding::Wrap)
} }

View file

@ -5,7 +5,7 @@
//! DOM bindings for `CharacterData`. //! DOM bindings for `CharacterData`.
use dom::bindings::codegen::InheritTypes::CharacterDataDerived; use dom::bindings::codegen::InheritTypes::CharacterDataDerived;
use dom::bindings::js::{JS, JSRef}; use dom::bindings::js::JSRef;
use dom::bindings::error::{Fallible, ErrorResult, IndexSize}; use dom::bindings::error::{Fallible, ErrorResult, IndexSize};
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::document::Document; use dom::document::Document;
@ -31,7 +31,7 @@ impl CharacterDataDerived for EventTarget {
} }
impl CharacterData { impl CharacterData {
pub fn new_inherited(id: NodeTypeId, data: DOMString, document: JS<Document>) -> CharacterData { pub fn new_inherited(id: NodeTypeId, data: DOMString, document: &JSRef<Document>) -> CharacterData {
CharacterData { CharacterData {
node: Node::new_inherited(id, document), node: Node::new_inherited(id, document),
data: data data: data

View file

@ -19,7 +19,7 @@ pub struct ClientRect {
} }
impl ClientRect { impl ClientRect {
pub fn new_inherited(window: JS<Window>, pub fn new_inherited(window: &JSRef<Window>,
top: Au, bottom: Au, top: Au, bottom: Au,
left: Au, right: Au) -> ClientRect { left: Au, right: Au) -> ClientRect {
ClientRect { ClientRect {
@ -28,14 +28,14 @@ impl ClientRect {
left: left.to_nearest_px() as f32, left: left.to_nearest_px() as f32,
right: right.to_nearest_px() as f32, right: right.to_nearest_px() as f32,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
} }
} }
pub fn new(window: &JSRef<Window>, pub fn new(window: &JSRef<Window>,
top: Au, bottom: Au, top: Au, bottom: Au,
left: Au, right: Au) -> Temporary<ClientRect> { left: Au, right: Au) -> Temporary<ClientRect> {
let rect = ClientRect::new_inherited(window.unrooted(), top, bottom, left, right); let rect = ClientRect::new_inherited(window, top, bottom, left, right);
reflect_dom_object(~rect, window, ClientRectBinding::Wrap) reflect_dom_object(~rect, window, ClientRectBinding::Wrap)
} }
} }

View file

@ -16,18 +16,18 @@ pub struct ClientRectList {
} }
impl ClientRectList { impl ClientRectList {
pub fn new_inherited(window: JS<Window>, pub fn new_inherited(window: &JSRef<Window>,
rects: Vec<JSRef<ClientRect>>) -> ClientRectList { rects: Vec<JSRef<ClientRect>>) -> ClientRectList {
ClientRectList { ClientRectList {
reflector_: Reflector::new(), reflector_: Reflector::new(),
rects: rects.iter().map(|rect| rect.unrooted()).collect(), rects: rects.iter().map(|rect| rect.unrooted()).collect(),
window: window, window: window.unrooted(),
} }
} }
pub fn new(window: &JSRef<Window>, pub fn new(window: &JSRef<Window>,
rects: Vec<JSRef<ClientRect>>) -> Temporary<ClientRectList> { rects: Vec<JSRef<ClientRect>>) -> Temporary<ClientRectList> {
reflect_dom_object(~ClientRectList::new_inherited(window.unrooted(), rects), reflect_dom_object(~ClientRectList::new_inherited(window, rects),
window, ClientRectListBinding::Wrap) window, ClientRectListBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::CommentDerived; use dom::bindings::codegen::InheritTypes::CommentDerived;
use dom::bindings::codegen::BindingDeclarations::CommentBinding; use dom::bindings::codegen::BindingDeclarations::CommentBinding;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::characterdata::CharacterData; use dom::characterdata::CharacterData;
use dom::document::Document; use dom::document::Document;
@ -29,14 +29,14 @@ impl CommentDerived for EventTarget {
} }
impl Comment { impl Comment {
pub fn new_inherited(text: DOMString, document: JS<Document>) -> Comment { pub fn new_inherited(text: DOMString, document: &JSRef<Document>) -> Comment {
Comment { Comment {
characterdata: CharacterData::new_inherited(CommentNodeTypeId, text, document) characterdata: CharacterData::new_inherited(CommentNodeTypeId, text, document)
} }
} }
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Comment> { pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Comment> {
let node = Comment::new_inherited(text, document.unrooted()); let node = Comment::new_inherited(text, document);
Node::reflect_node(~node, document, CommentBinding::Wrap) Node::reflect_node(~node, document, CommentBinding::Wrap)
} }

View file

@ -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::{HTMLHeadElementCast, TextCast, ElementCast};
use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{DocumentTypeCast, HTMLHtmlElementCast, NodeCast};
use dom::bindings::codegen::BindingDeclarations::DocumentBinding; use dom::bindings::codegen::BindingDeclarations::DocumentBinding;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalAssignable}; use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable, TemporaryPushable};
use dom::bindings::js::OptionalRootable; use dom::bindings::js::OptionalRootable;
use dom::bindings::trace::Untraceable; use dom::bindings::trace::Untraceable;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
@ -160,7 +160,7 @@ impl<'a> DocumentHelpers for JSRef<'a, Document> {
let elem: Option<&JSRef<Element>> = ElementCast::to_ref(&node); let elem: Option<&JSRef<Element>> = ElementCast::to_ref(&node);
match elem { match elem {
Some(elem) => { Some(elem) => {
if elements.get(head) == &elem.unrooted() { if &*elements.get(head).root() == elem {
head = head + 1; head = head + 1;
} }
if new_node == &node || head == elements.len() { if new_node == &node || head == elements.len() {
@ -170,19 +170,21 @@ impl<'a> DocumentHelpers for JSRef<'a, Document> {
None => {} None => {}
} }
} }
elements.insert(head, element.unrooted()); elements.insert_unrooted(head, element);
return; return;
}, },
None => (), None => (),
} }
self.idmap.insert(id, vec!(element.unrooted())); let mut elements = vec!();
elements.push_unrooted(element);
self.idmap.insert(id, elements);
} }
} }
impl Document { impl Document {
pub fn reflect_document(document: ~Document, pub fn reflect_document(document: ~Document,
window: &JSRef<Window>, window: &JSRef<Window>,
wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~Document) -> JS<Document>) wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~Document) -> JS<Document>)
-> Temporary<Document> { -> Temporary<Document> {
assert!(document.reflector().get_jsobject().is_null()); assert!(document.reflector().get_jsobject().is_null());
let mut raw_doc = reflect_dom_object(document, window, wrap_fn).root(); let mut raw_doc = reflect_dom_object(document, window, wrap_fn).root();
@ -191,10 +193,10 @@ impl Document {
let mut doc_alias = raw_doc.clone(); let mut doc_alias = raw_doc.clone();
let node: &mut JSRef<Node> = NodeCast::from_mut_ref(&mut doc_alias); let node: &mut JSRef<Node> = NodeCast::from_mut_ref(&mut doc_alias);
node.set_owner_doc(&*raw_doc); node.set_owner_doc(&*raw_doc);
Temporary::new_rooted(&*raw_doc) Temporary::from_rooted(&*raw_doc)
} }
pub fn new_inherited(window: JS<Window>, pub fn new_inherited(window: &JSRef<Window>,
url: Option<Url>, url: Option<Url>,
is_html_document: IsHTMLDocument, is_html_document: IsHTMLDocument,
content_type: Option<DOMString>) -> Document { content_type: Option<DOMString>) -> Document {
@ -203,7 +205,7 @@ impl Document {
Document { Document {
node: Node::new_without_doc(DocumentNodeTypeId), node: Node::new_without_doc(DocumentNodeTypeId),
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
idmap: HashMap::new(), idmap: HashMap::new(),
implementation: None, implementation: None,
content_type: match content_type { content_type: match content_type {
@ -230,7 +232,7 @@ impl Document {
} }
pub fn new(window: &JSRef<Window>, url: Option<Url>, doctype: IsHTMLDocument, content_type: Option<DOMString>) -> Temporary<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); let document = Document::new_inherited(window, url, doctype, content_type);
Document::reflect_document(~document, window, DocumentBinding::Wrap) Document::reflect_document(~document, window, DocumentBinding::Wrap)
} }
} }
@ -274,7 +276,7 @@ impl<'a> PrivateDocumentHelpers for JSRef<'a, Document> {
self.GetDocumentElement().root().filtered(|root| { self.GetDocumentElement().root().filtered(|root| {
root.node.type_id == ElementNodeTypeId(HTMLHtmlElementTypeId) root.node.type_id == ElementNodeTypeId(HTMLHtmlElementTypeId)
}).map(|elem| { }).map(|elem| {
Temporary::new_rooted(HTMLHtmlElementCast::to_ref(&*elem).unwrap()) Temporary::from_rooted(HTMLHtmlElementCast::to_ref(&*elem).unwrap())
}) })
} }
} }
@ -364,14 +366,14 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
child.is_doctype() child.is_doctype()
}).map(|node| { }).map(|node| {
let doctype: &JSRef<DocumentType> = DocumentTypeCast::to_ref(&node).unwrap(); let doctype: &JSRef<DocumentType> = DocumentTypeCast::to_ref(&node).unwrap();
Temporary::new(doctype.unrooted()) Temporary::from_rooted(doctype)
}) })
} }
// http://dom.spec.whatwg.org/#dom-document-documentelement // http://dom.spec.whatwg.org/#dom-document-documentelement
fn GetDocumentElement(&self) -> Option<Temporary<Element>> { fn GetDocumentElement(&self) -> Option<Temporary<Element>> {
let node: &JSRef<Node> = NodeCast::from_ref(self); let node: &JSRef<Node> = NodeCast::from_ref(self);
node.child_elements().next().map(|elem| Temporary::new_rooted(&elem)) node.child_elements().next().map(|elem| Temporary::from_rooted(&elem))
} }
// http://dom.spec.whatwg.org/#dom-document-getelementsbytagname // http://dom.spec.whatwg.org/#dom-document-getelementsbytagname
@ -522,7 +524,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
Node::adopt(node, self); Node::adopt(node, self);
// Step 3. // Step 3.
Ok(Temporary::new_rooted(node)) Ok(Temporary::from_rooted(node))
} }
// http://dom.spec.whatwg.org/#dom-document-createevent // http://dom.spec.whatwg.org/#dom-document-createevent
@ -604,7 +606,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
node.children().find(|child| { node.children().find(|child| {
child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId) child.type_id() == ElementNodeTypeId(HTMLHeadElementTypeId)
}).map(|node| { }).map(|node| {
Temporary::new_rooted(HTMLHeadElementCast::to_ref(&node).unwrap()) Temporary::from_rooted(HTMLHeadElementCast::to_ref(&node).unwrap())
}) })
}) })
} }
@ -621,7 +623,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
_ => false _ => false
} }
}).map(|node| { }).map(|node| {
Temporary::new_rooted(HTMLElementCast::to_ref(&node).unwrap()) Temporary::from_rooted(HTMLElementCast::to_ref(&node).unwrap())
}) })
}) })
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::{DocumentFragmentDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{DocumentFragmentDerived, NodeCast};
use dom::bindings::codegen::BindingDeclarations::DocumentFragmentBinding; use dom::bindings::codegen::BindingDeclarations::DocumentFragmentBinding;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::document::Document; use dom::document::Document;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,14 +28,14 @@ impl DocumentFragmentDerived for EventTarget {
impl DocumentFragment { impl DocumentFragment {
/// Creates a new DocumentFragment. /// Creates a new DocumentFragment.
pub fn new_inherited(document: JS<Document>) -> DocumentFragment { pub fn new_inherited(document: &JSRef<Document>) -> DocumentFragment {
DocumentFragment { DocumentFragment {
node: Node::new_inherited(DocumentFragmentNodeTypeId, document), node: Node::new_inherited(DocumentFragmentNodeTypeId, document),
} }
} }
pub fn new(document: &JSRef<Document>) -> Temporary<DocumentFragment> { pub fn new(document: &JSRef<Document>) -> Temporary<DocumentFragment> {
let node = DocumentFragment::new_inherited(document.unrooted()); let node = DocumentFragment::new_inherited(document);
Node::reflect_node(~node, document, DocumentFragmentBinding::Wrap) Node::reflect_node(~node, document, DocumentFragmentBinding::Wrap)
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::InheritTypes::DocumentTypeDerived; use dom::bindings::codegen::InheritTypes::DocumentTypeDerived;
use dom::bindings::codegen::BindingDeclarations::DocumentTypeBinding; use dom::bindings::codegen::BindingDeclarations::DocumentTypeBinding;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::node::{Node, DoctypeNodeTypeId}; use dom::node::{Node, DoctypeNodeTypeId};
@ -32,7 +32,7 @@ impl DocumentType {
pub fn new_inherited(name: DOMString, pub fn new_inherited(name: DOMString,
public_id: Option<DOMString>, public_id: Option<DOMString>,
system_id: Option<DOMString>, system_id: Option<DOMString>,
document: JS<Document>) document: &JSRef<Document>)
-> DocumentType { -> DocumentType {
DocumentType { DocumentType {
node: Node::new_inherited(DoctypeNodeTypeId, document), node: Node::new_inherited(DoctypeNodeTypeId, document),
@ -50,7 +50,7 @@ impl DocumentType {
let documenttype = DocumentType::new_inherited(name, let documenttype = DocumentType::new_inherited(name,
public_id, public_id,
system_id, system_id,
document.unrooted()); document);
Node::reflect_node(~documenttype, document, DocumentTypeBinding::Wrap) Node::reflect_node(~documenttype, document, DocumentTypeBinding::Wrap)
} }
} }

View file

@ -26,15 +26,15 @@ pub struct DOMImplementation {
} }
impl DOMImplementation { impl DOMImplementation {
pub fn new_inherited(owner: JS<Window>) -> DOMImplementation { pub fn new_inherited(owner: &JSRef<Window>) -> DOMImplementation {
DOMImplementation { DOMImplementation {
owner: owner, owner: owner.unrooted(),
reflector_: Reflector::new(), reflector_: Reflector::new(),
} }
} }
pub fn new(owner: &JSRef<Window>) -> Temporary<DOMImplementation> { pub fn new(owner: &JSRef<Window>) -> Temporary<DOMImplementation> {
reflect_dom_object(~DOMImplementation::new_inherited(owner.unrooted()), owner, reflect_dom_object(~DOMImplementation::new_inherited(owner), owner,
DOMImplementationBinding::Wrap) DOMImplementationBinding::Wrap)
} }
} }
@ -115,7 +115,7 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
// FIXME: https://github.com/mozilla/servo/issues/1522 // FIXME: https://github.com/mozilla/servo/issues/1522
// Step 7. // Step 7.
Ok(Temporary::new_rooted(&*doc)) Ok(Temporary::from_rooted(&*doc))
} }
// http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument // http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
@ -167,6 +167,6 @@ impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
// FIXME: https://github.com/mozilla/servo/issues/1522 // FIXME: https://github.com/mozilla/servo/issues/1522
// Step 9. // Step 9.
Temporary::new_rooted(&*doc) Temporary::from_rooted(&*doc)
} }
} }

View file

@ -18,15 +18,15 @@ pub struct DOMParser {
} }
impl DOMParser { impl DOMParser {
pub fn new_inherited(owner: JS<Window>) -> DOMParser { pub fn new_inherited(owner: &JSRef<Window>) -> DOMParser {
DOMParser { DOMParser {
owner: owner, owner: owner.unrooted(),
reflector_: Reflector::new() reflector_: Reflector::new()
} }
} }
pub fn new(owner: &JSRef<Window>) -> Temporary<DOMParser> { pub fn new(owner: &JSRef<Window>) -> Temporary<DOMParser> {
reflect_dom_object(~DOMParser::new_inherited(owner.unrooted()), owner, reflect_dom_object(~DOMParser::new_inherited(owner), owner,
DOMParserBinding::Wrap) DOMParserBinding::Wrap)
} }

View file

@ -9,7 +9,7 @@ use dom::attrlist::AttrList;
use dom::bindings::codegen::BindingDeclarations::ElementBinding; use dom::bindings::codegen::BindingDeclarations::ElementBinding;
use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{ElementDerived, NodeCast};
use dom::bindings::js::{JS, JSRef, Temporary, TemporaryPushable}; use dom::bindings::js::{JS, JSRef, Temporary, TemporaryPushable};
use dom::bindings::js::{OptionalAssignable, OptionalRootable, Root}; use dom::bindings::js::{OptionalSettable, OptionalRootable, Root};
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter}; use dom::bindings::error::{ErrorResult, Fallible, NamespaceError, InvalidCharacter};
use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type}; use dom::bindings::utils::{QName, Name, InvalidXMLName, xml_name_type};
@ -141,7 +141,7 @@ pub enum ElementTypeId {
// //
impl Element { impl Element {
pub fn new_inherited(type_id: ElementTypeId, local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: JS<Document>) -> Element { pub fn new_inherited(type_id: ElementTypeId, local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: &JSRef<Document>) -> Element {
Element { Element {
node: Node::new_inherited(ElementNodeTypeId(type_id), document), node: Node::new_inherited(ElementNodeTypeId(type_id), document),
local_name: local_name, local_name: local_name,
@ -154,7 +154,7 @@ impl Element {
} }
pub fn new(local_name: DOMString, namespace: Namespace, prefix: Option<DOMString>, document: &JSRef<Document>) -> Temporary<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()); let element = Element::new_inherited(ElementTypeId, local_name, namespace, prefix, document);
Node::reflect_node(~element, document, ElementBinding::Wrap) Node::reflect_node(~element, document, ElementBinding::Wrap)
} }
} }
@ -230,11 +230,11 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
if self.html_element_in_html_document() { if self.html_element_in_html_document() {
self.get().attrs.iter().map(|attr| attr.root()).find(|attr| { self.get().attrs.iter().map(|attr| attr.root()).find(|attr| {
name.to_ascii_lower() == attr.local_name && attr.namespace == namespace name.to_ascii_lower() == attr.local_name && attr.namespace == namespace
}).map(|x| Temporary::new_rooted(&*x)) }).map(|x| Temporary::from_rooted(&*x))
} else { } else {
self.get().attrs.iter().map(|attr| attr.root()).find(|attr| { self.get().attrs.iter().map(|attr| attr.root()).find(|attr| {
name == attr.local_name && attr.namespace == namespace name == attr.local_name && attr.namespace == namespace
}).map(|x| Temporary::new_rooted(&*x)) }).map(|x| Temporary::from_rooted(&*x))
} }
} }
@ -282,7 +282,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
let window = window_from_node(self).root(); let window = window_from_node(self).root();
let attr = Attr::new(&*window, local_name.clone(), value.clone(), let attr = Attr::new(&*window, local_name.clone(), value.clone(),
name, namespace.clone(), prefix, self); name, namespace.clone(), prefix, self);
self.get_mut().attrs.push_unrooted(attr); self.get_mut().attrs.push_unrooted(&attr);
(self.get().attrs.len() - 1, FirstSetAttr) (self.get().attrs.len() - 1, FirstSetAttr)
} }
}; };

View file

@ -91,7 +91,7 @@ impl Event {
init: &EventBinding::EventInit) -> Fallible<Temporary<Event>> { init: &EventBinding::EventInit) -> Fallible<Temporary<Event>> {
let mut ev = Event::new(global).root(); let mut ev = Event::new(global).root();
ev.InitEvent(type_, init.bubbles, init.cancelable); ev.InitEvent(type_, init.bubbles, init.cancelable);
Ok(Temporary::new_rooted(&*ev)) Ok(Temporary::from_rooted(&*ev))
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::callback::ReportExceptions; use dom::bindings::callback::ReportExceptions;
use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, NodeDerived}; use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, NodeDerived};
use dom::bindings::js::{JSRef, OptionalAssignable, Root}; use dom::bindings::js::{JSRef, OptionalSettable, Root};
use dom::eventtarget::{Capturing, Bubbling, EventTarget}; use dom::eventtarget::{Capturing, Bubbling, EventTarget};
use dom::event::{Event, PhaseAtTarget, PhaseNone, PhaseBubbling, PhaseCapturing, EventMethods}; use dom::event::{Event, PhaseAtTarget, PhaseNone, PhaseBubbling, PhaseCapturing, EventMethods};
use dom::node::{Node, NodeHelpers}; use dom::node::{Node, NodeHelpers};

View file

@ -28,17 +28,17 @@ pub struct FormData {
} }
impl FormData { impl FormData {
pub fn new_inherited(form: Option<JSRef<HTMLFormElement>>, window: JS<Window>) -> FormData { pub fn new_inherited(form: Option<JSRef<HTMLFormElement>>, window: &JSRef<Window>) -> FormData {
FormData { FormData {
data: HashMap::new(), data: HashMap::new(),
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
form: form.map(|form| form.unrooted()) form: form.map(|form| form.unrooted())
} }
} }
pub fn new(form: Option<JSRef<HTMLFormElement>>, window: &JSRef<Window>) -> Temporary<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) reflect_dom_object(~FormData::new_inherited(form, window), window, FormDataBinding::Wrap)
} }
pub fn Constructor(window: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Temporary<FormData>> { pub fn Constructor(window: &JSRef<Window>, form: Option<JSRef<HTMLFormElement>>) -> Fallible<Temporary<FormData>> {

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLAnchorElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLAnchorElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLAnchorElementDerived; use dom::bindings::codegen::InheritTypes::HTMLAnchorElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLAnchorElementTypeId; use dom::element::HTMLAnchorElementTypeId;
@ -28,14 +28,14 @@ impl HTMLAnchorElementDerived for EventTarget {
} }
impl HTMLAnchorElement { impl HTMLAnchorElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLAnchorElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLAnchorElement {
HTMLAnchorElement { HTMLAnchorElement {
htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAnchorElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAnchorElement> {
let element = HTMLAnchorElement::new_inherited(localName, document.unrooted()); let element = HTMLAnchorElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLAnchorElementBinding::Wrap) Node::reflect_node(~element, document, HTMLAnchorElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLAppletElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLAppletElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLAppletElementDerived; use dom::bindings::codegen::InheritTypes::HTMLAppletElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLAppletElementTypeId; use dom::element::HTMLAppletElementTypeId;
@ -28,14 +28,14 @@ impl HTMLAppletElementDerived for EventTarget {
} }
impl HTMLAppletElement { impl HTMLAppletElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLAppletElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLAppletElement {
HTMLAppletElement { HTMLAppletElement {
htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAppletElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAppletElement> {
let element = HTMLAppletElement::new_inherited(localName, document.unrooted()); let element = HTMLAppletElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLAppletElementBinding::Wrap) Node::reflect_node(~element, document, HTMLAppletElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLAreaElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLAreaElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLAreaElementDerived; use dom::bindings::codegen::InheritTypes::HTMLAreaElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLAreaElementTypeId; use dom::element::HTMLAreaElementTypeId;
@ -28,14 +28,14 @@ impl HTMLAreaElementDerived for EventTarget {
} }
impl HTMLAreaElement { impl HTMLAreaElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLAreaElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLAreaElement {
HTMLAreaElement { HTMLAreaElement {
htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAreaElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAreaElement> {
let element = HTMLAreaElement::new_inherited(localName, document.unrooted()); let element = HTMLAreaElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLAreaElementBinding::Wrap) Node::reflect_node(~element, document, HTMLAreaElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLAudioElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLAudioElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLAudioElementDerived; use dom::bindings::codegen::InheritTypes::HTMLAudioElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLAudioElementTypeId; use dom::element::HTMLAudioElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLAudioElementDerived for EventTarget {
} }
impl HTMLAudioElement { impl HTMLAudioElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLAudioElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLAudioElement {
HTMLAudioElement { HTMLAudioElement {
htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, document) htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAudioElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAudioElement> {
let element = HTMLAudioElement::new_inherited(localName, document.unrooted()); let element = HTMLAudioElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLAudioElementBinding::Wrap) Node::reflect_node(~element, document, HTMLAudioElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLBaseElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLBaseElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLBaseElementDerived; use dom::bindings::codegen::InheritTypes::HTMLBaseElementDerived;
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLBaseElementTypeId; use dom::element::HTMLBaseElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,14 +28,14 @@ impl HTMLBaseElementDerived for EventTarget {
} }
impl HTMLBaseElement { impl HTMLBaseElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLBaseElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLBaseElement {
HTMLBaseElement { HTMLBaseElement {
htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBaseElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBaseElement> {
let element = HTMLBaseElement::new_inherited(localName, document.unrooted()); let element = HTMLBaseElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLBaseElementBinding::Wrap) Node::reflect_node(~element, document, HTMLBaseElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLBodyElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLBodyElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLBodyElementDerived; use dom::bindings::codegen::InheritTypes::HTMLBodyElementDerived;
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLBodyElementTypeId; use dom::element::HTMLBodyElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,14 +28,14 @@ impl HTMLBodyElementDerived for EventTarget {
} }
impl HTMLBodyElement { impl HTMLBodyElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLBodyElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLBodyElement {
HTMLBodyElement { HTMLBodyElement {
htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBodyElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBodyElement> {
let element = HTMLBodyElement::new_inherited(localName, document.unrooted()); let element = HTMLBodyElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLBodyElementBinding::Wrap) Node::reflect_node(~element, document, HTMLBodyElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLBRElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLBRElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLBRElementDerived; use dom::bindings::codegen::InheritTypes::HTMLBRElementDerived;
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLBRElementTypeId; use dom::element::HTMLBRElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,14 +28,14 @@ impl HTMLBRElementDerived for EventTarget {
} }
impl HTMLBRElement { impl HTMLBRElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLBRElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLBRElement {
HTMLBRElement { HTMLBRElement {
htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBRElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBRElement> {
let element = HTMLBRElement::new_inherited(localName, document.unrooted()); let element = HTMLBRElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLBRElementBinding::Wrap) Node::reflect_node(~element, document, HTMLBRElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLButtonElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLButtonElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLButtonElementDerived; use dom::bindings::codegen::InheritTypes::HTMLButtonElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLButtonElementTypeId; use dom::element::HTMLButtonElementTypeId;
@ -30,14 +30,14 @@ impl HTMLButtonElementDerived for EventTarget {
} }
impl HTMLButtonElement { impl HTMLButtonElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLButtonElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLButtonElement {
HTMLButtonElement { HTMLButtonElement {
htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLButtonElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLButtonElement> {
let element = HTMLButtonElement::new_inherited(localName, document.unrooted()); let element = HTMLButtonElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLButtonElementBinding::Wrap) Node::reflect_node(~element, document, HTMLButtonElementBinding::Wrap)
} }
} }
@ -67,7 +67,6 @@ pub trait HTMLButtonElementMethods {
fn WillValidate(&self) -> bool; fn WillValidate(&self) -> bool;
fn SetWillValidate(&mut self, _will_validate: bool); fn SetWillValidate(&mut self, _will_validate: bool);
fn Validity(&self) -> Temporary<ValidityState>; fn Validity(&self) -> Temporary<ValidityState>;
fn SetValidity(&mut self, _validity: JS<ValidityState>);
fn ValidationMessage(&self) -> DOMString; fn ValidationMessage(&self) -> DOMString;
fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult;
fn CheckValidity(&self) -> bool; fn CheckValidity(&self) -> bool;
@ -171,9 +170,6 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
ValidityState::new(&*window) ValidityState::new(&*window)
} }
fn SetValidity(&mut self, _validity: JS<ValidityState>) {
}
fn ValidationMessage(&self) -> DOMString { fn ValidationMessage(&self) -> DOMString {
~"" ~""
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLCanvasElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLCanvasElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLCanvasElementDerived; use dom::bindings::codegen::InheritTypes::HTMLCanvasElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::{ErrorResult}; use dom::bindings::error::{ErrorResult};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLCanvasElementTypeId; use dom::element::HTMLCanvasElementTypeId;
@ -28,14 +28,14 @@ impl HTMLCanvasElementDerived for EventTarget {
} }
impl HTMLCanvasElement { impl HTMLCanvasElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLCanvasElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLCanvasElement {
HTMLCanvasElement { HTMLCanvasElement {
htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLCanvasElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLCanvasElement> {
let element = HTMLCanvasElement::new_inherited(localName, document.unrooted()); let element = HTMLCanvasElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLCanvasElementBinding::Wrap) Node::reflect_node(~element, document, HTMLCanvasElementBinding::Wrap)
} }
} }

View file

@ -38,16 +38,16 @@ pub struct HTMLCollection {
} }
impl HTMLCollection { impl HTMLCollection {
pub fn new_inherited(window: JS<Window>, collection: CollectionTypeId) -> HTMLCollection { pub fn new_inherited(window: &JSRef<Window>, collection: CollectionTypeId) -> HTMLCollection {
HTMLCollection { HTMLCollection {
collection: collection, collection: collection,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
} }
} }
pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> { pub fn new(window: &JSRef<Window>, collection: CollectionTypeId) -> Temporary<HTMLCollection> {
reflect_dom_object(~HTMLCollection::new_inherited(window.unrooted(), collection), reflect_dom_object(~HTMLCollection::new_inherited(window, collection),
window, HTMLCollectionBinding::Wrap) window, HTMLCollectionBinding::Wrap)
} }
} }
@ -159,7 +159,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
}) })
.nth(index as uint) .nth(index as uint)
.clone() .clone()
.map(|elem| Temporary::new_rooted(&elem)) .map(|elem| Temporary::from_rooted(&elem))
} }
} }
} }
@ -179,7 +179,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
.find(|elem| { .find(|elem| {
elem.get_string_attribute("name") == key || elem.get_string_attribute("name") == key ||
elem.get_string_attribute("id") == key }) elem.get_string_attribute("id") == key })
.map(|maybe_elem| Temporary::new_rooted(&*maybe_elem)), .map(|maybe_elem| Temporary::from_rooted(&*maybe_elem)),
Live(ref root, ref filter) => { Live(ref root, ref filter) => {
let root = root.root(); let root = root.root();
root.deref().traverse_preorder() root.deref().traverse_preorder()
@ -191,7 +191,7 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
.find(|elem| { .find(|elem| {
elem.get_string_attribute("name") == key || elem.get_string_attribute("name") == key ||
elem.get_string_attribute("id") == key }) elem.get_string_attribute("id") == key })
.map(|maybe_elem| Temporary::new_rooted(&maybe_elem)) .map(|maybe_elem| Temporary::from_rooted(&maybe_elem))
} }
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLDataElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLDataElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLDataElementDerived; use dom::bindings::codegen::InheritTypes::HTMLDataElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLDataElementTypeId; use dom::element::HTMLDataElementTypeId;
@ -28,14 +28,14 @@ impl HTMLDataElementDerived for EventTarget {
} }
impl HTMLDataElement { impl HTMLDataElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLDataElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLDataElement {
HTMLDataElement { HTMLDataElement {
htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataElement> {
let element = HTMLDataElement::new_inherited(localName, document.unrooted()); let element = HTMLDataElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLDataElementBinding::Wrap) Node::reflect_node(~element, document, HTMLDataElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLDataListElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLDataListElementBinding;
use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, NodeCast};
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, HTMLDataListElementTypeId}; use dom::element::{Element, HTMLDataListElementTypeId};
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,14 +28,14 @@ impl HTMLDataListElementDerived for EventTarget {
} }
impl HTMLDataListElement { impl HTMLDataListElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLDataListElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLDataListElement {
HTMLDataListElement { HTMLDataListElement {
htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataListElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataListElement> {
let element = HTMLDataListElement::new_inherited(localName, document.unrooted()); let element = HTMLDataListElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLDataListElementBinding::Wrap) Node::reflect_node(~element, document, HTMLDataListElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLDirectoryElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLDirectoryElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLDirectoryElementDerived; use dom::bindings::codegen::InheritTypes::HTMLDirectoryElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLDirectoryElementTypeId; use dom::element::HTMLDirectoryElementTypeId;
@ -28,14 +28,14 @@ impl HTMLDirectoryElementDerived for EventTarget {
} }
impl HTMLDirectoryElement { impl HTMLDirectoryElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLDirectoryElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLDirectoryElement {
HTMLDirectoryElement { HTMLDirectoryElement {
htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDirectoryElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDirectoryElement> {
let element = HTMLDirectoryElement::new_inherited(localName, document.unrooted()); let element = HTMLDirectoryElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLDirectoryElementBinding::Wrap) Node::reflect_node(~element, document, HTMLDirectoryElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLDivElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLDivElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLDivElementDerived; use dom::bindings::codegen::InheritTypes::HTMLDivElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLDivElementTypeId; use dom::element::HTMLDivElementTypeId;
@ -28,14 +28,14 @@ impl HTMLDivElementDerived for EventTarget {
} }
impl HTMLDivElement { impl HTMLDivElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLDivElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLDivElement {
HTMLDivElement { HTMLDivElement {
htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDivElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDivElement> {
let element = HTMLDivElement::new_inherited(localName, document.unrooted()); let element = HTMLDivElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLDivElementBinding::Wrap) Node::reflect_node(~element, document, HTMLDivElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLDListElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLDListElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLDListElementDerived; use dom::bindings::codegen::InheritTypes::HTMLDListElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLDListElementTypeId; use dom::element::HTMLDListElementTypeId;
@ -28,14 +28,14 @@ impl HTMLDListElementDerived for EventTarget {
} }
impl HTMLDListElement { impl HTMLDListElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLDListElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLDListElement {
HTMLDListElement { HTMLDListElement {
htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDListElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDListElement> {
let element = HTMLDListElement::new_inherited(localName, document.unrooted()); let element = HTMLDListElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLDListElementBinding::Wrap) Node::reflect_node(~element, document, HTMLDListElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLElementBinding;
use dom::bindings::codegen::InheritTypes::ElementCast; use dom::bindings::codegen::InheritTypes::ElementCast;
use dom::bindings::codegen::InheritTypes::HTMLElementDerived; use dom::bindings::codegen::InheritTypes::HTMLElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::{ErrorResult, Fallible};
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, ElementTypeId, HTMLElementTypeId}; use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
@ -33,14 +33,14 @@ impl HTMLElementDerived for EventTarget {
} }
impl HTMLElement { impl HTMLElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JS<Document>) -> HTMLElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: &JSRef<Document>) -> HTMLElement {
HTMLElement { HTMLElement {
element: Element::new_inherited(type_id, tag_name, namespace::HTML, None, document) element: Element::new_inherited(type_id, tag_name, namespace::HTML, None, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLElement> {
let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document.unrooted()); let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document);
Node::reflect_node(~element, document, HTMLElementBinding::Wrap) Node::reflect_node(~element, document, HTMLElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLEmbedElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLEmbedElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLEmbedElementDerived; use dom::bindings::codegen::InheritTypes::HTMLEmbedElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLEmbedElementTypeId; use dom::element::HTMLEmbedElementTypeId;
@ -28,14 +28,14 @@ impl HTMLEmbedElementDerived for EventTarget {
} }
impl HTMLEmbedElement { impl HTMLEmbedElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLEmbedElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLEmbedElement {
HTMLEmbedElement { HTMLEmbedElement {
htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLEmbedElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLEmbedElement> {
let element = HTMLEmbedElement::new_inherited(localName, document.unrooted()); let element = HTMLEmbedElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLEmbedElementBinding::Wrap) Node::reflect_node(~element, document, HTMLEmbedElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLFieldSetElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLFieldSetElementBinding;
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFieldSetElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLFieldSetElementDerived, NodeCast};
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, HTMLFieldSetElementTypeId}; use dom::element::{Element, HTMLFieldSetElementTypeId};
@ -31,14 +31,14 @@ impl HTMLFieldSetElementDerived for EventTarget {
} }
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFieldSetElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLFieldSetElement {
HTMLFieldSetElement { HTMLFieldSetElement {
htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFieldSetElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFieldSetElement> {
let element = HTMLFieldSetElement::new_inherited(localName, document.unrooted()); let element = HTMLFieldSetElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLFieldSetElementBinding::Wrap) Node::reflect_node(~element, document, HTMLFieldSetElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLFontElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLFontElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLFontElementDerived; use dom::bindings::codegen::InheritTypes::HTMLFontElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLFontElementTypeId; use dom::element::HTMLFontElementTypeId;
@ -28,14 +28,14 @@ impl HTMLFontElementDerived for EventTarget {
} }
impl HTMLFontElement { impl HTMLFontElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFontElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFontElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFontElement> {
let element = HTMLFontElement::new_inherited(localName, document.unrooted()); let element = HTMLFontElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLFontElementBinding::Wrap) Node::reflect_node(~element, document, HTMLFontElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLFormElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLFormElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLFormElementDerived; use dom::bindings::codegen::InheritTypes::HTMLFormElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, HTMLFormElementTypeId}; use dom::element::{Element, HTMLFormElementTypeId};
@ -29,14 +29,14 @@ impl HTMLFormElementDerived for EventTarget {
} }
impl HTMLFormElement { impl HTMLFormElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFormElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLFormElement {
HTMLFormElement { HTMLFormElement {
htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFormElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFormElement> {
let element = HTMLFormElement::new_inherited(localName, document.unrooted()); let element = HTMLFormElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLFormElementBinding::Wrap) Node::reflect_node(~element, document, HTMLFormElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLFrameElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLFrameElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLFrameElementDerived; use dom::bindings::codegen::InheritTypes::HTMLFrameElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLFrameElementTypeId; use dom::element::HTMLFrameElementTypeId;
@ -29,14 +29,14 @@ impl HTMLFrameElementDerived for EventTarget {
} }
impl HTMLFrameElement { impl HTMLFrameElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFrameElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLFrameElement {
HTMLFrameElement { HTMLFrameElement {
htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameElement> {
let element = HTMLFrameElement::new_inherited(localName, document.unrooted()); let element = HTMLFrameElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLFrameElementBinding::Wrap) Node::reflect_node(~element, document, HTMLFrameElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLFrameSetElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLFrameSetElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLFrameSetElementDerived; use dom::bindings::codegen::InheritTypes::HTMLFrameSetElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLFrameSetElementTypeId; use dom::element::HTMLFrameSetElementTypeId;
@ -28,14 +28,14 @@ impl HTMLFrameSetElementDerived for EventTarget {
} }
impl HTMLFrameSetElement { impl HTMLFrameSetElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLFrameSetElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLFrameSetElement {
HTMLFrameSetElement { HTMLFrameSetElement {
htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameSetElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameSetElement> {
let element = HTMLFrameSetElement::new_inherited(localName, document.unrooted()); let element = HTMLFrameSetElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLFrameSetElementBinding::Wrap) Node::reflect_node(~element, document, HTMLFrameSetElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLHeadElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLHeadElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLHeadElementDerived; use dom::bindings::codegen::InheritTypes::HTMLHeadElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLHeadElementTypeId; use dom::element::HTMLHeadElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLHeadElementDerived for EventTarget {
} }
impl HTMLHeadElement { impl HTMLHeadElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLHeadElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLHeadElement {
HTMLHeadElement { HTMLHeadElement {
htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHeadElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHeadElement> {
let element = HTMLHeadElement::new_inherited(localName, document.unrooted()); let element = HTMLHeadElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLHeadElementBinding::Wrap) Node::reflect_node(~element, document, HTMLHeadElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLHeadingElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLHeadingElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLHeadingElementDerived; use dom::bindings::codegen::InheritTypes::HTMLHeadingElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLHeadingElementTypeId; use dom::element::HTMLHeadingElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -38,7 +38,7 @@ impl HTMLHeadingElementDerived for EventTarget {
} }
impl HTMLHeadingElement { impl HTMLHeadingElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>, level: HeadingLevel) -> HTMLHeadingElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> HTMLHeadingElement {
HTMLHeadingElement { HTMLHeadingElement {
htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, document),
level: level, level: level,
@ -46,7 +46,7 @@ impl HTMLHeadingElement {
} }
pub fn new(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> Temporary<HTMLHeadingElement> { pub fn new(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> Temporary<HTMLHeadingElement> {
let element = HTMLHeadingElement::new_inherited(localName, document.unrooted(), level); let element = HTMLHeadingElement::new_inherited(localName, document, level);
Node::reflect_node(~element, document, HTMLHeadingElementBinding::Wrap) Node::reflect_node(~element, document, HTMLHeadingElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLHRElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLHRElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLHRElementDerived; use dom::bindings::codegen::InheritTypes::HTMLHRElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLHRElementTypeId; use dom::element::HTMLHRElementTypeId;
@ -28,14 +28,14 @@ impl HTMLHRElementDerived for EventTarget {
} }
impl HTMLHRElement { impl HTMLHRElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLHRElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLHRElement {
HTMLHRElement { HTMLHRElement {
htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHRElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHRElement> {
let element = HTMLHRElement::new_inherited(localName, document.unrooted()); let element = HTMLHRElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLHRElementBinding::Wrap) Node::reflect_node(~element, document, HTMLHRElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLHtmlElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLHtmlElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLHtmlElementDerived; use dom::bindings::codegen::InheritTypes::HTMLHtmlElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLHtmlElementTypeId; use dom::element::HTMLHtmlElementTypeId;
@ -28,14 +28,14 @@ impl HTMLHtmlElementDerived for EventTarget {
} }
impl HTMLHtmlElement { impl HTMLHtmlElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLHtmlElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLHtmlElement {
HTMLHtmlElement { HTMLHtmlElement {
htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHtmlElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHtmlElement> {
let element = HTMLHtmlElement::new_inherited(localName, document.unrooted()); let element = HTMLHtmlElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLHtmlElementBinding::Wrap) Node::reflect_node(~element, document, HTMLHtmlElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLIFrameElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLIFrameElementBinding;
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLIFrameElementDerived, HTMLElementCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLIFrameElementDerived, HTMLElementCast};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::trace::Untraceable; use dom::bindings::trace::Untraceable;
use dom::document::Document; use dom::document::Document;
use dom::element::{HTMLIFrameElementTypeId, Element}; use dom::element::{HTMLIFrameElementTypeId, Element};
@ -70,7 +70,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
} }
impl HTMLIFrameElement { impl HTMLIFrameElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLIFrameElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
htmlelement: HTMLElement::new_inherited(HTMLIFrameElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLIFrameElementTypeId, localName, document),
frame: Untraceable::new(None), frame: Untraceable::new(None),
@ -80,7 +80,7 @@ impl HTMLIFrameElement {
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLIFrameElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLIFrameElement> {
let element = HTMLIFrameElement::new_inherited(localName, document.unrooted()); let element = HTMLIFrameElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLIFrameElementBinding::Wrap) Node::reflect_node(~element, document, HTMLIFrameElementBinding::Wrap)
} }
} }

View file

@ -68,7 +68,7 @@ impl<'a> PrivateHTMLImageElementHelpers for JSRef<'a, HTMLImageElement> {
} }
impl HTMLImageElement { impl HTMLImageElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLImageElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, document),
image: Untraceable::new(None), image: Untraceable::new(None),
@ -76,7 +76,7 @@ impl HTMLImageElement {
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLImageElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLImageElement> {
let element = HTMLImageElement::new_inherited(localName, document.unrooted()); let element = HTMLImageElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLImageElementBinding::Wrap) Node::reflect_node(~element, document, HTMLImageElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLInputElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLInputElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLInputElementDerived; use dom::bindings::codegen::InheritTypes::HTMLInputElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::{ErrorResult, Fallible};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLInputElementTypeId; use dom::element::HTMLInputElementTypeId;
@ -28,14 +28,14 @@ impl HTMLInputElementDerived for EventTarget {
} }
impl HTMLInputElement { impl HTMLInputElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLInputElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLInputElement {
HTMLInputElement { HTMLInputElement {
htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLInputElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLInputElement> {
let element = HTMLInputElement::new_inherited(localName, document.unrooted()); let element = HTMLInputElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLInputElementBinding::Wrap) Node::reflect_node(~element, document, HTMLInputElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLLabelElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLLabelElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLLabelElementDerived; use dom::bindings::codegen::InheritTypes::HTMLLabelElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLLabelElementTypeId; use dom::element::HTMLLabelElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLLabelElementDerived for EventTarget {
} }
impl HTMLLabelElement { impl HTMLLabelElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLLabelElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLLabelElement {
HTMLLabelElement { HTMLLabelElement {
htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLabelElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLabelElement> {
let element = HTMLLabelElement::new_inherited(localName, document.unrooted()); let element = HTMLLabelElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLLabelElementBinding::Wrap) Node::reflect_node(~element, document, HTMLLabelElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLLegendElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLLegendElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLLegendElementDerived; use dom::bindings::codegen::InheritTypes::HTMLLegendElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLLegendElementTypeId; use dom::element::HTMLLegendElementTypeId;
@ -28,14 +28,14 @@ impl HTMLLegendElementDerived for EventTarget {
} }
impl HTMLLegendElement { impl HTMLLegendElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLLegendElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLLegendElement {
HTMLLegendElement { HTMLLegendElement {
htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLegendElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLegendElement> {
let element = HTMLLegendElement::new_inherited(localName, document.unrooted()); let element = HTMLLegendElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLLegendElementBinding::Wrap) Node::reflect_node(~element, document, HTMLLegendElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLLIElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLLIElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLLIElementDerived; use dom::bindings::codegen::InheritTypes::HTMLLIElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLLIElementTypeId; use dom::element::HTMLLIElementTypeId;
@ -28,14 +28,14 @@ impl HTMLLIElementDerived for EventTarget {
} }
impl HTMLLIElement { impl HTMLLIElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLLIElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLLIElement {
HTMLLIElement { HTMLLIElement {
htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLIElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLIElement> {
let element = HTMLLIElement::new_inherited(localName, document.unrooted()); let element = HTMLLIElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLLIElementBinding::Wrap) Node::reflect_node(~element, document, HTMLLIElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLLinkElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLLinkElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLLinkElementDerived; use dom::bindings::codegen::InheritTypes::HTMLLinkElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLLinkElementTypeId; use dom::element::HTMLLinkElementTypeId;
@ -28,14 +28,14 @@ impl HTMLLinkElementDerived for EventTarget {
} }
impl HTMLLinkElement { impl HTMLLinkElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLLinkElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLLinkElement {
HTMLLinkElement { HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLinkElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLinkElement> {
let element = HTMLLinkElement::new_inherited(localName, document.unrooted()); let element = HTMLLinkElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLLinkElementBinding::Wrap) Node::reflect_node(~element, document, HTMLLinkElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLMainElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLMainElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLMainElementDerived; use dom::bindings::codegen::InheritTypes::HTMLMainElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLMainElementTypeId; use dom::element::HTMLMainElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLMainElementDerived for EventTarget {
} }
impl HTMLMainElement { impl HTMLMainElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLMainElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLMainElement {
HTMLMainElement { HTMLMainElement {
htmlelement: HTMLElement::new_inherited(HTMLMainElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLMainElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMainElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMainElement> {
let element = HTMLMainElement::new_inherited(localName, document.unrooted()); let element = HTMLMainElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLMainElementBinding::Wrap) Node::reflect_node(~element, document, HTMLMainElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLMapElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLMapElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLMapElementDerived; use dom::bindings::codegen::InheritTypes::HTMLMapElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLMapElementTypeId; use dom::element::HTMLMapElementTypeId;
@ -29,14 +29,14 @@ impl HTMLMapElementDerived for EventTarget {
} }
impl HTMLMapElement { impl HTMLMapElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLMapElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLMapElement {
HTMLMapElement { HTMLMapElement {
htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMapElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMapElement> {
let element = HTMLMapElement::new_inherited(localName, document.unrooted()); let element = HTMLMapElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLMapElementBinding::Wrap) Node::reflect_node(~element, document, HTMLMapElementBinding::Wrap)
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::js::{JS, JSRef}; use dom::bindings::js::{JSRef};
use dom::bindings::codegen::InheritTypes::HTMLMediaElementDerived; use dom::bindings::codegen::InheritTypes::HTMLMediaElementDerived;
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
@ -28,7 +28,7 @@ impl HTMLMediaElementDerived for EventTarget {
} }
impl HTMLMediaElement { impl HTMLMediaElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JS<Document>) -> HTMLMediaElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: &JSRef<Document>) -> HTMLMediaElement {
HTMLMediaElement { HTMLMediaElement {
htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) htmlelement: HTMLElement::new_inherited(type_id, tag_name, document)
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLMetaElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLMetaElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLMetaElementDerived; use dom::bindings::codegen::InheritTypes::HTMLMetaElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLMetaElementTypeId; use dom::element::HTMLMetaElementTypeId;
@ -28,14 +28,14 @@ impl HTMLMetaElementDerived for EventTarget {
} }
impl HTMLMetaElement { impl HTMLMetaElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLMetaElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLMetaElement {
HTMLMetaElement { HTMLMetaElement {
htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMetaElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMetaElement> {
let element = HTMLMetaElement::new_inherited(localName, document.unrooted()); let element = HTMLMetaElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLMetaElementBinding::Wrap) Node::reflect_node(~element, document, HTMLMetaElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLMeterElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLMeterElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLMeterElementDerived; use dom::bindings::codegen::InheritTypes::HTMLMeterElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLMeterElementTypeId; use dom::element::HTMLMeterElementTypeId;
@ -28,14 +28,14 @@ impl HTMLMeterElementDerived for EventTarget {
} }
impl HTMLMeterElement { impl HTMLMeterElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLMeterElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLMeterElement {
HTMLMeterElement { HTMLMeterElement {
htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMeterElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMeterElement> {
let element = HTMLMeterElement::new_inherited(localName, document.unrooted()); let element = HTMLMeterElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLMeterElementBinding::Wrap) Node::reflect_node(~element, document, HTMLMeterElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLModElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLModElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLModElementDerived; use dom::bindings::codegen::InheritTypes::HTMLModElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLModElementTypeId; use dom::element::HTMLModElementTypeId;
@ -28,14 +28,14 @@ impl HTMLModElementDerived for EventTarget {
} }
impl HTMLModElement { impl HTMLModElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLModElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLModElement {
HTMLModElement { HTMLModElement {
htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLModElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLModElement> {
let element = HTMLModElement::new_inherited(localName, document.unrooted()); let element = HTMLModElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLModElementBinding::Wrap) Node::reflect_node(~element, document, HTMLModElementBinding::Wrap)
} }
} }

View file

@ -6,7 +6,7 @@ use dom::attr::AttrMethods;
use dom::bindings::codegen::BindingDeclarations::HTMLObjectElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLObjectElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLObjectElementDerived; use dom::bindings::codegen::InheritTypes::HTMLObjectElementDerived;
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast};
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, HTMLObjectElementTypeId}; use dom::element::{Element, HTMLObjectElementTypeId};
@ -42,14 +42,14 @@ impl HTMLObjectElementDerived for EventTarget {
} }
impl HTMLObjectElement { impl HTMLObjectElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLObjectElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLObjectElement {
HTMLObjectElement { HTMLObjectElement {
htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, document),
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLObjectElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLObjectElement> {
let element = HTMLObjectElement::new_inherited(localName, document.unrooted()); let element = HTMLObjectElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLObjectElementBinding::Wrap) Node::reflect_node(~element, document, HTMLObjectElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLOListElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLOListElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLOListElementDerived; use dom::bindings::codegen::InheritTypes::HTMLOListElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLOListElementTypeId; use dom::element::HTMLOListElementTypeId;
@ -28,14 +28,14 @@ impl HTMLOListElementDerived for EventTarget {
} }
impl HTMLOListElement { impl HTMLOListElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLOListElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLOListElement {
HTMLOListElement { HTMLOListElement {
htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOListElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOListElement> {
let element = HTMLOListElement::new_inherited(localName, document.unrooted()); let element = HTMLOListElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLOListElementBinding::Wrap) Node::reflect_node(~element, document, HTMLOListElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLOptGroupElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLOptGroupElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementDerived; use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLOptGroupElementTypeId; use dom::element::HTMLOptGroupElementTypeId;
@ -28,14 +28,14 @@ impl HTMLOptGroupElementDerived for EventTarget {
} }
impl HTMLOptGroupElement { impl HTMLOptGroupElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLOptGroupElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLOptGroupElement {
HTMLOptGroupElement { HTMLOptGroupElement {
htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptGroupElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptGroupElement> {
let element = HTMLOptGroupElement::new_inherited(localName, document.unrooted()); let element = HTMLOptGroupElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLOptGroupElementBinding::Wrap) Node::reflect_node(~element, document, HTMLOptGroupElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLOptionElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLOptionElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLOptionElementDerived; use dom::bindings::codegen::InheritTypes::HTMLOptionElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLOptionElementTypeId; use dom::element::HTMLOptionElementTypeId;
@ -29,14 +29,14 @@ impl HTMLOptionElementDerived for EventTarget {
} }
impl HTMLOptionElement { impl HTMLOptionElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLOptionElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLOptionElement {
HTMLOptionElement { HTMLOptionElement {
htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptionElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptionElement> {
let element = HTMLOptionElement::new_inherited(localName, document.unrooted()); let element = HTMLOptionElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLOptionElementBinding::Wrap) Node::reflect_node(~element, document, HTMLOptionElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLOutputElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLOutputElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLOutputElementDerived; use dom::bindings::codegen::InheritTypes::HTMLOutputElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLOutputElementTypeId; use dom::element::HTMLOutputElementTypeId;
@ -30,14 +30,14 @@ impl HTMLOutputElementDerived for EventTarget {
} }
impl HTMLOutputElement { impl HTMLOutputElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLOutputElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLOutputElement {
HTMLOutputElement { HTMLOutputElement {
htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOutputElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOutputElement> {
let element = HTMLOutputElement::new_inherited(localName, document.unrooted()); let element = HTMLOutputElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLOutputElementBinding::Wrap) Node::reflect_node(~element, document, HTMLOutputElementBinding::Wrap)
} }
} }
@ -54,7 +54,6 @@ pub trait HTMLOutputElementMethods {
fn WillValidate(&self) -> bool; fn WillValidate(&self) -> bool;
fn SetWillValidate(&mut self, _will_validate: bool); fn SetWillValidate(&mut self, _will_validate: bool);
fn Validity(&self) -> Temporary<ValidityState>; fn Validity(&self) -> Temporary<ValidityState>;
fn SetValidity(&mut self, _validity: JS<ValidityState>);
fn ValidationMessage(&self) -> DOMString; fn ValidationMessage(&self) -> DOMString;
fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult;
fn CheckValidity(&self) -> bool; fn CheckValidity(&self) -> bool;
@ -106,9 +105,6 @@ impl<'a> HTMLOutputElementMethods for JSRef<'a, HTMLOutputElement> {
ValidityState::new(&*window) ValidityState::new(&*window)
} }
fn SetValidity(&mut self, _validity: JS<ValidityState>) {
}
fn ValidationMessage(&self) -> DOMString { fn ValidationMessage(&self) -> DOMString {
~"" ~""
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLParagraphElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLParagraphElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLParagraphElementDerived; use dom::bindings::codegen::InheritTypes::HTMLParagraphElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLParagraphElementTypeId; use dom::element::HTMLParagraphElementTypeId;
@ -28,14 +28,14 @@ impl HTMLParagraphElementDerived for EventTarget {
} }
impl HTMLParagraphElement { impl HTMLParagraphElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLParagraphElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLParagraphElement {
HTMLParagraphElement { HTMLParagraphElement {
htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParagraphElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParagraphElement> {
let element = HTMLParagraphElement::new_inherited(localName, document.unrooted()); let element = HTMLParagraphElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLParagraphElementBinding::Wrap) Node::reflect_node(~element, document, HTMLParagraphElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLParamElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLParamElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLParamElementDerived; use dom::bindings::codegen::InheritTypes::HTMLParamElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLParamElementTypeId; use dom::element::HTMLParamElementTypeId;
@ -28,14 +28,14 @@ impl HTMLParamElementDerived for EventTarget {
} }
impl HTMLParamElement { impl HTMLParamElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLParamElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLParamElement {
HTMLParamElement { HTMLParamElement {
htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParamElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParamElement> {
let element = HTMLParamElement::new_inherited(localName, document.unrooted()); let element = HTMLParamElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLParamElementBinding::Wrap) Node::reflect_node(~element, document, HTMLParamElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLPreElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLPreElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLPreElementDerived; use dom::bindings::codegen::InheritTypes::HTMLPreElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLPreElementTypeId; use dom::element::HTMLPreElementTypeId;
@ -28,14 +28,14 @@ impl HTMLPreElementDerived for EventTarget {
} }
impl HTMLPreElement { impl HTMLPreElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLPreElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLPreElement {
HTMLPreElement { HTMLPreElement {
htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLPreElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLPreElement> {
let element = HTMLPreElement::new_inherited(localName, document.unrooted()); let element = HTMLPreElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLPreElementBinding::Wrap) Node::reflect_node(~element, document, HTMLPreElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLProgressElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLProgressElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLProgressElementDerived; use dom::bindings::codegen::InheritTypes::HTMLProgressElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::{ErrorResult, Fallible};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLProgressElementTypeId; use dom::element::HTMLProgressElementTypeId;
@ -28,14 +28,14 @@ impl HTMLProgressElementDerived for EventTarget {
} }
impl HTMLProgressElement { impl HTMLProgressElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLProgressElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLProgressElement {
HTMLProgressElement { HTMLProgressElement {
htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLProgressElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLProgressElement> {
let element = HTMLProgressElement::new_inherited(localName, document.unrooted()); let element = HTMLProgressElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLProgressElementBinding::Wrap) Node::reflect_node(~element, document, HTMLProgressElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLQuoteElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLQuoteElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLQuoteElementDerived; use dom::bindings::codegen::InheritTypes::HTMLQuoteElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLQuoteElementTypeId; use dom::element::HTMLQuoteElementTypeId;
@ -28,14 +28,14 @@ impl HTMLQuoteElementDerived for EventTarget {
} }
impl HTMLQuoteElement { impl HTMLQuoteElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLQuoteElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLQuoteElement {
HTMLQuoteElement { HTMLQuoteElement {
htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLQuoteElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLQuoteElement> {
let element = HTMLQuoteElement::new_inherited(localName, document.unrooted()); let element = HTMLQuoteElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLQuoteElementBinding::Wrap) Node::reflect_node(~element, document, HTMLQuoteElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLScriptElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLScriptElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLScriptElementDerived; use dom::bindings::codegen::InheritTypes::HTMLScriptElementDerived;
use dom::bindings::codegen::InheritTypes::ElementCast; use dom::bindings::codegen::InheritTypes::ElementCast;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{HTMLScriptElementTypeId, Element, AttributeHandlers}; use dom::element::{HTMLScriptElementTypeId, Element, AttributeHandlers};
@ -29,14 +29,14 @@ impl HTMLScriptElementDerived for EventTarget {
} }
impl HTMLScriptElement { impl HTMLScriptElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLScriptElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLScriptElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLScriptElement> {
let element = HTMLScriptElement::new_inherited(localName, document.unrooted()); let element = HTMLScriptElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLScriptElementBinding::Wrap) Node::reflect_node(~element, document, HTMLScriptElementBinding::Wrap)
} }
} }

View file

@ -5,7 +5,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLSelectElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLSelectElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLSelectElementDerived; use dom::bindings::codegen::InheritTypes::HTMLSelectElementDerived;
use dom::bindings::codegen::UnionTypes::{HTMLElementOrLong, HTMLOptionElementOrHTMLOptGroupElement}; use dom::bindings::codegen::UnionTypes::{HTMLElementOrLong, HTMLOptionElementOrHTMLOptGroupElement};
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{Element, HTMLSelectElementTypeId}; use dom::element::{Element, HTMLSelectElementTypeId};
@ -32,14 +32,14 @@ impl HTMLSelectElementDerived for EventTarget {
} }
impl HTMLSelectElement { impl HTMLSelectElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLSelectElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLSelectElement {
HTMLSelectElement { HTMLSelectElement {
htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSelectElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSelectElement> {
let element = HTMLSelectElement::new_inherited(localName, document.unrooted()); let element = HTMLSelectElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLSelectElementBinding::Wrap) Node::reflect_node(~element, document, HTMLSelectElementBinding::Wrap)
} }
} }
@ -74,7 +74,6 @@ pub trait HTMLSelectElementMethods {
fn WillValidate(&self) -> bool; fn WillValidate(&self) -> bool;
fn SetWillValidate(&mut self, _will_validate: bool); fn SetWillValidate(&mut self, _will_validate: bool);
fn Validity(&self) -> Temporary<ValidityState>; fn Validity(&self) -> Temporary<ValidityState>;
fn SetValidity(&mut self, _validity: JS<ValidityState>);
fn ValidationMessage(&self) -> DOMString; fn ValidationMessage(&self) -> DOMString;
fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult; fn SetValidationMessage(&mut self, _message: DOMString) -> ErrorResult;
fn CheckValidity(&self) -> bool; fn CheckValidity(&self) -> bool;
@ -196,9 +195,6 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
ValidityState::new(&*window) ValidityState::new(&*window)
} }
fn SetValidity(&mut self, _validity: JS<ValidityState>) {
}
fn ValidationMessage(&self) -> DOMString { fn ValidationMessage(&self) -> DOMString {
~"" ~""
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLSourceElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLSourceElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLSourceElementDerived; use dom::bindings::codegen::InheritTypes::HTMLSourceElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLSourceElementTypeId; use dom::element::HTMLSourceElementTypeId;
@ -28,14 +28,14 @@ impl HTMLSourceElementDerived for EventTarget {
} }
impl HTMLSourceElement { impl HTMLSourceElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLSourceElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLSourceElement {
HTMLSourceElement { HTMLSourceElement {
htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSourceElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSourceElement> {
let element = HTMLSourceElement::new_inherited(localName, document.unrooted()); let element = HTMLSourceElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLSourceElementBinding::Wrap) Node::reflect_node(~element, document, HTMLSourceElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLSpanElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLSpanElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLSpanElementDerived; use dom::bindings::codegen::InheritTypes::HTMLSpanElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLSpanElementTypeId; use dom::element::HTMLSpanElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLSpanElementDerived for EventTarget {
} }
impl HTMLSpanElement { impl HTMLSpanElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLSpanElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLSpanElement {
HTMLSpanElement { HTMLSpanElement {
htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSpanElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSpanElement> {
let element = HTMLSpanElement::new_inherited(localName, document.unrooted()); let element = HTMLSpanElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLSpanElementBinding::Wrap) Node::reflect_node(~element, document, HTMLSpanElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLStyleElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLStyleElementBinding;
use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLStyleElementDerived, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLStyleElementDerived, NodeCast};
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLStyleElementTypeId; use dom::element::HTMLStyleElementTypeId;
@ -31,14 +31,14 @@ impl HTMLStyleElementDerived for EventTarget {
} }
impl HTMLStyleElement { impl HTMLStyleElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLStyleElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLStyleElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLStyleElement> {
let element = HTMLStyleElement::new_inherited(localName, document.unrooted()); let element = HTMLStyleElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLStyleElementBinding::Wrap) Node::reflect_node(~element, document, HTMLStyleElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableCaptionElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableCaptionElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableCaptionElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableCaptionElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableCaptionElementTypeId; use dom::element::HTMLTableCaptionElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTableCaptionElementDerived for EventTarget {
} }
impl HTMLTableCaptionElement { impl HTMLTableCaptionElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableCaptionElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableCaptionElement {
HTMLTableCaptionElement { HTMLTableCaptionElement {
htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableCaptionElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableCaptionElement> {
let element = HTMLTableCaptionElement::new_inherited(localName, document.unrooted()); let element = HTMLTableCaptionElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableCaptionElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableCaptionElementBinding::Wrap)
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::InheritTypes::HTMLTableCellElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableCellElementDerived;
use dom::bindings::js::{JS, JSRef}; use dom::bindings::js::JSRef;
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::{ElementTypeId, HTMLTableDataCellElementTypeId, HTMLTableHeaderCellElementTypeId}; use dom::element::{ElementTypeId, HTMLTableDataCellElementTypeId, HTMLTableHeaderCellElementTypeId};
@ -28,7 +28,7 @@ impl HTMLTableCellElementDerived for EventTarget {
} }
impl HTMLTableCellElement { impl HTMLTableCellElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JS<Document>) -> HTMLTableCellElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: &JSRef<Document>) -> HTMLTableCellElement {
HTMLTableCellElement { HTMLTableCellElement {
htmlelement: HTMLElement::new_inherited(type_id, tag_name, document) htmlelement: HTMLElement::new_inherited(type_id, tag_name, document)
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableColElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableColElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableColElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableColElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableColElementTypeId; use dom::element::HTMLTableColElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTableColElementDerived for EventTarget {
} }
impl HTMLTableColElement { impl HTMLTableColElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableColElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableColElement {
HTMLTableColElement { HTMLTableColElement {
htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableColElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableColElement> {
let element = HTMLTableColElement::new_inherited(localName, document.unrooted()); let element = HTMLTableColElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableColElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableColElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableDataCellElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableDataCellElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableDataCellElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableDataCellElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableDataCellElementTypeId; use dom::element::HTMLTableDataCellElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLTableDataCellElementDerived for EventTarget {
} }
impl HTMLTableDataCellElement { impl HTMLTableDataCellElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableDataCellElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableDataCellElement {
HTMLTableDataCellElement { HTMLTableDataCellElement {
htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, document) htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableDataCellElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableDataCellElement> {
let element = HTMLTableDataCellElement::new_inherited(localName, document.unrooted()); let element = HTMLTableDataCellElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableDataCellElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableDataCellElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableElementTypeId; use dom::element::HTMLTableElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTableElementDerived for EventTarget {
} }
impl HTMLTableElement { impl HTMLTableElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableElement {
HTMLTableElement { HTMLTableElement {
htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> {
let element = HTMLTableElement::new_inherited(localName, document.unrooted()); let element = HTMLTableElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableHeaderCellElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableHeaderCellElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableHeaderCellElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableHeaderCellElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableHeaderCellElementTypeId; use dom::element::HTMLTableHeaderCellElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLTableHeaderCellElementDerived for EventTarget {
} }
impl HTMLTableHeaderCellElement { impl HTMLTableHeaderCellElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableHeaderCellElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableHeaderCellElement {
HTMLTableHeaderCellElement { HTMLTableHeaderCellElement {
htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, document) htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableHeaderCellElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableHeaderCellElement> {
let element = HTMLTableHeaderCellElement::new_inherited(localName, document.unrooted()); let element = HTMLTableHeaderCellElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableHeaderCellElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableHeaderCellElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableRowElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableRowElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableRowElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableRowElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableRowElementTypeId; use dom::element::HTMLTableRowElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTableRowElementDerived for EventTarget {
} }
impl HTMLTableRowElement { impl HTMLTableRowElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableRowElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableRowElement {
HTMLTableRowElement { HTMLTableRowElement {
htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableRowElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableRowElement> {
let element = HTMLTableRowElement::new_inherited(localName, document.unrooted()); let element = HTMLTableRowElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableRowElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableRowElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTableSectionElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTableSectionElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTableSectionElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTableSectionElementTypeId; use dom::element::HTMLTableSectionElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTableSectionElementDerived for EventTarget {
} }
impl HTMLTableSectionElement { impl HTMLTableSectionElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTableSectionElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTableSectionElement {
HTMLTableSectionElement { HTMLTableSectionElement {
htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableSectionElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableSectionElement> {
let element = HTMLTableSectionElement::new_inherited(localName, document.unrooted()); let element = HTMLTableSectionElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTableSectionElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTableSectionElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTemplateElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTemplateElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTemplateElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTemplateElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTemplateElementTypeId; use dom::element::HTMLTemplateElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLTemplateElementDerived for EventTarget {
} }
impl HTMLTemplateElement { impl HTMLTemplateElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTemplateElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTemplateElement {
HTMLTemplateElement { HTMLTemplateElement {
htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTemplateElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTemplateElement> {
let element = HTMLTemplateElement::new_inherited(localName, document.unrooted()); let element = HTMLTemplateElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTemplateElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTemplateElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTextAreaElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTextAreaElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTextAreaElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTextAreaElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::error::{ErrorResult, Fallible};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTextAreaElementTypeId; use dom::element::HTMLTextAreaElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTextAreaElementDerived for EventTarget {
} }
impl HTMLTextAreaElement { impl HTMLTextAreaElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTextAreaElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTextAreaElement {
HTMLTextAreaElement { HTMLTextAreaElement {
htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTextAreaElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTextAreaElement> {
let element = HTMLTextAreaElement::new_inherited(localName, document.unrooted()); let element = HTMLTextAreaElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTextAreaElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTextAreaElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTimeElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTimeElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTimeElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTimeElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTimeElementTypeId; use dom::element::HTMLTimeElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTimeElementDerived for EventTarget {
} }
impl HTMLTimeElement { impl HTMLTimeElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTimeElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTimeElement {
HTMLTimeElement { HTMLTimeElement {
htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTimeElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTimeElement> {
let element = HTMLTimeElement::new_inherited(localName, document.unrooted()); let element = HTMLTimeElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTimeElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTimeElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTitleElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTitleElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTitleElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTitleElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTitleElementTypeId; use dom::element::HTMLTitleElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTitleElementDerived for EventTarget {
} }
impl HTMLTitleElement { impl HTMLTitleElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTitleElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTitleElement {
HTMLTitleElement { HTMLTitleElement {
htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTitleElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTitleElement> {
let element = HTMLTitleElement::new_inherited(localName, document.unrooted()); let element = HTMLTitleElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTitleElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTitleElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLTrackElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLTrackElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLTrackElementDerived; use dom::bindings::codegen::InheritTypes::HTMLTrackElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLTrackElementTypeId; use dom::element::HTMLTrackElementTypeId;
@ -28,14 +28,14 @@ impl HTMLTrackElementDerived for EventTarget {
} }
impl HTMLTrackElement { impl HTMLTrackElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLTrackElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLTrackElement {
HTMLTrackElement { HTMLTrackElement {
htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTrackElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTrackElement> {
let element = HTMLTrackElement::new_inherited(localName, document.unrooted()); let element = HTMLTrackElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLTrackElementBinding::Wrap) Node::reflect_node(~element, document, HTMLTrackElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLUListElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLUListElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLUListElementDerived; use dom::bindings::codegen::InheritTypes::HTMLUListElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLUListElementTypeId; use dom::element::HTMLUListElementTypeId;
@ -28,14 +28,14 @@ impl HTMLUListElementDerived for EventTarget {
} }
impl HTMLUListElement { impl HTMLUListElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLUListElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLUListElement {
HTMLUListElement { HTMLUListElement {
htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUListElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUListElement> {
let element = HTMLUListElement::new_inherited(localName, document.unrooted()); let element = HTMLUListElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLUListElementBinding::Wrap) Node::reflect_node(~element, document, HTMLUListElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLUnknownElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLUnknownElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLUnknownElementDerived; use dom::bindings::codegen::InheritTypes::HTMLUnknownElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLUnknownElementTypeId; use dom::element::HTMLUnknownElementTypeId;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -27,14 +27,14 @@ impl HTMLUnknownElementDerived for EventTarget {
} }
impl HTMLUnknownElement { impl HTMLUnknownElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLUnknownElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLUnknownElement {
HTMLUnknownElement { HTMLUnknownElement {
htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUnknownElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUnknownElement> {
let element = HTMLUnknownElement::new_inherited(localName, document.unrooted()); let element = HTMLUnknownElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLUnknownElementBinding::Wrap) Node::reflect_node(~element, document, HTMLUnknownElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::HTMLVideoElementBinding; use dom::bindings::codegen::BindingDeclarations::HTMLVideoElementBinding;
use dom::bindings::codegen::InheritTypes::HTMLVideoElementDerived; use dom::bindings::codegen::InheritTypes::HTMLVideoElementDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::ErrorResult; use dom::bindings::error::ErrorResult;
use dom::document::Document; use dom::document::Document;
use dom::element::HTMLVideoElementTypeId; use dom::element::HTMLVideoElementTypeId;
@ -28,14 +28,14 @@ impl HTMLVideoElementDerived for EventTarget {
} }
impl HTMLVideoElement { impl HTMLVideoElement {
pub fn new_inherited(localName: DOMString, document: JS<Document>) -> HTMLVideoElement { pub fn new_inherited(localName: DOMString, document: &JSRef<Document>) -> HTMLVideoElement {
HTMLVideoElement { HTMLVideoElement {
htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, document) htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, document)
} }
} }
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLVideoElement> { pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLVideoElement> {
let element = HTMLVideoElement::new_inherited(localName, document.unrooted()); let element = HTMLVideoElement::new_inherited(localName, document);
Node::reflect_node(~element, document, HTMLVideoElementBinding::Wrap) Node::reflect_node(~element, document, HTMLVideoElementBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::MouseEventBinding; use dom::bindings::codegen::BindingDeclarations::MouseEventBinding;
use dom::bindings::codegen::InheritTypes::{UIEventCast, MouseEventDerived}; use dom::bindings::codegen::InheritTypes::{UIEventCast, MouseEventDerived};
use dom::bindings::js::{JS, JSRef, RootedReference, Temporary}; use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, OptionalSettable};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::event::{Event, MouseEventTypeId}; use dom::event::{Event, MouseEventTypeId};
@ -68,7 +68,7 @@ impl MouseEvent {
init.clientX, init.clientY, init.ctrlKey, init.clientX, init.clientY, init.ctrlKey,
init.altKey, init.shiftKey, init.metaKey, init.altKey, init.shiftKey, init.metaKey,
init.button, related_target.root_ref()); init.button, related_target.root_ref());
Ok(Temporary::new_rooted(&*ev)) Ok(Temporary::from_rooted(&*ev))
} }
} }
@ -183,7 +183,7 @@ impl<'a> MouseEventMethods for JSRef<'a, MouseEvent> {
self.shift_key = shiftKeyArg; self.shift_key = shiftKeyArg;
self.meta_key = metaKeyArg; self.meta_key = metaKeyArg;
self.button = buttonArg; self.button = buttonArg;
self.related_target = relatedTargetArg.map(|target| target.unrooted()); self.related_target.assign(relatedTargetArg);
} }
} }

View file

@ -11,7 +11,7 @@ use dom::bindings::codegen::InheritTypes::{CharacterDataCast, NodeBase, NodeDeri
use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, EventTargetCast}; use dom::bindings::codegen::InheritTypes::{ProcessingInstructionCast, EventTargetCast};
use dom::bindings::codegen::BindingDeclarations::NodeBinding::NodeConstants; use dom::bindings::codegen::BindingDeclarations::NodeBinding::NodeConstants;
use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root}; use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, Root};
use dom::bindings::js::{OptionalAssignable, TemporaryPushable, OptionalRootedRootable}; use dom::bindings::js::{OptionalSettable, TemporaryPushable, OptionalRootedRootable};
use dom::bindings::js::{ResultRootable, OptionalRootable}; use dom::bindings::js::{ResultRootable, OptionalRootable};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::error::{ErrorResult, Fallible, NotFound, HierarchyRequest}; use dom::bindings::error::{ErrorResult, Fallible, NotFound, HierarchyRequest};
@ -566,7 +566,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
fn is_parent_of(&self, child: &JSRef<Node>) -> bool { fn is_parent_of(&self, child: &JSRef<Node>) -> bool {
match child.parent_node() { match child.parent_node() {
Some(ref parent) if *parent == Temporary::new_rooted(self) => true, Some(ref parent) if *parent == Temporary::from_rooted(self) => true,
_ => false _ => false
} }
} }
@ -604,7 +604,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
} }
fn set_owner_doc(&mut self, document: &JSRef<Document>) { fn set_owner_doc(&mut self, document: &JSRef<Document>) {
self.owner_doc = Some(document.unrooted()); self.owner_doc.assign(Some(document.clone()));
} }
fn children(&self) -> AbstractNodeChildrenIterator { fn children(&self) -> AbstractNodeChildrenIterator {
@ -891,12 +891,11 @@ impl Node {
let window = document.get().window.root(); let window = document.get().window.root();
let node = reflect_dom_object(node, &window.root_ref(), wrap_fn).root(); let node = reflect_dom_object(node, &window.root_ref(), wrap_fn).root();
assert!(node.reflector().get_jsobject().is_not_null()); assert!(node.reflector().get_jsobject().is_not_null());
Temporary::new_rooted(&*node) Temporary::from_rooted(&*node)
} }
pub fn new_inherited(type_id: NodeTypeId, doc: JS<Document>) -> Node { pub fn new_inherited(type_id: NodeTypeId, doc: &JSRef<Document>) -> Node {
let doc = doc.root(); Node::new_(type_id, Some(doc.clone()))
Node::new_(type_id, Some(doc.root_ref()))
} }
pub fn new_without_doc(type_id: NodeTypeId) -> Node { pub fn new_without_doc(type_id: NodeTypeId) -> Node {
@ -1079,7 +1078,7 @@ impl Node {
Node::insert(node, parent, referenceChild, Unsuppressed); Node::insert(node, parent, referenceChild, Unsuppressed);
// Step 11. // Step 11.
return Ok(Temporary::new_rooted(node)) return Ok(Temporary::from_rooted(node))
} }
// http://dom.spec.whatwg.org/#concept-node-insert // http://dom.spec.whatwg.org/#concept-node-insert
@ -1174,7 +1173,7 @@ impl Node {
fn pre_remove(child: &mut JSRef<Node>, parent: &mut JSRef<Node>) -> Fallible<Temporary<Node>> { fn pre_remove(child: &mut JSRef<Node>, parent: &mut JSRef<Node>) -> Fallible<Temporary<Node>> {
// Step 1. // Step 1.
match child.parent_node() { match child.parent_node() {
Some(ref node) if *node != Temporary::new_rooted(parent) => return Err(NotFound), Some(ref node) if *node != Temporary::from_rooted(parent) => return Err(NotFound),
_ => () _ => ()
} }
@ -1182,12 +1181,12 @@ impl Node {
Node::remove(child, parent, Unsuppressed); Node::remove(child, parent, Unsuppressed);
// Step 3. // Step 3.
Ok(Temporary::new_rooted(child)) Ok(Temporary::from_rooted(child))
} }
// http://dom.spec.whatwg.org/#concept-node-remove // http://dom.spec.whatwg.org/#concept-node-remove
fn remove(node: &mut JSRef<Node>, parent: &mut JSRef<Node>, suppress_observers: SuppressObserver) { fn remove(node: &mut JSRef<Node>, parent: &mut JSRef<Node>, suppress_observers: SuppressObserver) {
assert!(node.parent_node().map_or(false, |node_parent| node_parent == Temporary::new_rooted(parent))); assert!(node.parent_node().map_or(false, |node_parent| node_parent == Temporary::from_rooted(parent)));
// Step 1-5: ranges. // Step 1-5: ranges.
// Step 6-7: mutation observers. // Step 6-7: mutation observers.
@ -1296,10 +1295,10 @@ impl Node {
let window = document.get().window.root(); let window = document.get().window.root();
for attr in node_elem.attrs.iter().map(|attr| attr.root()) { for attr in node_elem.attrs.iter().map(|attr| attr.root()) {
copy_elem.attrs.push_unrooted( copy_elem.attrs.push_unrooted(
Attr::new(&*window, &Attr::new(&*window,
attr.deref().local_name.clone(), attr.deref().value.clone(), attr.deref().local_name.clone(), attr.deref().value.clone(),
attr.deref().name.clone(), attr.deref().namespace.clone(), attr.deref().name.clone(), attr.deref().namespace.clone(),
attr.deref().prefix.clone(), &copy_elem_alias)); attr.deref().prefix.clone(), &copy_elem_alias));
} }
}, },
_ => () _ => ()
@ -1316,7 +1315,7 @@ impl Node {
} }
// Step 7. // Step 7.
Temporary::new_rooted(&*copy) Temporary::from_rooted(&*copy)
} }
/// Sends layout data, if any, back to the script task to be destroyed. /// Sends layout data, if any, back to the script task to be destroyed.
@ -1433,7 +1432,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
.and_then(|parent| { .and_then(|parent| {
let parent = parent.root(); let parent = parent.root();
ElementCast::to_ref(&*parent).map(|elem| { ElementCast::to_ref(&*parent).map(|elem| {
Temporary::new_rooted(elem) Temporary::from_rooted(elem)
}) })
}) })
} }
@ -1546,7 +1545,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
let document = self.owner_doc().root(); let document = self.owner_doc().root();
Some(NodeCast::from_unrooted(document.deref().CreateTextNode(value))) Some(NodeCast::from_unrooted(document.deref().CreateTextNode(value)))
}.root(); }.root();
// Step 3. // Step 3.
Node::replace_all(node.root_ref(), self); Node::replace_all(node.root_ref(), self);
} }
@ -1671,8 +1670,8 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
} }
// Ok if not caught by previous error checks. // Ok if not caught by previous error checks.
if node.unrooted() == child.unrooted() { if *node == *child {
return Ok(Temporary::new_rooted(child)); return Ok(Temporary::from_rooted(child));
} }
// Step 7-8. // Step 7-8.
@ -1706,7 +1705,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
} }
// Step 15. // Step 15.
Ok(Temporary::new_rooted(child)) Ok(Temporary::from_rooted(child))
} }
// http://dom.spec.whatwg.org/#dom-node-removechild // http://dom.spec.whatwg.org/#dom-node-removechild

View file

@ -22,18 +22,18 @@ pub struct NodeList {
} }
impl NodeList { impl NodeList {
pub fn new_inherited(window: JS<Window>, pub fn new_inherited(window: &JSRef<Window>,
list_type: NodeListType) -> NodeList { list_type: NodeListType) -> NodeList {
NodeList { NodeList {
list_type: list_type, list_type: list_type,
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window window: window.unrooted()
} }
} }
pub fn new(window: &JSRef<Window>, pub fn new(window: &JSRef<Window>,
list_type: NodeListType) -> Temporary<NodeList> { list_type: NodeListType) -> Temporary<NodeList> {
reflect_dom_object(~NodeList::new_inherited(window.unrooted(), list_type), reflect_dom_object(~NodeList::new_inherited(window, list_type),
window, NodeListBinding::Wrap) window, NodeListBinding::Wrap)
} }
@ -70,7 +70,7 @@ impl<'a> NodeListMethods for JSRef<'a, NodeList> {
Children(ref node) => { Children(ref node) => {
let node = node.root(); let node = node.root();
node.deref().children().nth(index as uint) node.deref().children().nth(index as uint)
.map(|child| Temporary::new_rooted(&child)) .map(|child| Temporary::from_rooted(&child))
} }
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::ProcessingInstructionBinding; use dom::bindings::codegen::BindingDeclarations::ProcessingInstructionBinding;
use dom::bindings::codegen::InheritTypes::ProcessingInstructionDerived; use dom::bindings::codegen::InheritTypes::ProcessingInstructionDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::characterdata::CharacterData; use dom::characterdata::CharacterData;
use dom::document::Document; use dom::document::Document;
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
@ -28,7 +28,7 @@ impl ProcessingInstructionDerived for EventTarget {
} }
impl ProcessingInstruction { impl ProcessingInstruction {
pub fn new_inherited(target: DOMString, data: DOMString, document: JS<Document>) -> ProcessingInstruction { pub fn new_inherited(target: DOMString, data: DOMString, document: &JSRef<Document>) -> ProcessingInstruction {
ProcessingInstruction { ProcessingInstruction {
characterdata: CharacterData::new_inherited(ProcessingInstructionNodeTypeId, data, document), characterdata: CharacterData::new_inherited(ProcessingInstructionNodeTypeId, data, document),
target: target target: target
@ -36,7 +36,7 @@ impl ProcessingInstruction {
} }
pub fn new(target: DOMString, data: DOMString, document: &JSRef<Document>) -> Temporary<ProcessingInstruction> { pub fn new(target: DOMString, data: DOMString, document: &JSRef<Document>) -> Temporary<ProcessingInstruction> {
let node = ProcessingInstruction::new_inherited(target, data, document.unrooted()); let node = ProcessingInstruction::new_inherited(target, data, document);
Node::reflect_node(~node, document, ProcessingInstructionBinding::Wrap) Node::reflect_node(~node, document, ProcessingInstructionBinding::Wrap)
} }
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::TextBinding; use dom::bindings::codegen::BindingDeclarations::TextBinding;
use dom::bindings::codegen::InheritTypes::TextDerived; use dom::bindings::codegen::InheritTypes::TextDerived;
use dom::bindings::js::{JS, JSRef, Temporary}; use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::characterdata::CharacterData; use dom::characterdata::CharacterData;
use dom::document::Document; use dom::document::Document;
@ -29,14 +29,14 @@ impl TextDerived for EventTarget {
} }
impl Text { impl Text {
pub fn new_inherited(text: DOMString, document: JS<Document>) -> Text { pub fn new_inherited(text: DOMString, document: &JSRef<Document>) -> Text {
Text { Text {
characterdata: CharacterData::new_inherited(TextNodeTypeId, text, document) characterdata: CharacterData::new_inherited(TextNodeTypeId, text, document)
} }
} }
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Text> { pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Text> {
let node = Text::new_inherited(text, document.unrooted()); let node = Text::new_inherited(text, document);
Node::reflect_node(~node, document, TextBinding::Wrap) Node::reflect_node(~node, document, TextBinding::Wrap)
} }

View file

@ -4,7 +4,7 @@
use dom::bindings::codegen::BindingDeclarations::UIEventBinding; use dom::bindings::codegen::BindingDeclarations::UIEventBinding;
use dom::bindings::codegen::InheritTypes::{EventCast, UIEventDerived}; use dom::bindings::codegen::InheritTypes::{EventCast, UIEventDerived};
use dom::bindings::js::{JS, JSRef, RootedReference, Temporary}; use dom::bindings::js::{JS, JSRef, RootedReference, Temporary, OptionalSettable};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::event::{Event, EventMethods, EventTypeId, UIEventTypeId}; use dom::event::{Event, EventMethods, EventTypeId, UIEventTypeId};
@ -49,7 +49,7 @@ impl UIEvent {
let view = init.view.as_ref().map(|view| view.root()); let view = init.view.as_ref().map(|view| view.root());
ev.InitUIEvent(type_, init.parent.bubbles, init.parent.cancelable, ev.InitUIEvent(type_, init.parent.bubbles, init.parent.cancelable,
view.root_ref(), init.detail); view.root_ref(), init.detail);
Ok(Temporary::new_rooted(&*ev)) Ok(Temporary::from_rooted(&*ev))
} }
} }
@ -93,7 +93,7 @@ impl<'a> UIEventMethods for JSRef<'a, UIEvent> {
let event: &mut JSRef<Event> = EventCast::from_mut_ref(self); let event: &mut JSRef<Event> = EventCast::from_mut_ref(self);
event.InitEvent(type_, can_bubble, cancelable); event.InitEvent(type_, can_bubble, cancelable);
} }
self.view = view.map(|view| view.unrooted()); self.view.assign(view);
self.detail = detail; self.detail = detail;
} }

View file

@ -15,16 +15,16 @@ pub struct ValidityState {
} }
impl ValidityState { impl ValidityState {
pub fn new_inherited(window: JS<Window>) -> ValidityState { pub fn new_inherited(window: &JSRef<Window>) -> ValidityState {
ValidityState { ValidityState {
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: window, window: window.unrooted(),
state: 0, state: 0,
} }
} }
pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> { pub fn new(window: &JSRef<Window>) -> Temporary<ValidityState> {
reflect_dom_object(~ValidityState::new_inherited(window.unrooted()), reflect_dom_object(~ValidityState::new_inherited(window),
window, window,
ValidityStateBinding::Wrap) ValidityStateBinding::Wrap)
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::BindingDeclarations::WindowBinding; use dom::bindings::codegen::BindingDeclarations::WindowBinding;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalAssignable}; use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable};
use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::trace::{Traceable, Untraceable};
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::browsercontext::BrowserContext; use dom::browsercontext::BrowserContext;
@ -242,7 +242,7 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
} }
fn Window(&self) -> Temporary<Window> { fn Window(&self) -> Temporary<Window> {
Temporary::new_rooted(self) Temporary::from_rooted(self)
} }
fn Self(&self) -> Temporary<Window> { fn Self(&self) -> Temporary<Window> {

View file

@ -10,7 +10,7 @@ use dom::bindings::codegen::InheritTypes::XMLHttpRequestDerived;
use dom::document::Document; use dom::document::Document;
use dom::eventtarget::{EventTarget, XMLHttpRequestTargetTypeId}; use dom::eventtarget::{EventTarget, XMLHttpRequestTargetTypeId};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::bindings::js::{JS, JSRef, Temporary, OptionalAssignable}; use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable};
use js::jsapi::JSContext; use js::jsapi::JSContext;
use js::jsval::{JSVal, NullValue}; use js::jsval::{JSVal, NullValue};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};

View file

@ -8,7 +8,7 @@
use dom::attr::AttrMethods; use dom::attr::AttrMethods;
use dom::bindings::codegen::RegisterBindings; use dom::bindings::codegen::RegisterBindings;
use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, ElementCast, EventCast}; use dom::bindings::codegen::InheritTypes::{EventTargetCast, NodeCast, ElementCast, EventCast};
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalAssignable}; use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalSettable};
use dom::bindings::js::OptionalRootable; use dom::bindings::js::OptionalRootable;
use dom::bindings::trace::{Traceable, Untraceable}; use dom::bindings::trace::{Traceable, Untraceable};
use dom::bindings::utils::{Reflectable, GlobalStaticData, wrap_for_same_compartment}; use dom::bindings::utils::{Reflectable, GlobalStaticData, wrap_for_same_compartment};
@ -421,7 +421,7 @@ impl Page {
elem.get_attribute(Null, "name").root().map_or(false, |attr| { elem.get_attribute(Null, "name").root().map_or(false, |attr| {
attr.get().value_ref() == fragid attr.get().value_ref() == fragid
}) })
}).map(|node| Temporary::new_rooted(ElementCast::to_ref(&node).unwrap())) }).map(|node| Temporary::from_rooted(ElementCast::to_ref(&node).unwrap()))
} }
} }
} }
@ -907,7 +907,7 @@ impl ScriptTask {
{ {
let mut js_info = page.mut_js_info(); let mut js_info = page.mut_js_info();
RegisterBindings::Register(&*window, js_info.get_mut_ref()); RegisterBindings::Register(&window.unrooted(), js_info.get_mut_ref());
} }
self.compositor.set_ready_state(Loading); self.compositor.set_ready_state(Loading);