Skip to content

Commit

Permalink
Generate bindings for HTMLTemplateElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetsuharu OHZEKI committed Aug 31, 2013
1 parent c532c73 commit 22e02b5
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/Bindings.conf
Expand Up @@ -606,6 +606,7 @@ addHTMLElement('HTMLTableCellElement')
addHTMLElement('HTMLTableColElement')
addHTMLElement('HTMLTableRowElement')
addHTMLElement('HTMLTableSectionElement')
addHTMLElement('HTMLTemplateElement')
addHTMLElement('HTMLTextAreaElement')
addHTMLElement('HTMLTimeElement')
addHTMLElement('HTMLTitleElement')
Expand Down
@@ -0,0 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/.
*
* The origin of this IDL file is
* https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html
*
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
* liability, trademark and document use rules apply.
*/

// import from http://mxr.mozilla.org/mozilla-central/source/dom/webidl/HTMLTemplateElement.webidl

interface HTMLTemplateElement : HTMLElement {
/* FIXME:
readonly attribute DocumentFragment content;
*/
};

2 changes: 2 additions & 0 deletions src/components/script/dom/bindings/element.rs
Expand Up @@ -144,6 +144,8 @@ generate_cacheable_wrapper!(HTMLTableRowElement, HTMLTableRowElementBinding::Wra
generate_binding_object!(HTMLTableRowElement)
generate_cacheable_wrapper!(HTMLTableSectionElement, HTMLTableSectionElementBinding::Wrap)
generate_binding_object!(HTMLTableSectionElement)
generate_cacheable_wrapper!(HTMLTemplateElement, HTMLTemplateElementBinding::Wrap)
generate_binding_object!(HTMLTemplateElement)
generate_cacheable_wrapper!(HTMLTextAreaElement, HTMLTextAreaElementBinding::Wrap)
generate_binding_object!(HTMLTextAreaElement)
generate_cacheable_wrapper!(HTMLTitleElement, HTMLTitleElementBinding::Wrap)
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/node.rs
Expand Up @@ -75,6 +75,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLTableColElementTypeId) => generate_element!(HTMLTableColElement),
ElementNodeTypeId(HTMLTableRowElementTypeId) => generate_element!(HTMLTableRowElement),
ElementNodeTypeId(HTMLTableSectionElementTypeId) => generate_element!(HTMLTableSectionElement),
ElementNodeTypeId(HTMLTemplateElementTypeId) => generate_element!(HTMLTemplateElement),
ElementNodeTypeId(HTMLTextAreaElementTypeId) => generate_element!(HTMLTextAreaElement),
ElementNodeTypeId(HTMLTimeElementTypeId) => generate_element!(HTMLTimeElement),
ElementNodeTypeId(HTMLTitleElementTypeId) => generate_element!(HTMLTitleElement),
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/element.rs
Expand Up @@ -99,6 +99,7 @@ pub enum ElementTypeId {
HTMLTableColElementTypeId,
HTMLTableRowElementTypeId,
HTMLTableSectionElementTypeId,
HTMLTemplateElementTypeId,
HTMLTextAreaElementTypeId,
HTMLTimeElementTypeId,
HTMLTitleElementTypeId,
Expand Down
12 changes: 12 additions & 0 deletions src/components/script/dom/htmltemplateelement.rs
@@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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::htmlelement::HTMLElement;

pub struct HTMLTemplateElement {
parent: HTMLElement,
}

impl HTMLTemplateElement {
}
1 change: 1 addition & 0 deletions src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -234,6 +234,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "col", HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, tag, "colgroup",HTMLTableColElementTypeId, HTMLTableColElement, []);
handle_element!(cx, tag, "tbody", HTMLTableSectionElementTypeId, HTMLTableSectionElement, []);
handle_element!(cx, tag, "template",HTMLTemplateElementTypeId, HTMLTemplateElement, []);
handle_element!(cx, tag, "textarea",HTMLTextAreaElementTypeId, HTMLTextAreaElement, []);
handle_element!(cx, tag, "time", HTMLTimeElementTypeId, HTMLTimeElement, []);
handle_element!(cx, tag, "title", HTMLTitleElementTypeId, HTMLTitleElement, []);
Expand Down
1 change: 1 addition & 0 deletions src/components/script/script.rc
Expand Up @@ -110,6 +110,7 @@ pub mod dom {
pub mod htmltablecolelement;
pub mod htmltablerowelement;
pub mod htmltablesectionelement;
pub mod htmltemplateelement;
pub mod htmltextareaelement;
pub mod htmltimeelement;
pub mod htmltitleelement;
Expand Down

0 comments on commit 22e02b5

Please sign in to comment.