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

This commit is contained in:
bors-servo 2013-10-31 13:55:29 -07:00
commit 041f3a8b06
31 changed files with 517 additions and 62 deletions

View file

@ -2,11 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLAudioElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLAudioElementTypeId;
use dom::htmlmediaelement::HTMLMediaElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLAudioElement {
htmlmediaelement: HTMLMediaElement
}
impl HTMLAudioElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLAudioElement {
HTMLAudioElement {
htmlmediaelement: HTMLMediaElement::new_inherited(HTMLAudioElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLAudioElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLAudioElementBinding::Wrap)
}
}

View file

@ -2,8 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLHeadingElementBinding;
use dom::bindings::utils::DOMString;
use dom::document::AbstractDocument;
use dom::element::HTMLHeadingElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub enum HeadingLevel {
Heading1,
@ -19,6 +23,20 @@ pub struct HTMLHeadingElement {
level: HeadingLevel,
}
impl HTMLHeadingElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> HTMLHeadingElement {
HTMLHeadingElement {
htmlelement: HTMLElement::new(HTMLHeadingElementTypeId, localName, document),
level: level,
}
}
pub fn new(localName: ~str, document: AbstractDocument, level: HeadingLevel) -> AbstractNode<ScriptView> {
let element = HTMLHeadingElement::new_inherited(localName, document, level);
Node::reflect_node(@mut element, document, HTMLHeadingElementBinding::Wrap)
}
}
impl HTMLHeadingElement {
pub fn Align(&self) -> DOMString {
None

View file

@ -2,10 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLIFrameElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
use dom::document::AbstractDocument;
use dom::element::HTMLIframeElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
use dom::node::{AbstractNode, Node, ScriptView};
use dom::windowproxy::WindowProxy;
use geom::size::Size2D;
use geom::rect::Rect;
@ -58,6 +60,22 @@ impl HTMLIFrameElement {
}
}
impl HTMLIFrameElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLIFrameElement {
HTMLIFrameElement {
htmlelement: HTMLElement::new(HTMLIframeElementTypeId, localName, document),
frame: None,
size: None,
sandbox: None,
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLIFrameElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLIFrameElementBinding::Wrap)
}
}
impl HTMLIFrameElement {
pub fn Src(&self) -> DOMString {
None

View file

@ -2,9 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLImageElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
use dom::document::AbstractDocument;
use dom::element::HTMLImageElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{ScriptView, AbstractNode};
use dom::node::{AbstractNode, Node, ScriptView};
use extra::url::Url;
use servo_util::geometry::to_px;
use layout_interface::{ContentBoxQuery, ContentBoxResponse};
@ -18,6 +21,20 @@ pub struct HTMLImageElement {
image: Option<Url>,
}
impl HTMLImageElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLImageElement {
HTMLImageElement {
htmlelement: HTMLElement::new(HTMLImageElementTypeId, localName, document),
image: None,
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLImageElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLImageElementBinding::Wrap)
}
}
impl HTMLImageElement {
/// Makes the local `image` member match the status of the `src` attribute and starts
/// prefetching the image. This method must be called after `src` is changed.

View file

@ -12,7 +12,7 @@ pub struct HTMLMediaElement {
}
impl HTMLMediaElement {
pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLMediaElement {
HTMLMediaElement {
htmlelement: HTMLElement::new(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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLParagraphElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLParagraphElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLParagraphElement {
htmlelement: HTMLElement
}
impl HTMLParagraphElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParagraphElement {
HTMLParagraphElement {
htmlelement: HTMLElement::new(HTMLParagraphElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLParagraphElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLParagraphElementBinding::Wrap)
}
}
impl HTMLParagraphElement {
pub fn Align(&self) -> DOMString {
None

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLParamElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLParamElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLParamElement {
htmlelement: HTMLElement
}
impl HTMLParamElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLParamElement {
HTMLParamElement {
htmlelement: HTMLElement::new(HTMLParamElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLParamElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLParamElementBinding::Wrap)
}
}
impl HTMLParamElement {
pub fn Name(&self) -> DOMString {
None

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLPreElementBinding;
use dom::bindings::utils::{ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLPreElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLPreElement {
htmlelement: HTMLElement,
}
impl HTMLPreElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLPreElement {
HTMLPreElement {
htmlelement: HTMLElement::new(HTMLPreElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLPreElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLPreElementBinding::Wrap)
}
}
impl HTMLPreElement {
pub fn Width(&self) -> i32 {
0

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLProgressElementBinding;
use dom::bindings::utils::{ErrorResult, Fallible};
use dom::document::AbstractDocument;
use dom::element::HTMLProgressElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLProgressElement {
htmlelement: HTMLElement,
}
impl HTMLProgressElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLProgressElement {
HTMLProgressElement {
htmlelement: HTMLElement::new(HTMLProgressElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLProgressElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLProgressElementBinding::Wrap)
}
}
impl HTMLProgressElement {
pub fn Value(&self) -> f64 {
0f64

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLQuoteElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLQuoteElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLQuoteElement {
htmlelement: HTMLElement,
}
impl HTMLQuoteElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLQuoteElement {
HTMLQuoteElement {
htmlelement: HTMLElement::new(HTMLQuoteElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLQuoteElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLQuoteElementBinding::Wrap)
}
}
impl HTMLQuoteElement {
pub fn Cite(&self) -> DOMString {
None

View file

@ -2,14 +2,31 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLScriptElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLScriptElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
use servo_util::tree::ElementLike;
pub struct HTMLScriptElement {
htmlelement: HTMLElement,
}
impl HTMLScriptElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLScriptElement {
HTMLScriptElement {
htmlelement: HTMLElement::new(HTMLScriptElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLScriptElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLScriptElementBinding::Wrap)
}
}
impl HTMLScriptElement {
pub fn Src(&self) -> DOMString {
self.htmlelement.element.get_attr("src").map(|s| s.to_str())

View file

@ -2,15 +2,31 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLSelectElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLSelectElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
use dom::node::{AbstractNode, Node, ScriptView};
use dom::validitystate::ValidityState;
pub struct HTMLSelectElement {
htmlelement: HTMLElement
}
impl HTMLSelectElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSelectElement {
HTMLSelectElement {
htmlelement: HTMLElement::new(HTMLSelectElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLSelectElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLSelectElementBinding::Wrap)
}
}
impl HTMLSelectElement {
pub fn Autofocus(&self) -> bool {
false

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLSourceElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLSourceElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLSourceElement {
htmlelement: HTMLElement
}
impl HTMLSourceElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSourceElement {
HTMLSourceElement {
htmlelement: HTMLElement::new(HTMLSourceElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLSourceElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLSourceElementBinding::Wrap)
}
}
impl HTMLSourceElement {
pub fn Src(&self) -> DOMString {
None

View file

@ -2,8 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLSpanElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLSpanElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLSpanElement {
htmlelement: HTMLElement
}
impl HTMLSpanElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLSpanElement {
HTMLSpanElement {
htmlelement: HTMLElement::new(HTMLSpanElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLSpanElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLSpanElementBinding::Wrap)
}
}

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLStyleElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLStyleElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLStyleElement {
htmlelement: HTMLElement,
}
impl HTMLStyleElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLStyleElement {
HTMLStyleElement {
htmlelement: HTMLElement::new(HTMLStyleElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLStyleElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLStyleElementBinding::Wrap)
}
}
impl HTMLStyleElement {
pub fn Disabled(&self) -> bool {
false

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableCaptionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableCaptionElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableCaptionElement {
htmlelement: HTMLElement
}
impl HTMLTableCaptionElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableCaptionElement {
HTMLTableCaptionElement {
htmlelement: HTMLElement::new(HTMLTableCaptionElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableCaptionElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableCaptionElementBinding::Wrap)
}
}
impl HTMLTableCaptionElement {
pub fn Align(&self) -> DOMString {
None

View file

@ -12,7 +12,7 @@ pub struct HTMLTableCellElement {
}
impl HTMLTableCellElement {
pub fn new(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: ~str, document: AbstractDocument) -> HTMLTableCellElement {
HTMLTableCellElement {
htmlelement: HTMLElement::new(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
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableColElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableColElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableColElement {
htmlelement: HTMLElement,
}
impl HTMLTableColElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableColElement {
HTMLTableColElement {
htmlelement: HTMLElement::new(HTMLTableColElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableColElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableColElementBinding::Wrap)
}
}
impl HTMLTableColElement {
pub fn Span(&self) -> u32 {
0

View file

@ -2,8 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableDataCellElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLTableDataCellElementTypeId;
use dom::htmltablecellelement::HTMLTableCellElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableDataCellElement {
htmltablecellelement: HTMLTableCellElement,
}
impl HTMLTableDataCellElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableDataCellElement {
HTMLTableDataCellElement {
htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableDataCellElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableDataCellElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableDataCellElementBinding::Wrap)
}
}

View file

@ -2,15 +2,31 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableElement {
htmlelement: HTMLElement,
}
impl HTMLTableElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableElement {
HTMLTableElement {
htmlelement: HTMLElement::new(HTMLTableElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableElementBinding::Wrap)
}
}
impl HTMLTableElement {
pub fn DeleteCaption(&self) {
}

View file

@ -2,8 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableHeaderCellElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLTableHeaderCellElementTypeId;
use dom::htmltablecellelement::HTMLTableCellElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableHeaderCellElement {
htmltablecellelement: HTMLTableCellElement,
}
impl HTMLTableHeaderCellElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableHeaderCellElement {
HTMLTableHeaderCellElement {
htmltablecellelement: HTMLTableCellElement::new_inherited(HTMLTableHeaderCellElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableHeaderCellElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableHeaderCellElementBinding::Wrap)
}
}

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableRowElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableRowElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableRowElement {
htmlelement: HTMLElement,
}
impl HTMLTableRowElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableRowElement {
HTMLTableRowElement {
htmlelement: HTMLElement::new(HTMLTableRowElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableRowElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableRowElementBinding::Wrap)
}
}
impl HTMLTableRowElement {
pub fn RowIndex(&self) -> i32 {
0

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTableSectionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableSectionElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableSectionElement {
htmlelement: HTMLElement,
}
impl HTMLTableSectionElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTableSectionElement {
HTMLTableSectionElement {
htmlelement: HTMLElement::new(HTMLTableSectionElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTableSectionElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTableSectionElementBinding::Wrap)
}
}
impl HTMLTableSectionElement {
pub fn DeleteRow(&mut self, _index: i32) -> ErrorResult {
Ok(())

View file

@ -2,11 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTemplateElementBinding;
use dom::document::AbstractDocument;
use dom::element::HTMLTemplateElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTemplateElement {
htmlelement: HTMLElement,
}
impl HTMLTemplateElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTemplateElement {
HTMLTemplateElement {
htmlelement: HTMLElement::new(HTMLTemplateElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTemplateElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTemplateElementBinding::Wrap)
}
}

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTextAreaElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::document::AbstractDocument;
use dom::element::HTMLTextAreaElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTextAreaElement {
htmlelement: HTMLElement,
}
impl HTMLTextAreaElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTextAreaElement {
HTMLTextAreaElement {
htmlelement: HTMLElement::new(HTMLTextAreaElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTextAreaElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTextAreaElementBinding::Wrap)
}
}
impl HTMLTextAreaElement {
pub fn Autofocus(&self) -> bool {
false

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTimeElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTimeElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTimeElement {
htmlelement: HTMLElement
}
impl HTMLTimeElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTimeElement {
HTMLTimeElement {
htmlelement: HTMLElement::new(HTMLTimeElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTimeElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTimeElementBinding::Wrap)
}
}
impl HTMLTimeElement {
pub fn DateTime(&self) -> DOMString {
None

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTitleElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTitleElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTitleElement {
htmlelement: HTMLElement,
}
impl HTMLTitleElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTitleElement {
HTMLTitleElement {
htmlelement: HTMLElement::new(HTMLTitleElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTitleElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTitleElementBinding::Wrap)
}
}
impl HTMLTitleElement {
pub fn Text(&self) -> DOMString {
None

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLTrackElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTrackElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTrackElement {
htmlelement: HTMLElement,
}
impl HTMLTrackElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLTrackElement {
HTMLTrackElement {
htmlelement: HTMLElement::new(HTMLTrackElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLTrackElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLTrackElementBinding::Wrap)
}
}
impl HTMLTrackElement {
pub fn Kind(&self) -> DOMString {
None

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLUListElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLUListElementTypeId;
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLUListElement {
htmlelement: HTMLElement
}
impl HTMLUListElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLUListElement {
HTMLUListElement {
htmlelement: HTMLElement::new(HTMLUListElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLUListElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLUListElementBinding::Wrap)
}
}
impl HTMLUListElement {
pub fn Compact(&self) -> bool {
false

View file

@ -2,13 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLVideoElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLVideoElementTypeId;
use dom::htmlmediaelement::HTMLMediaElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLVideoElement {
htmlmediaelement: HTMLMediaElement
}
impl HTMLVideoElement {
pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLVideoElement {
HTMLVideoElement {
htmlmediaelement: HTMLMediaElement::new_inherited(HTMLVideoElementTypeId, localName, document)
}
}
pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
let element = HTMLVideoElement::new_inherited(localName, document);
Node::reflect_node(@mut element, document, HTMLVideoElementBinding::Wrap)
}
}
impl HTMLVideoElement {
pub fn Width(&self) -> u32 {
0

View file

@ -56,26 +56,15 @@ macro_rules! handle_htmlelement(
$cx, $document, $tag, $string, $type_id, $ctor, []);
)
)
macro_rules! handle_htmlmediaelement(
($cx: expr,
$document: expr,
$tag: expr,
macro_rules! handle_newable_element(
($document: expr,
$localName: expr,
$string: expr,
$type_id: expr,
$ctor: ident) => (
handle_element_base!(htmlmediaelement, HTMLMediaElement,
$cx, $document, $tag, $string, $type_id, $ctor, []);
)
)
macro_rules! handle_htmltablecellelement(
($cx: expr,
$document: expr,
$tag: expr,
$string: expr,
$type_id: expr,
$ctor: ident) => (
handle_element_base!(htmltablecellelement, HTMLTableCellElement,
$cx, $document, $tag, $string, $type_id, $ctor, []);
$ctor: ident
$(, $arg:expr )*) => (
if eq_slice($localName, $string) {
return $ctor::new(($localName).to_str(), $document $(, $arg)*);
}
)
)
macro_rules! handle_element_base(
@ -258,39 +247,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []);
handle_element!(cx, document, tag, "optgroup",HTMLOptGroupElementTypeId, HTMLOptGroupElement, []);
handle_element!(cx, document, tag, "output", HTMLOutputElementTypeId, HTMLOutputElement, []);
handle_element!(cx, document, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []);
handle_element!(cx, document, tag, "param", HTMLParamElementTypeId, HTMLParamElement, []);
handle_element!(cx, document, tag, "pre", HTMLPreElementTypeId, HTMLPreElement, []);
handle_element!(cx, document, tag, "progress",HTMLProgressElementTypeId, HTMLProgressElement, []);
handle_element!(cx, document, tag, "q", HTMLQuoteElementTypeId, HTMLQuoteElement, []);
handle_element!(cx, document, tag, "script", HTMLScriptElementTypeId, HTMLScriptElement, []);
handle_element!(cx, document, tag, "select", HTMLSelectElementTypeId, HTMLSelectElement, []);
handle_element!(cx, document, tag, "source", HTMLSourceElementTypeId, HTMLSourceElement, []);
handle_element!(cx, document, tag, "span", HTMLSpanElementTypeId, HTMLSpanElement, []);
handle_element!(cx, document, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
handle_element!(cx, document, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
handle_element!(cx, document, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []);
handle_element!(cx, document, tag, "col", HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, document, tag, "colgroup",HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, document, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
handle_element!(cx, document, tag, "template",HTMLTemplateElementTypeId, HTMLTemplateElement, []);
handle_element!(cx, document, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
handle_element!(cx, document, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
handle_element!(cx, document, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
handle_element!(cx, document, tag, "tr", HTMLTableRowElementTypeId, HTMLTableRowElement, []);
handle_element!(cx, document, tag, "track", HTMLTrackElementTypeId, HTMLTrackElement, []);
handle_element!(cx, document, tag, "ul", HTMLUListElementTypeId, HTMLUListElement, []);
handle_element!(cx, document, tag, "img", HTMLImageElementTypeId, HTMLImageElement, [(image: None)]);
handle_element!(cx, document, tag, "iframe", HTMLIframeElementTypeId, HTMLIFrameElement, [(frame: None), (size: None), (sandbox: None)]);
handle_element!(cx, document, tag, "h1", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading1)]);
handle_element!(cx, document, tag, "h2", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading2)]);
handle_element!(cx, document, tag, "h3", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading3)]);
handle_element!(cx, document, tag, "h4", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading4)]);
handle_element!(cx, document, tag, "h5", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading5)]);
handle_element!(cx, document, tag, "h6", HTMLHeadingElementTypeId, HTMLHeadingElement, [(level: Heading6)]);
handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -298,11 +254,40 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_htmlelement!(cx, document, tag, "section", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement);
handle_htmlmediaelement!(cx, document, tag, "audio", HTMLAudioElementTypeId, HTMLAudioElement);
handle_htmlmediaelement!(cx, document, tag, "video", HTMLVideoElementTypeId, HTMLVideoElement);
handle_htmltablecellelement!(cx, document, tag, "td", HTMLTableDataCellElementTypeId, HTMLTableDataCellElement);
handle_htmltablecellelement!(cx, document, tag, "th", HTMLTableHeaderCellElementTypeId, HTMLTableHeaderCellElement);
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);
}