Introduce HTMLTableColElement::new.

This commit is contained in:
Ms2ger 2013-10-31 19:20:37 +01:00
parent 3a6d6b9a71
commit e578642278
2 changed files with 19 additions and 2 deletions

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::HTMLTableColElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult}; use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLTableColElementTypeId;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLTableColElement { pub struct HTMLTableColElement {
htmlelement: HTMLElement, 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 { impl HTMLTableColElement {
pub fn Span(&self) -> u32 { pub fn Span(&self) -> u32 {
0 0

View file

@ -259,8 +259,6 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_element!(cx, document, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []); handle_element!(cx, document, tag, "style", HTMLStyleElementTypeId, HTMLStyleElement, []);
handle_element!(cx, document, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []); handle_element!(cx, document, tag, "table", HTMLTableElementTypeId, HTMLTableElement, []);
handle_element!(cx, document, tag, "caption", HTMLTableCaptionElementTypeId, HTMLTableCaptionElement, []); 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_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "aside", HTMLElementTypeId, HTMLElement);
handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "b", HTMLElementTypeId, HTMLElement);
@ -269,6 +267,8 @@ pub fn build_element_from_tag(cx: *JSContext, tag: &str, document: AbstractDocum
handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement); handle_htmlelement!(cx, document, tag, "small", HTMLElementTypeId, HTMLElement);
handle_newable_element!(document, tag, "audio", HTMLAudioElement); handle_newable_element!(document, tag, "audio", HTMLAudioElement);
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, "h1", HTMLHeadingElement, Heading1);
handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2); handle_newable_element!(document, tag, "h2", HTMLHeadingElement, Heading2);
handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3); handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3);