Introduce HTMLTableCaptionElement::new.

This commit is contained in:
Ms2ger 2013-10-31 19:49:11 +01:00
parent e578642278
commit a54e8046bb
2 changed files with 18 additions and 1 deletions

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

@ -258,7 +258,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
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_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -267,6 +266,7 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
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);