diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-10-31 19:20:37 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-10-31 19:20:37 +0100 |
commit | e5786422780c6e622849b16df1f7acba8660e0cd (patch) | |
tree | dadd0778705ab56b8cc952aec1c849279b647122 | |
parent | 3a6d6b9a71ccec706eb24b6fb7a17d1e78d08df2 (diff) | |
download | servo-e5786422780c6e622849b16df1f7acba8660e0cd.tar.gz servo-e5786422780c6e622849b16df1f7acba8660e0cd.zip |
Introduce HTMLTableColElement::new.
-rw-r--r-- | src/components/script/dom/htmltablecolelement.rs | 17 | ||||
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/components/script/dom/htmltablecolelement.rs b/src/components/script/dom/htmltablecolelement.rs index 78ad9867e0e..27817306a2c 100644 --- a/src/components/script/dom/htmltablecolelement.rs +++ b/src/components/script/dom/htmltablecolelement.rs @@ -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::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 } diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 93173ceb582..23aea912365 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -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, "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_htmlelement!(cx, document, tag, "aside", 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_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, "h2", HTMLHeadingElement, Heading2); handle_newable_element!(document, tag, "h3", HTMLHeadingElement, Heading3); |