diff options
author | Ms2ger <ms2ger@gmail.com> | 2013-10-31 19:49:11 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2013-10-31 19:49:11 +0100 |
commit | a54e8046bbd0cde2a1f363b31c39f484daf7a7f4 (patch) | |
tree | 58b4c3889eb80e2cf9cf65bd5de7385cf1444b2d /src/components/script | |
parent | e5786422780c6e622849b16df1f7acba8660e0cd (diff) | |
download | servo-a54e8046bbd0cde2a1f363b31c39f484daf7a7f4.tar.gz servo-a54e8046bbd0cde2a1f363b31c39f484daf7a7f4.zip |
Introduce HTMLTableCaptionElement::new.
Diffstat (limited to 'src/components/script')
-rw-r--r-- | src/components/script/dom/htmltablecaptionelement.rs | 17 | ||||
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/components/script/dom/htmltablecaptionelement.rs b/src/components/script/dom/htmltablecaptionelement.rs index f812e512ebc..405e59cf272 100644 --- a/src/components/script/dom/htmltablecaptionelement.rs +++ b/src/components/script/dom/htmltablecaptionelement.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::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 } diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 23aea912365..e4763c4b8b0 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -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); |