auto merge of #1177 : Ms2ger/servo/new-htmlelement, r=jdm

r? @jdm
This commit is contained in:
bors-servo 2013-11-05 07:17:27 -08:00
commit e16a29480e
67 changed files with 748 additions and 176 deletions

View file

@ -12,7 +12,6 @@ use dom::element::{Element};
use dom::element::{HTMLHeadElementTypeId, HTMLTitleElementTypeId}; use dom::element::{HTMLHeadElementTypeId, HTMLTitleElementTypeId};
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmldocument::HTMLDocument; use dom::htmldocument::HTMLDocument;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView, Node, ElementNodeTypeId, DocumentNodeTypeId}; use dom::node::{AbstractNode, ScriptView, Node, ElementNodeTypeId, DocumentNodeTypeId};
use dom::text::Text; use dom::text::Text;
use dom::window::Window; use dom::window::Window;
@ -236,13 +235,12 @@ impl Document {
} }
pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> { pub fn CreateElement(&self, abstract_self: AbstractDocument, local_name: &DOMString) -> Fallible<AbstractNode<ScriptView>> {
let cx = self.get_cx();
let local_name = null_str_as_empty(local_name); let local_name = null_str_as_empty(local_name);
if !is_valid_element_name(local_name) { if !is_valid_element_name(local_name) {
return Err(InvalidCharacter); return Err(InvalidCharacter);
} }
let local_name = local_name.to_ascii_lower(); let local_name = local_name.to_ascii_lower();
Ok(build_element_from_tag(cx, local_name, abstract_self)) Ok(build_element_from_tag(local_name, abstract_self))
} }
pub fn CreateDocumentFragment(&self, abstract_self: AbstractDocument) -> AbstractNode<ScriptView> { pub fn CreateDocumentFragment(&self, abstract_self: AbstractDocument) -> AbstractNode<ScriptView> {
@ -323,12 +321,7 @@ impl Document {
break; break;
} }
if !has_title { if !has_title {
let new_title = @HTMLTitleElement { let new_title = HTMLTitleElement::new(~"title", abstract_self);
htmlelement: HTMLElement::new(HTMLTitleElementTypeId, ~"title", abstract_self)
};
let new_title = unsafe {
Node::as_abstract_node(self.get_cx(), new_title)
};
new_title.AppendChild(self.CreateTextNode(abstract_self, title)); new_title.AppendChild(self.CreateTextNode(abstract_self, title));
node.AppendChild(new_title); node.AppendChild(new_title);
} }

View file

@ -2,13 +2,30 @@
* 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::htmlelement::HTMLElement; use dom::bindings::codegen::HTMLAnchorElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLAnchorElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLAnchorElement { pub struct HTMLAnchorElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLAnchorElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAnchorElement {
HTMLAnchorElement {
htmlelement: HTMLElement::new_inherited(HTMLAnchorElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLAnchorElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLAnchorElementBinding::Wrap)
}
}
impl HTMLAnchorElement { impl HTMLAnchorElement {
pub fn Href(&self) -> DOMString { pub fn Href(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLAppletElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLAppletElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLAppletElement { pub struct HTMLAppletElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLAppletElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAppletElement {
HTMLAppletElement {
htmlelement: HTMLElement::new_inherited(HTMLAppletElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLAppletElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLAppletElementBinding::Wrap)
}
}
impl HTMLAppletElement { impl HTMLAppletElement {
pub fn Align(&self) -> DOMString { pub fn Align(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLAreaElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLAreaElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLAreaElement { pub struct HTMLAreaElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLAreaElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAreaElement {
HTMLAreaElement {
htmlelement: HTMLElement::new_inherited(HTMLAreaElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLAreaElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLAreaElementBinding::Wrap)
}
}
impl HTMLAreaElement { impl HTMLAreaElement {
pub fn Alt(&self) -> DOMString { pub fn Alt(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLBaseElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLBaseElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLBaseElement { pub struct HTMLBaseElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLBaseElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBaseElement {
HTMLBaseElement {
htmlelement: HTMLElement::new_inherited(HTMLBaseElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLBaseElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLBaseElementBinding::Wrap)
}
}
impl HTMLBaseElement { impl HTMLBaseElement {
pub fn Href(&self) -> DOMString { pub fn Href(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLBodyElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLBodyElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLBodyElement { pub struct HTMLBodyElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLBodyElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBodyElement {
HTMLBodyElement {
htmlelement: HTMLElement::new_inherited(HTMLBodyElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLBodyElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLBodyElementBinding::Wrap)
}
}
impl HTMLBodyElement { impl HTMLBodyElement {
pub fn Text(&self) -> DOMString { pub fn Text(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLBRElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLBRElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLBRElement { pub struct HTMLBRElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLBRElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLBRElement {
HTMLBRElement {
htmlelement: HTMLElement::new_inherited(HTMLBRElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLBRElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLBRElementBinding::Wrap)
}
}
impl HTMLBRElement { impl HTMLBRElement {
pub fn Clear(&self) -> DOMString { pub fn Clear(&self) -> DOMString {
None None

View file

@ -2,15 +2,31 @@
* 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::codegen::HTMLButtonElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLButtonElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
pub struct HTMLButtonElement { pub struct HTMLButtonElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLButtonElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLButtonElement {
HTMLButtonElement {
htmlelement: HTMLElement::new_inherited(HTMLButtonElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLButtonElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLButtonElementBinding::Wrap)
}
}
impl HTMLButtonElement { impl HTMLButtonElement {
pub fn Autofocus(&self) -> bool { pub fn Autofocus(&self) -> bool {
false false

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLCanvasElementBinding;
use dom::bindings::utils::{ErrorResult}; use dom::bindings::utils::{ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLCanvasElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLCanvasElement { pub struct HTMLCanvasElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLCanvasElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLCanvasElement {
HTMLCanvasElement {
htmlelement: HTMLElement::new_inherited(HTMLCanvasElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLCanvasElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLCanvasElementBinding::Wrap)
}
}
impl HTMLCanvasElement { impl HTMLCanvasElement {
pub fn Width(&self) -> u32 { pub fn Width(&self) -> u32 {
0 0

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLDataElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLDataElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLDataElement { pub struct HTMLDataElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLDataElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataElement {
HTMLDataElement {
htmlelement: HTMLElement::new_inherited(HTMLDataElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLDataElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLDataElementBinding::Wrap)
}
}
impl HTMLDataElement { impl HTMLDataElement {
pub fn Value(&self) -> DOMString { pub fn Value(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLDataListElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLDataListElementTypeId;
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLDataListElement { pub struct HTMLDataListElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLDataListElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDataListElement {
HTMLDataListElement {
htmlelement: HTMLElement::new_inherited(HTMLDataListElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLDataListElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLDataListElementBinding::Wrap)
}
}
impl HTMLDataListElement { impl HTMLDataListElement {
pub fn Options(&self) -> @mut HTMLCollection { pub fn Options(&self) -> @mut HTMLCollection {
let window = self.htmlelement.element.node.owner_doc().document().window; let window = self.htmlelement.element.node.owner_doc().document().window;

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLDirectoryElementBinding;
use dom::bindings::utils::ErrorResult; use dom::bindings::utils::ErrorResult;
use dom::document::AbstractDocument;
use dom::element::HTMLDirectoryElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLDirectoryElement { pub struct HTMLDirectoryElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLDirectoryElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDirectoryElement {
HTMLDirectoryElement {
htmlelement: HTMLElement::new_inherited(HTMLDirectoryElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLDirectoryElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLDirectoryElementBinding::Wrap)
}
}
impl HTMLDirectoryElement { impl HTMLDirectoryElement {
pub fn Compact(&self) -> bool { pub fn Compact(&self) -> bool {
false false

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLDivElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLDivElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLDivElement { pub struct HTMLDivElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLDivElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDivElement {
HTMLDivElement {
htmlelement: HTMLElement::new_inherited(HTMLDivElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLDivElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLDivElementBinding::Wrap)
}
}
impl HTMLDivElement { impl HTMLDivElement {
pub fn Align(&self) -> DOMString { pub fn Align(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLDListElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLDListElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLDListElement { pub struct HTMLDListElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLDListElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLDListElement {
HTMLDListElement {
htmlelement: HTMLElement::new_inherited(HTMLDListElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLDListElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLDListElementBinding::Wrap)
}
}
impl HTMLDListElement { impl HTMLDListElement {
pub fn Compact(&self) -> bool { pub fn Compact(&self) -> bool {
false false

View file

@ -2,10 +2,11 @@
* 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::codegen::HTMLElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::document::AbstractDocument; use dom::document::AbstractDocument;
use dom::element::{Element, ElementTypeId}; use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use js::jsapi::{JSContext, JSVal}; use js::jsapi::{JSContext, JSVal};
use js::JSVAL_NULL; use js::JSVAL_NULL;
@ -14,11 +15,16 @@ pub struct HTMLElement {
} }
impl HTMLElement { impl HTMLElement {
pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLElement {
HTMLElement { HTMLElement {
element: Element::new(type_id, tag_name, document) element: Element::new(type_id, tag_name, document)
} }
} }
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLElement::new_inherited(HTMLElementTypeId, localName, document);
Node::reflect_node(@mut element, document, HTMLElementBinding::Wrap)
}
} }
impl HTMLElement { impl HTMLElement {

View file

@ -2,14 +2,30 @@
* 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::codegen::HTMLEmbedElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument; use dom::document::AbstractDocument;
use dom::element::HTMLEmbedElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLEmbedElement { pub struct HTMLEmbedElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLEmbedElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLEmbedElement {
HTMLEmbedElement {
htmlelement: HTMLElement::new_inherited(HTMLEmbedElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLEmbedElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLEmbedElementBinding::Wrap)
}
}
impl HTMLEmbedElement { impl HTMLEmbedElement {
pub fn Src(&self) -> DOMString { pub fn Src(&self) -> DOMString {
None None

View file

@ -2,16 +2,32 @@
* 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::codegen::HTMLFieldSetElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFieldSetElementTypeId;
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
pub struct HTMLFieldSetElement { pub struct HTMLFieldSetElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFieldSetElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFieldSetElement {
HTMLFieldSetElement {
htmlelement: HTMLElement::new_inherited(HTMLFieldSetElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFieldSetElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFieldSetElementBinding::Wrap)
}
}
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
pub fn Disabled(&self) -> bool { pub fn Disabled(&self) -> bool {
false false

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLFontElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFontElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLFontElement { pub struct HTMLFontElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFontElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFontElement {
HTMLFontElement {
htmlelement: HTMLElement::new_inherited(HTMLFontElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFontElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFontElementBinding::Wrap)
}
}
impl HTMLFontElement { impl HTMLFontElement {
pub fn Color(&self) -> DOMString { pub fn Color(&self) -> DOMString {
None None

View file

@ -2,15 +2,31 @@
* 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::codegen::HTMLFormElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFormElementTypeId;
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLFormElement { pub struct HTMLFormElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFormElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFormElement {
HTMLFormElement {
htmlelement: HTMLElement::new_inherited(HTMLFormElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFormElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFormElementBinding::Wrap)
}
}
impl HTMLFormElement { impl HTMLFormElement {
pub fn AcceptCharset(&self) -> DOMString { pub fn AcceptCharset(&self) -> DOMString {
None None

View file

@ -2,15 +2,31 @@
* 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::codegen::HTMLFrameElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument; use dom::document::AbstractDocument;
use dom::element::HTMLFrameElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
use dom::windowproxy::WindowProxy; use dom::windowproxy::WindowProxy;
pub struct HTMLFrameElement { pub struct HTMLFrameElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFrameElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameElement {
HTMLFrameElement {
htmlelement: HTMLElement::new_inherited(HTMLFrameElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFrameElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFrameElementBinding::Wrap)
}
}
impl HTMLFrameElement { impl HTMLFrameElement {
pub fn Name(&self) -> DOMString { pub fn Name(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLFrameSetElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLFrameSetElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLFrameSetElement { pub struct HTMLFrameSetElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLFrameSetElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLFrameSetElement {
HTMLFrameSetElement {
htmlelement: HTMLElement::new_inherited(HTMLFrameSetElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLFrameSetElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLFrameSetElementBinding::Wrap)
}
}
impl HTMLFrameSetElement { impl HTMLFrameSetElement {
pub fn Cols(&self) -> DOMString { pub fn Cols(&self) -> DOMString {
None None

View file

@ -2,8 +2,25 @@
* 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::codegen::HTMLHeadElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLHeadElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLHeadElement { pub struct HTMLHeadElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLHeadElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHeadElement {
HTMLHeadElement {
htmlelement: HTMLElement::new_inherited(HTMLHeadElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLHeadElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLHeadElementBinding::Wrap)
}
}

View file

@ -26,7 +26,7 @@ pub struct HTMLHeadingElement {
impl HTMLHeadingElement { impl HTMLHeadingElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> HTMLHeadingElement { pub fn new_inherited(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> HTMLHeadingElement {
HTMLHeadingElement { HTMLHeadingElement {
htmlelement: HTMLElement::new(HTMLHeadingElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLHeadingElementTypeId, localName, document),
level: level, level: level,
} }
} }

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLHRElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLHRElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLHRElement { pub struct HTMLHRElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLHRElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHRElement {
HTMLHRElement {
htmlelement: HTMLElement::new_inherited(HTMLHRElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLHRElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLHRElementBinding::Wrap)
}
}
impl HTMLHRElement { impl HTMLHRElement {
pub fn Align(&self) -> DOMString { pub fn Align(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLHtmlElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLHtmlElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLHtmlElement { pub struct HTMLHtmlElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLHtmlElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLHtmlElement {
HTMLHtmlElement {
htmlelement: HTMLElement::new_inherited(HTMLHtmlElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLHtmlElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLHtmlElementBinding::Wrap)
}
}
impl HTMLHtmlElement { impl HTMLHtmlElement {
pub fn Version(&self) -> DOMString { pub fn Version(&self) -> DOMString {
None None

View file

@ -63,7 +63,7 @@ impl HTMLIFrameElement {
impl HTMLIFrameElement { impl HTMLIFrameElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLIFrameElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
htmlelement: HTMLElement::new(HTMLIframeElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLIframeElementTypeId, localName, document),
frame: None, frame: None,
size: None, size: None,
sandbox: None, sandbox: None,

View file

@ -24,7 +24,7 @@ pub struct HTMLImageElement {
impl HTMLImageElement { impl HTMLImageElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLImageElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new(HTMLImageElementTypeId, localName, document), htmlelement: HTMLElement::new_inherited(HTMLImageElementTypeId, localName, document),
image: None, image: None,
} }
} }

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLInputElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, Fallible}; use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::document::AbstractDocument;
use dom::element::HTMLInputElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLInputElement { pub struct HTMLInputElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLInputElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLInputElement {
HTMLInputElement {
htmlelement: HTMLElement::new_inherited(HTMLInputElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLInputElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLInputElementBinding::Wrap)
}
}
impl HTMLInputElement { impl HTMLInputElement {
pub fn Accept(&self) -> DOMString { pub fn Accept(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLLabelElementBinding;
use dom::bindings::utils::DOMString; use dom::bindings::utils::DOMString;
use dom::document::AbstractDocument;
use dom::element::HTMLLabelElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLLabelElement { pub struct HTMLLabelElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLLabelElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLabelElement {
HTMLLabelElement {
htmlelement: HTMLElement::new_inherited(HTMLLabelElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLLabelElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLLabelElementBinding::Wrap)
}
}
impl HTMLLabelElement { impl HTMLLabelElement {
pub fn HtmlFor(&self) -> DOMString { pub fn HtmlFor(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLLegendElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLLegendElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLLegendElement { pub struct HTMLLegendElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLLegendElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLegendElement {
HTMLLegendElement {
htmlelement: HTMLElement::new_inherited(HTMLLegendElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLLegendElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLLegendElementBinding::Wrap)
}
}
impl HTMLLegendElement { impl HTMLLegendElement {
pub fn Align(&self) -> DOMString { pub fn Align(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLLIElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLLIElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLLIElement { pub struct HTMLLIElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLLIElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLIElement {
HTMLLIElement {
htmlelement: HTMLElement::new_inherited(HTMLLIElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLLIElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLLIElementBinding::Wrap)
}
}
impl HTMLLIElement { impl HTMLLIElement {
pub fn Value(&self) -> i32 { pub fn Value(&self) -> i32 {
0 0

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLLinkElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLLinkElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLLinkElement { pub struct HTMLLinkElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLLinkElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLLinkElement {
HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(HTMLLinkElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLLinkElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLLinkElementBinding::Wrap)
}
}
impl HTMLLinkElement { impl HTMLLinkElement {
pub fn Disabled(&self) -> bool { pub fn Disabled(&self) -> bool {
false false

View file

@ -2,8 +2,25 @@
* 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::codegen::HTMLMainElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLMainElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLMainElement { pub struct HTMLMainElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLMainElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMainElement {
HTMLMainElement {
htmlelement: HTMLElement::new_inherited(HTMLMainElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLMainElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLMainElementBinding::Wrap)
}
}

View file

@ -2,14 +2,31 @@
* 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::codegen::HTMLMapElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::htmlcollection::HTMLCollection; use dom::htmlcollection::HTMLCollection;
use dom::document::AbstractDocument;
use dom::element::HTMLMapElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLMapElement { pub struct HTMLMapElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLMapElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMapElement {
HTMLMapElement {
htmlelement: HTMLElement::new_inherited(HTMLMapElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLMapElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLMapElementBinding::Wrap)
}
}
impl HTMLMapElement { impl HTMLMapElement {
pub fn Name(&self) -> DOMString { pub fn Name(&self) -> DOMString {
None None

View file

@ -14,7 +14,7 @@ pub struct HTMLMediaElement {
impl HTMLMediaElement { impl HTMLMediaElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement {
HTMLMediaElement { HTMLMediaElement {
htmlelement: HTMLElement::new(type_id, tag_name, document) htmlelement: HTMLElement::new_inherited(type_id, tag_name, document)
} }
} }
} }

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLMetaElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLMetaElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLMetaElement { pub struct HTMLMetaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLMetaElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMetaElement {
HTMLMetaElement {
htmlelement: HTMLElement::new_inherited(HTMLMetaElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLMetaElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLMetaElementBinding::Wrap)
}
}
impl HTMLMetaElement { impl HTMLMetaElement {
pub fn Name(&self) -> DOMString { pub fn Name(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLMeterElementBinding;
use dom::bindings::utils::ErrorResult; use dom::bindings::utils::ErrorResult;
use dom::document::AbstractDocument;
use dom::element::HTMLMeterElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLMeterElement { pub struct HTMLMeterElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLMeterElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLMeterElement {
HTMLMeterElement {
htmlelement: HTMLElement::new_inherited(HTMLMeterElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLMeterElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLMeterElementBinding::Wrap)
}
}
impl HTMLMeterElement { impl HTMLMeterElement {
pub fn Value(&self) -> f64 { pub fn Value(&self) -> f64 {
0.0 0.0

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLModElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLModElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLModElement { pub struct HTMLModElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLModElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLModElement {
HTMLModElement {
htmlelement: HTMLElement::new_inherited(HTMLModElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLModElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLModElementBinding::Wrap)
}
}
impl HTMLModElement { impl HTMLModElement {
pub fn Cite(&self) -> DOMString { pub fn Cite(&self) -> DOMString {
None None

View file

@ -2,10 +2,12 @@
* 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::codegen::HTMLObjectElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument; use dom::document::AbstractDocument;
use dom::element::HTMLObjectElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
use dom::windowproxy::WindowProxy; use dom::windowproxy::WindowProxy;
@ -13,6 +15,19 @@ pub struct HTMLObjectElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLObjectElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLObjectElement {
HTMLObjectElement {
htmlelement: HTMLElement::new_inherited(HTMLObjectElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLObjectElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLObjectElementBinding::Wrap)
}
}
impl HTMLObjectElement { impl HTMLObjectElement {
pub fn Data(&self) -> DOMString { pub fn Data(&self) -> DOMString {
None None

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLOListElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLOListElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLOListElement { pub struct HTMLOListElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
} }
impl HTMLOListElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOListElement {
HTMLOListElement {
htmlelement: HTMLElement::new_inherited(HTMLOListElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLOListElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLOListElementBinding::Wrap)
}
}
impl HTMLOListElement { impl HTMLOListElement {
pub fn Reversed(&self) -> bool { pub fn Reversed(&self) -> bool {
false false

View file

@ -2,13 +2,30 @@
* 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::codegen::HTMLOptGroupElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLOptGroupElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLOptGroupElement { pub struct HTMLOptGroupElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLOptGroupElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptGroupElement {
HTMLOptGroupElement {
htmlelement: HTMLElement::new_inherited(HTMLOptGroupElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLOptGroupElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLOptGroupElementBinding::Wrap)
}
}
impl HTMLOptGroupElement { impl HTMLOptGroupElement {
pub fn Disabled(&self) -> bool { pub fn Disabled(&self) -> bool {
false false

View file

@ -2,14 +2,30 @@
* 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::codegen::HTMLOptionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLOptionElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLOptionElement { pub struct HTMLOptionElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLOptionElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptionElement {
HTMLOptionElement {
htmlelement: HTMLElement::new_inherited(HTMLOptionElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLOptionElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLOptionElementBinding::Wrap)
}
}
impl HTMLOptionElement { impl HTMLOptionElement {
pub fn Disabled(&self) -> bool { pub fn Disabled(&self) -> bool {
false false

View file

@ -2,15 +2,31 @@
* 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::codegen::HTMLOutputElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLOutputElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView}; use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
pub struct HTMLOutputElement { pub struct HTMLOutputElement {
htmlelement: HTMLElement htmlelement: HTMLElement
} }
impl HTMLOutputElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOutputElement {
HTMLOutputElement {
htmlelement: HTMLElement::new_inherited(HTMLOutputElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLOutputElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLOutputElementBinding::Wrap)
}
}
impl HTMLOutputElement { impl HTMLOutputElement {
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> { pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
None None

View file

@ -16,7 +16,7 @@ pub struct HTMLParagraphElement {
impl HTMLParagraphElement { impl HTMLParagraphElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParagraphElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParagraphElement {
HTMLParagraphElement { HTMLParagraphElement {
htmlelement: HTMLElement::new(HTMLParagraphElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLParagraphElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLParamElement {
impl HTMLParamElement { impl HTMLParamElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParamElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParamElement {
HTMLParamElement { HTMLParamElement {
htmlelement: HTMLElement::new(HTMLParamElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLParamElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLPreElement {
impl HTMLPreElement { impl HTMLPreElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLPreElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLPreElement {
HTMLPreElement { HTMLPreElement {
htmlelement: HTMLElement::new(HTMLPreElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLPreElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLProgressElement {
impl HTMLProgressElement { impl HTMLProgressElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLProgressElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLProgressElement {
HTMLProgressElement { HTMLProgressElement {
htmlelement: HTMLElement::new(HTMLProgressElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLProgressElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLQuoteElement {
impl HTMLQuoteElement { impl HTMLQuoteElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLQuoteElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLQuoteElement {
HTMLQuoteElement { HTMLQuoteElement {
htmlelement: HTMLElement::new(HTMLQuoteElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLQuoteElementTypeId, localName, document)
} }
} }

View file

@ -17,7 +17,7 @@ pub struct HTMLScriptElement {
impl HTMLScriptElement { impl HTMLScriptElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLScriptElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: HTMLElement::new(HTMLScriptElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, document)
} }
} }

View file

@ -17,7 +17,7 @@ pub struct HTMLSelectElement {
impl HTMLSelectElement { impl HTMLSelectElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSelectElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSelectElement {
HTMLSelectElement { HTMLSelectElement {
htmlelement: HTMLElement::new(HTMLSelectElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSelectElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLSourceElement {
impl HTMLSourceElement { impl HTMLSourceElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSourceElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSourceElement {
HTMLSourceElement { HTMLSourceElement {
htmlelement: HTMLElement::new(HTMLSourceElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSourceElementTypeId, localName, document)
} }
} }

View file

@ -15,7 +15,7 @@ pub struct HTMLSpanElement {
impl HTMLSpanElement { impl HTMLSpanElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSpanElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSpanElement {
HTMLSpanElement { HTMLSpanElement {
htmlelement: HTMLElement::new(HTMLSpanElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLSpanElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLStyleElement {
impl HTMLStyleElement { impl HTMLStyleElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
htmlelement: HTMLElement::new(HTMLStyleElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLStyleElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTableCaptionElement {
impl HTMLTableCaptionElement { impl HTMLTableCaptionElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableCaptionElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableCaptionElement {
HTMLTableCaptionElement { HTMLTableCaptionElement {
htmlelement: HTMLElement::new(HTMLTableCaptionElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableCaptionElementTypeId, localName, document)
} }
} }

View file

@ -14,7 +14,7 @@ pub struct HTMLTableCellElement {
impl HTMLTableCellElement { impl HTMLTableCellElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement {
HTMLTableCellElement { HTMLTableCellElement {
htmlelement: HTMLElement::new(type_id, tag_name, document) htmlelement: HTMLElement::new_inherited(type_id, tag_name, document)
} }
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTableColElement {
impl HTMLTableColElement { impl HTMLTableColElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableColElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableColElement {
HTMLTableColElement { HTMLTableColElement {
htmlelement: HTMLElement::new(HTMLTableColElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableColElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTableElement {
impl HTMLTableElement { impl HTMLTableElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableElement {
HTMLTableElement { HTMLTableElement {
htmlelement: HTMLElement::new(HTMLTableElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTableRowElement {
impl HTMLTableRowElement { impl HTMLTableRowElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableRowElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableRowElement {
HTMLTableRowElement { HTMLTableRowElement {
htmlelement: HTMLElement::new(HTMLTableRowElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableRowElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTableSectionElement {
impl HTMLTableSectionElement { impl HTMLTableSectionElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableSectionElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableSectionElement {
HTMLTableSectionElement { HTMLTableSectionElement {
htmlelement: HTMLElement::new(HTMLTableSectionElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTableSectionElementTypeId, localName, document)
} }
} }

View file

@ -15,7 +15,7 @@ pub struct HTMLTemplateElement {
impl HTMLTemplateElement { impl HTMLTemplateElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTemplateElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTemplateElement {
HTMLTemplateElement { HTMLTemplateElement {
htmlelement: HTMLElement::new(HTMLTemplateElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTemplateElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTextAreaElement {
impl HTMLTextAreaElement { impl HTMLTextAreaElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTextAreaElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTextAreaElement {
HTMLTextAreaElement { HTMLTextAreaElement {
htmlelement: HTMLElement::new(HTMLTextAreaElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTextAreaElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTimeElement {
impl HTMLTimeElement { impl HTMLTimeElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTimeElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTimeElement {
HTMLTimeElement { HTMLTimeElement {
htmlelement: HTMLElement::new(HTMLTimeElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTimeElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTitleElement {
impl HTMLTitleElement { impl HTMLTitleElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTitleElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTitleElement {
HTMLTitleElement { HTMLTitleElement {
htmlelement: HTMLElement::new(HTMLTitleElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTitleElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLTrackElement {
impl HTMLTrackElement { impl HTMLTrackElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTrackElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTrackElement {
HTMLTrackElement { HTMLTrackElement {
htmlelement: HTMLElement::new(HTMLTrackElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLTrackElementTypeId, localName, document)
} }
} }

View file

@ -16,7 +16,7 @@ pub struct HTMLUListElement {
impl HTMLUListElement { impl HTMLUListElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUListElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUListElement {
HTMLUListElement { HTMLUListElement {
htmlelement: HTMLElement::new(HTMLUListElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLUListElementTypeId, localName, document)
} }
} }

View file

@ -15,7 +15,7 @@ pub struct HTMLUnknownElement {
impl HTMLUnknownElement { impl HTMLUnknownElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUnknownElement { pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUnknownElement {
HTMLUnknownElement { HTMLUnknownElement {
htmlelement: HTMLElement::new(HTMLUnknownElementTypeId, localName, document) htmlelement: HTMLElement::new_inherited(HTMLUnknownElementTypeId, localName, document)
} }
} }

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::document::AbstractDocument; use dom::document::AbstractDocument;
use dom::element::*; use dom::element::{HTMLLinkElementTypeId, HTMLIframeElementTypeId, HTMLImageElementTypeId};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6}; use dom::htmlheadingelement::{Heading1, Heading2, Heading3, Heading4, Heading5, Heading6};
use dom::htmliframeelement::IFrameSize; use dom::htmliframeelement::IFrameSize;
@ -33,58 +33,13 @@ use extra::url::Url;
use geom::size::Size2D; use geom::size::Size2D;
macro_rules! handle_element( macro_rules! handle_element(
($cx: expr,
$document: expr,
$tag: expr,
$string: expr,
$type_id: expr,
$ctor: ident,
[ $(($field:ident : $field_init:expr)),* ]) => (
handle_element_base!(htmlelement, HTMLElement,
$cx, $document, $tag, $string, $type_id, $ctor,
[$(($field:$field_init)),*]);
)
)
macro_rules! handle_htmlelement(
($cx: expr,
$document: expr,
$tag: expr,
$string: expr,
$type_id: expr,
$ctor: ident) => (
handle_element_base!(element, Element,
$cx, $document, $tag, $string, $type_id, $ctor, []);
)
)
macro_rules! handle_newable_element(
($document: expr, ($document: expr,
$localName: expr, $localName: expr,
$string: expr, $string: expr,
$ctor: ident $ctor: ident
$(, $arg:expr )*) => ( $(, $arg:expr )*) => (
if eq_slice($localName, $string) { if eq_slice($localName, $string) {
return $ctor::new(($localName).to_str(), $document $(, $arg)*); return $ctor::new($localName, $document $(, $arg)*);
}
)
)
macro_rules! handle_element_base(
($parent: ident,
$parent_init: ident,
$cx: expr,
$document: expr,
$tag: expr,
$string: expr,
$type_id: expr,
$ctor: ident,
[ $(($field:ident : $field_init:expr)),* ]) => (
if eq_slice($tag, $string) {
let _element = @$ctor {
$parent: $parent_init::new($type_id, ($tag).to_str(), $document),
$(
$field: $field_init,
)*
};
return unsafe { Node::as_abstract_node($cx, _element) };
} }
) )
) )
@ -207,88 +162,87 @@ fn js_script_listener(to_parent: SharedChan<HtmlDiscoveryMessage>,
// Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized // Silly macros to handle constructing DOM nodes. This produces bad code and should be optimized
// via atomization (issue #85). // via atomization (issue #85).
pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocument) -> AbstractNode<ScriptView> { pub fn build_element_from_tag(tag: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
// TODO (Issue #85): use atoms // TODO (Issue #85): use atoms
handle_element!(cx, document, tag, "a", HTMLAnchorElementTypeId, HTMLAnchorElement, []); handle_element!(document, tag, "a", HTMLAnchorElement);
handle_element!(cx, document, tag, "applet", HTMLAppletElementTypeId, HTMLAppletElement, []); handle_element!(document, tag, "applet", HTMLAppletElement);
handle_element!(cx, document, tag, "area", HTMLAreaElementTypeId, HTMLAreaElement, []); handle_element!(document, tag, "area", HTMLAreaElement);
handle_element!(cx, document, tag, "base", HTMLBaseElementTypeId, HTMLBaseElement, []); handle_element!(document, tag, "aside", HTMLElement);
handle_element!(cx, document, tag, "br", HTMLBRElementTypeId, HTMLBRElement, []); handle_element!(document, tag, "audio", HTMLAudioElement);
handle_element!(cx, document, tag, "body", HTMLBodyElementTypeId, HTMLBodyElement, []); handle_element!(document, tag, "b", HTMLElement);
handle_element!(cx, document, tag, "button", HTMLButtonElementTypeId, HTMLButtonElement, []); handle_element!(document, tag, "base", HTMLBaseElement);
handle_element!(cx, document, tag, "canvas", HTMLCanvasElementTypeId, HTMLCanvasElement, []); handle_element!(document, tag, "body", HTMLBodyElement);
handle_element!(cx, document, tag, "data", HTMLDataElementTypeId, HTMLDataElement, []); handle_element!(document, tag, "br", HTMLBRElement);
handle_element!(cx, document, tag, "datalist",HTMLDataListElementTypeId, HTMLDataListElement, []); handle_element!(document, tag, "button", HTMLButtonElement);
handle_element!(cx, document, tag, "dir", HTMLDirectoryElementTypeId, HTMLDirectoryElement, []); handle_element!(document, tag, "canvas", HTMLCanvasElement);
handle_element!(cx, document, tag, "div", HTMLDivElementTypeId, HTMLDivElement, []); handle_element!(document, tag, "caption", HTMLTableCaptionElement);
handle_element!(cx, document, tag, "dl", HTMLDListElementTypeId, HTMLDListElement, []); handle_element!(document, tag, "col", HTMLTableColElement);
handle_element!(cx, document, tag, "embed", HTMLEmbedElementTypeId, HTMLEmbedElement, []); handle_element!(document, tag, "colgroup", HTMLTableColElement);
handle_element!(cx, document, tag, "fieldset",HTMLFieldSetElementTypeId, HTMLFieldSetElement, []); handle_element!(document, tag, "data", HTMLDataElement);
handle_element!(cx, document, tag, "font", HTMLFontElementTypeId, HTMLFontElement, []); handle_element!(document, tag, "datalist", HTMLDataListElement);
handle_element!(cx, document, tag, "form", HTMLFormElementTypeId, HTMLFormElement, []); handle_element!(document, tag, "del", HTMLModElement);
handle_element!(cx, document, tag, "frame", HTMLFrameElementTypeId, HTMLFrameElement, []); handle_element!(document, tag, "dir", HTMLDirectoryElement);
handle_element!(cx, document, tag, "frameset",HTMLFrameSetElementTypeId, HTMLFrameSetElement, []); handle_element!(document, tag, "div", HTMLDivElement);
handle_element!(cx, document, tag, "hr", HTMLHRElementTypeId, HTMLHRElement, []); handle_element!(document, tag, "dl", HTMLDListElement);
handle_element!(cx, document, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []); handle_element!(document, tag, "embed", HTMLEmbedElement);
handle_element!(cx, document, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []); handle_element!(document, tag, "fieldset", HTMLFieldSetElement);
handle_element!(cx, document, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []); handle_element!(document, tag, "font", HTMLFontElement);
handle_element!(cx, document, tag, "label", HTMLLabelElementTypeId, HTMLLabelElement, []); handle_element!(document, tag, "form", HTMLFormElement);
handle_element!(cx, document, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []); handle_element!(document, tag, "frame", HTMLFrameElement);
handle_element!(cx, document, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []); handle_element!(document, tag, "frameset", HTMLFrameSetElement);
handle_element!(cx, document, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); handle_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
handle_element!(cx, document, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); handle_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
handle_element!(cx, document, tag, "main", HTMLMainElementTypeId, HTMLMainElement, []); handle_element!(document, tag, "h3", HTMLHeadingElement, Heading3);
handle_element!(cx, document, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); handle_element!(document, tag, "h4", HTMLHeadingElement, Heading4);
handle_element!(cx, document, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []); handle_element!(document, tag, "h5", HTMLHeadingElement, Heading5);
handle_element!(cx, document, tag, "mod", HTMLModElementTypeId, HTMLModElement, []); handle_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
handle_element!(cx, document, tag, "object", HTMLObjectElementTypeId, HTMLObjectElement, []); handle_element!(document, tag, "head", HTMLHeadElement);
handle_element!(cx, document, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); handle_element!(document, tag, "hr", HTMLHRElement);
handle_element!(cx, document, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []); handle_element!(document, tag, "html", HTMLHtmlElement);
handle_element!(cx, document, tag, "optgroup",HTMLOptGroupElementTypeId, HTMLOptGroupElement, []); handle_element!(document, tag, "i", HTMLElement);
handle_element!(cx, document, tag, "output", HTMLOutputElementTypeId, HTMLOutputElement, []); handle_element!(document, tag, "iframe", HTMLIFrameElement);
handle_element!(document, tag, "img", HTMLImageElement);
handle_element!(document, tag, "input", HTMLInputElement);
handle_element!(document, tag, "ins", HTMLModElement);
handle_element!(document, tag, "label", HTMLLabelElement);
handle_element!(document, tag, "legend", HTMLLegendElement);
handle_element!(document, tag, "li", HTMLLIElement);
handle_element!(document, tag, "link", HTMLLinkElement);
handle_element!(document, tag, "main", HTMLMainElement);
handle_element!(document, tag, "map", HTMLMapElement);
handle_element!(document, tag, "meta", HTMLMetaElement);
handle_element!(document, tag, "meter", HTMLMeterElement);
handle_element!(document, tag, "object", HTMLObjectElement);
handle_element!(document, tag, "ol", HTMLOListElement);
handle_element!(document, tag, "optgroup", HTMLOptGroupElement);
handle_element!(document, tag, "option", HTMLOptionElement);
handle_element!(document, tag, "output", HTMLOutputElement);
handle_element!(document, tag, "p", HTMLParagraphElement);
handle_element!(document, tag, "param", HTMLParamElement);
handle_element!(document, tag, "pre", HTMLPreElement);
handle_element!(document, tag, "progress", HTMLProgressElement);
handle_element!(document, tag, "q", HTMLQuoteElement);
handle_element!(document, tag, "script", HTMLScriptElement);
handle_element!(document, tag, "section", HTMLElement);
handle_element!(document, tag, "select", HTMLSelectElement);
handle_element!(document, tag, "small", HTMLElement);
handle_element!(document, tag, "source", HTMLSourceElement);
handle_element!(document, tag, "span", HTMLSpanElement);
handle_element!(document, tag, "style", HTMLStyleElement);
handle_element!(document, tag, "table", HTMLTableElement);
handle_element!(document, tag, "tbody", HTMLTableSectionElement);
handle_element!(document, tag, "td", HTMLTableDataCellElement);
handle_element!(document, tag, "template", HTMLTemplateElement);
handle_element!(document, tag, "textarea", HTMLTextAreaElement);
handle_element!(document, tag, "th", HTMLTableHeaderCellElement);
handle_element!(document, tag, "time", HTMLTimeElement);
handle_element!(document, tag, "title", HTMLTitleElement);
handle_element!(document, tag, "tr", HTMLTableRowElement);
handle_element!(document, tag, "track", HTMLTrackElement);
handle_element!(document, tag, "ul", HTMLUListElement);
handle_element!(document, tag, "video", HTMLVideoElement);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); return HTMLUnknownElement::new(tag, document);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "i", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "section", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement);
handle_newable_element!(document, tag, "audio", HTMLAudioElement);
handle_newable_element!(document, tag, "caption", HTMLTableCaptionElement);
handle_newable_element!(document, tag, "col", HTMLTableColElement);
handle_newable_element!(document, tag, "colgroup", HTMLTableColElement);
handle_newable_element!(document, tag, "h1", HTMLHeadingElement, Heading1);
handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3);
handle_newable_element!(document, tag, "h4", HTMLHeadingElement, Heading4);
handle_newable_element!(document, tag, "h5", HTMLHeadingElement, Heading5);
handle_newable_element!(document, tag, "h6", HTMLHeadingElement, Heading6);
handle_newable_element!(document, tag, "iframe", HTMLIFrameElement);
handle_newable_element!(document, tag, "img", HTMLImageElement);
handle_newable_element!(document, tag, "p", HTMLParagraphElement);
handle_newable_element!(document, tag, "param", HTMLParamElement);
handle_newable_element!(document, tag, "pre", HTMLPreElement);
handle_newable_element!(document, tag, "progress", HTMLProgressElement);
handle_newable_element!(document, tag, "q", HTMLQuoteElement);
handle_newable_element!(document, tag, "script", HTMLScriptElement);
handle_newable_element!(document, tag, "select", HTMLSelectElement);
handle_newable_element!(document, tag, "source", HTMLSourceElement);
handle_newable_element!(document, tag, "span", HTMLSpanElement);
handle_newable_element!(document, tag, "style", HTMLStyleElement);
handle_newable_element!(document, tag, "table", HTMLTableElement);
handle_newable_element!(document, tag, "tbody", HTMLTableSectionElement);
handle_newable_element!(document, tag, "td", HTMLTableDataCellElement);
handle_newable_element!(document, tag, "template", HTMLTemplateElement);
handle_newable_element!(document, tag, "textarea", HTMLTextAreaElement);
handle_newable_element!(document, tag, "th", HTMLTableHeaderCellElement);
handle_newable_element!(document, tag, "time", HTMLTimeElement);
handle_newable_element!(document, tag, "title", HTMLTitleElement);
handle_newable_element!(document, tag, "tr", HTMLTableRowElement);
handle_newable_element!(document, tag, "track", HTMLTrackElement);
handle_newable_element!(document, tag, "ul", HTMLUListElement);
handle_newable_element!(document, tag, "video", HTMLVideoElement);
return HTMLUnknownElement::new(tag.to_str(), document);
} }
pub fn parse_html(cx: *JSContext, pub fn parse_html(cx: *JSContext,
@ -346,8 +300,7 @@ pub fn parse_html(cx: *JSContext,
} }
// Build the root node. // Build the root node.
let root = @HTMLHtmlElement { htmlelement: HTMLElement::new(HTMLHtmlElementTypeId, ~"html", document) }; let root = HTMLHtmlElement::new(~"html", document);
let root = unsafe { Node::as_abstract_node(cx, root) };
debug!("created new node"); debug!("created new node");
let mut parser = hubbub::Parser("UTF-8", false); let mut parser = hubbub::Parser("UTF-8", false);
debug!("created parser"); debug!("created parser");
@ -383,7 +336,7 @@ pub fn parse_html(cx: *JSContext,
}, },
create_element: |tag: ~hubbub::Tag| { create_element: |tag: ~hubbub::Tag| {
debug!("create element"); debug!("create element");
let node = build_element_from_tag(cx, tag.name, document); let node = build_element_from_tag(tag.name.clone(), document);
debug!("-- attach attrs"); debug!("-- attach attrs");
do node.as_mut_element |element| { do node.as_mut_element |element| {