Use #[must_root] for HTMLElements

This commit is contained in:
Manish Goregaokar 2014-09-17 01:00:59 +05:30
parent 30014c3919
commit f5087e1490
70 changed files with 138 additions and 5 deletions

View file

@ -24,6 +24,7 @@ use servo_util::namespace::Null;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLAnchorElement {
pub htmlelement: HTMLElement
}
@ -41,6 +42,7 @@ impl HTMLAnchorElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAnchorElement> {
let element = HTMLAnchorElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLAnchorElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLAppletElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLAppletElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAppletElement> {
let element = HTMLAppletElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLAppletElementBinding::Wrap)

View file

@ -18,6 +18,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLAreaElement {
pub htmlelement: HTMLElement
}
@ -35,6 +36,7 @@ impl HTMLAreaElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAreaElement> {
let element = HTMLAreaElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLAreaElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLAudioElement {
pub htmlmediaelement: HTMLMediaElement
}
@ -31,6 +32,7 @@ impl HTMLAudioElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLAudioElement> {
let element = HTMLAudioElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLAudioElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLBaseElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLBaseElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBaseElement> {
let element = HTMLBaseElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLBaseElementBinding::Wrap)

View file

@ -21,6 +21,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLBodyElement {
pub htmlelement: HTMLElement
}
@ -38,6 +39,7 @@ impl HTMLBodyElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBodyElement> {
let element = HTMLBodyElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLBodyElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLBRElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLBRElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLBRElement> {
let element = HTMLBRElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLBRElementBinding::Wrap)

View file

@ -20,6 +20,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLButtonElement {
pub htmlelement: HTMLElement
}
@ -37,6 +38,7 @@ impl HTMLButtonElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLButtonElement> {
let element = HTMLButtonElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLButtonElementBinding::Wrap)

View file

@ -29,6 +29,7 @@ static DefaultWidth: u32 = 300;
static DefaultHeight: u32 = 150;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLCanvasElement {
pub htmlelement: HTMLElement,
context: Traceable<Cell<Option<JS<CanvasRenderingContext2D>>>>,
@ -52,6 +53,7 @@ impl HTMLCanvasElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLCanvasElement> {
let element = HTMLCanvasElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLCanvasElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLDataElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLDataElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataElement> {
let element = HTMLDataElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLDataElementBinding::Wrap)

View file

@ -17,6 +17,7 @@ use dom::node::{Node, ElementNodeTypeId, window_from_node};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLDataListElement {
pub htmlelement: HTMLElement
}
@ -34,6 +35,7 @@ impl HTMLDataListElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDataListElement> {
let element = HTMLDataListElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLDataListElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLDirectoryElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLDirectoryElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDirectoryElement> {
let element = HTMLDirectoryElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLDirectoryElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLDivElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLDivElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDivElement> {
let element = HTMLDivElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLDivElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLDListElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLDListElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLDListElement> {
let element = HTMLDListElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLDListElementBinding::Wrap)

View file

@ -22,7 +22,7 @@ use servo_util::namespace;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[allow(unrooted_must_root)]
#[must_root]
pub struct HTMLElement {
pub element: Element
}
@ -44,6 +44,7 @@ impl HTMLElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLElement> {
let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document);
Node::reflect_node(box element, document, HTMLElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLEmbedElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLEmbedElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLEmbedElement> {
let element = HTMLEmbedElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLEmbedElementBinding::Wrap)

View file

@ -22,6 +22,7 @@ use servo_util::atom::Atom;
use servo_util::str::{DOMString, StaticStringVec};
#[deriving(Encodable)]
#[must_root]
pub struct HTMLFieldSetElement {
pub htmlelement: HTMLElement
}
@ -39,6 +40,7 @@ impl HTMLFieldSetElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFieldSetElement> {
let element = HTMLFieldSetElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLFieldSetElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLFontElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLFontElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFontElement> {
let element = HTMLFontElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLFontElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLFormElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLFormElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFormElement> {
let element = HTMLFormElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLFormElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLFrameElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLFrameElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameElement> {
let element = HTMLFrameElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLFrameElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLFrameSetElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLFrameSetElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameSetElement> {
let element = HTMLFrameSetElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLFrameSetElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLHeadElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLHeadElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHeadElement> {
let element = HTMLHeadElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLHeadElementBinding::Wrap)

View file

@ -24,6 +24,7 @@ pub enum HeadingLevel {
}
#[deriving(Encodable)]
#[must_root]
pub struct HTMLHeadingElement {
pub htmlelement: HTMLElement,
pub level: HeadingLevel,
@ -43,6 +44,7 @@ impl HTMLHeadingElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>, level: HeadingLevel) -> Temporary<HTMLHeadingElement> {
let element = HTMLHeadingElement::new_inherited(localName, document, level);
Node::reflect_node(box element, document, HTMLHeadingElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLHRElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLHRElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHRElement> {
let element = HTMLHRElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLHRElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLHtmlElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLHtmlElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLHtmlElement> {
let element = HTMLHtmlElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLHtmlElementBinding::Wrap)

View file

@ -42,6 +42,7 @@ enum SandboxAllowance {
}
#[deriving(Encodable)]
#[must_root]
pub struct HTMLIFrameElement {
pub htmlelement: HTMLElement,
pub size: Traceable<Cell<Option<IFrameSize>>>,
@ -117,6 +118,7 @@ impl HTMLIFrameElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLIFrameElement> {
let element = HTMLIFrameElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLIFrameElementBinding::Wrap)

View file

@ -26,6 +26,7 @@ use url::{Url, UrlParser};
use std::cell::RefCell;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLImageElement {
pub htmlelement: HTMLElement,
image: Untraceable<RefCell<Option<Url>>>,
@ -78,6 +79,7 @@ impl HTMLImageElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLImageElement> {
let element = HTMLImageElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLImageElementBinding::Wrap)

View file

@ -19,6 +19,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLInputElement {
pub htmlelement: HTMLElement,
}
@ -36,6 +37,7 @@ impl HTMLInputElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLInputElement> {
let element = HTMLInputElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLInputElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLLabelElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLLabelElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLabelElement> {
let element = HTMLLabelElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLLabelElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLLegendElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLLegendElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLegendElement> {
let element = HTMLLegendElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLLegendElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLLIElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLLIElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLIElement> {
let element = HTMLLIElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLLIElementBinding::Wrap)

View file

@ -18,6 +18,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLLinkElement {
pub htmlelement: HTMLElement,
}
@ -35,6 +36,7 @@ impl HTMLLinkElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLLinkElement> {
let element = HTMLLinkElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLLinkElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLMapElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLMapElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMapElement> {
let element = HTMLMapElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLMapElementBinding::Wrap)

View file

@ -13,6 +13,7 @@ use dom::node::ElementNodeTypeId;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLMediaElement {
pub htmlelement: HTMLElement,
}

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLMetaElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLMetaElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMetaElement> {
let element = HTMLMetaElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLMetaElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLMeterElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLMeterElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLMeterElement> {
let element = HTMLMeterElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLMeterElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLModElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLModElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLModElement> {
let element = HTMLModElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLModElementBinding::Wrap)

View file

@ -27,6 +27,7 @@ use servo_util::str::DOMString;
use url::Url;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLObjectElement {
pub htmlelement: HTMLElement,
}
@ -44,6 +45,7 @@ impl HTMLObjectElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLObjectElement> {
let element = HTMLObjectElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLObjectElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLOListElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLOListElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOListElement> {
let element = HTMLOListElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLOListElementBinding::Wrap)

View file

@ -19,6 +19,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLOptGroupElement {
pub htmlelement: HTMLElement
}
@ -36,6 +37,7 @@ impl HTMLOptGroupElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptGroupElement> {
let element = HTMLOptGroupElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLOptGroupElementBinding::Wrap)

View file

@ -19,6 +19,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLOptionElement {
pub htmlelement: HTMLElement
}
@ -36,6 +37,7 @@ impl HTMLOptionElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOptionElement> {
let element = HTMLOptionElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLOptionElementBinding::Wrap)

View file

@ -16,6 +16,7 @@ use dom::validitystate::ValidityState;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLOutputElement {
pub htmlelement: HTMLElement
}
@ -33,6 +34,7 @@ impl HTMLOutputElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLOutputElement> {
let element = HTMLOutputElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLOutputElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLParagraphElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLParagraphElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParagraphElement> {
let element = HTMLParagraphElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLParagraphElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLParamElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLParamElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLParamElement> {
let element = HTMLParamElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLParamElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLPreElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLPreElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLPreElement> {
let element = HTMLPreElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLPreElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLProgressElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLProgressElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLProgressElement> {
let element = HTMLProgressElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLProgressElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLQuoteElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLQuoteElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLQuoteElement> {
let element = HTMLQuoteElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLQuoteElementBinding::Wrap)

View file

@ -20,6 +20,7 @@ use servo_util::namespace::Null;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
#[deriving(Encodable)]
#[must_root]
pub struct HTMLScriptElement {
pub htmlelement: HTMLElement,
}
@ -37,6 +38,7 @@ impl HTMLScriptElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLScriptElement> {
let element = HTMLScriptElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap)

View file

@ -22,6 +22,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLSelectElement {
pub htmlelement: HTMLElement
}
@ -39,6 +40,7 @@ impl HTMLSelectElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSelectElement> {
let element = HTMLSelectElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLSelectElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLSourceElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLSourceElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSourceElement> {
let element = HTMLSourceElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLSourceElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLSpanElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLSpanElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLSpanElement> {
let element = HTMLSpanElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLSpanElementBinding::Wrap)

View file

@ -18,6 +18,7 @@ use layout_interface::{AddStylesheetMsg, LayoutChan};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLStyleElement {
pub htmlelement: HTMLElement,
}
@ -35,6 +36,7 @@ impl HTMLStyleElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLStyleElement> {
let element = HTMLStyleElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLStyleElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableCaptionElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLTableCaptionElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableCaptionElement> {
let element = HTMLTableCaptionElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableCaptionElementBinding::Wrap)

View file

@ -13,6 +13,7 @@ use dom::node::ElementNodeTypeId;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableCellElement {
pub htmlelement: HTMLElement,
}

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableColElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLTableColElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableColElement> {
let element = HTMLTableColElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableColElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableDataCellElement {
pub htmltablecellelement: HTMLTableCellElement,
}
@ -31,6 +32,7 @@ impl HTMLTableDataCellElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableDataCellElement> {
let element = HTMLTableDataCellElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableDataCellElementBinding::Wrap)

View file

@ -18,6 +18,7 @@ use dom::node::{Node, NodeHelpers, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableElement {
pub htmlelement: HTMLElement,
}
@ -35,6 +36,7 @@ impl HTMLTableElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableElement> {
let element = HTMLTableElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableHeaderCellElement {
pub htmltablecellelement: HTMLTableCellElement,
}
@ -31,6 +32,7 @@ impl HTMLTableHeaderCellElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableHeaderCellElement> {
let element = HTMLTableHeaderCellElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableHeaderCellElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableRowElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLTableRowElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableRowElement> {
let element = HTMLTableRowElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableRowElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTableSectionElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLTableSectionElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTableSectionElement> {
let element = HTMLTableSectionElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTableSectionElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTemplateElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLTemplateElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTemplateElement> {
let element = HTMLTemplateElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTemplateElementBinding::Wrap)

View file

@ -19,6 +19,7 @@ use servo_util::atom::Atom;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTextAreaElement {
pub htmlelement: HTMLElement,
}
@ -36,6 +37,7 @@ impl HTMLTextAreaElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTextAreaElement> {
let element = HTMLTextAreaElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTextAreaElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTimeElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLTimeElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTimeElement> {
let element = HTMLTimeElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTimeElementBinding::Wrap)

View file

@ -17,6 +17,7 @@ use dom::text::Text;
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTitleElement {
pub htmlelement: HTMLElement,
}
@ -34,6 +35,7 @@ impl HTMLTitleElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTitleElement> {
let element = HTMLTitleElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTitleElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLTrackElement {
pub htmlelement: HTMLElement,
}
@ -31,6 +32,7 @@ impl HTMLTrackElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLTrackElement> {
let element = HTMLTrackElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLTrackElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLUListElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLUListElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUListElement> {
let element = HTMLUListElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLUListElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLUnknownElement {
pub htmlelement: HTMLElement
}
@ -31,6 +32,7 @@ impl HTMLUnknownElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLUnknownElement> {
let element = HTMLUnknownElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLUnknownElementBinding::Wrap)

View file

@ -14,6 +14,7 @@ use dom::node::{Node, ElementNodeTypeId};
use servo_util::str::DOMString;
#[deriving(Encodable)]
#[must_root]
pub struct HTMLVideoElement {
pub htmlmediaelement: HTMLMediaElement
}
@ -31,6 +32,7 @@ impl HTMLVideoElement {
}
}
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLVideoElement> {
let element = HTMLVideoElement::new_inherited(localName, document);
Node::reflect_node(box element, document, HTMLVideoElementBinding::Wrap)

View file

@ -36,8 +36,8 @@ impl ProcessingInstruction {
}
pub fn new(target: DOMString, data: DOMString, document: &JSRef<Document>) -> Temporary<ProcessingInstruction> {
let node = ProcessingInstruction::new_inherited(target, data, document);
Node::reflect_node(box node, document, ProcessingInstructionBinding::Wrap)
Node::reflect_node(box ProcessingInstruction::new_inherited(target, data, document),
document, ProcessingInstructionBinding::Wrap)
}
}

View file

@ -36,8 +36,8 @@ impl Text {
}
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Text> {
let node = Text::new_inherited(text, document);
Node::reflect_node(box node, document, TextBinding::Wrap)
Node::reflect_node(box Text::new_inherited(text, document),
document, TextBinding::Wrap)
}
pub fn Constructor(global: &GlobalRef, text: DOMString) -> Fallible<Temporary<Text>> {