Skip to content

Commit

Permalink
Generate bindings for HTMLLegendElement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetsuharu OHZEKI committed Aug 31, 2013
1 parent e55b3d6 commit f7bc8be
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/codegen/Bindings.conf
Expand Up @@ -580,6 +580,7 @@ addHTMLElement('HTMLHRElement')
addHTMLElement('HTMLIFrameElement')
addHTMLElement('HTMLImageElement')
addHTMLElement('HTMLInputElement')
addHTMLElement('HTMLLegendElement')
addHTMLElement('HTMLLIElement')
addHTMLElement('HTMLLinkElement')
addHTMLElement('HTMLMapElement')
Expand Down
@@ -0,0 +1,29 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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
* http://www.whatwg.org/specs/web-apps/current-work/#the-legend-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
*
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/

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

// http://www.whatwg.org/specs/web-apps/current-work/#the-legend-element
interface HTMLLegendElement : HTMLElement {
/*
FIXME:
readonly attribute HTMLFormElement? form;
*/
};

// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLegendElement {
[SetterThrows]
attribute DOMString align;
};
2 changes: 2 additions & 0 deletions src/components/script/dom/bindings/element.rs
Expand Up @@ -92,6 +92,8 @@ generate_cacheable_wrapper!(HTMLImageElement, HTMLImageElementBinding::Wrap)
generate_binding_object!(HTMLImageElement)
generate_cacheable_wrapper!(HTMLInputElement, HTMLInputElementBinding::Wrap)
generate_binding_object!(HTMLInputElement)
generate_cacheable_wrapper!(HTMLLegendElement, HTMLLegendElementBinding::Wrap)
generate_binding_object!(HTMLLegendElement)
generate_cacheable_wrapper!(HTMLLIElement, HTMLLIElementBinding::Wrap)
generate_binding_object!(HTMLLIElement)
generate_cacheable_wrapper!(HTMLLinkElement, HTMLLinkElementBinding::Wrap)
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/bindings/node.rs
Expand Up @@ -49,6 +49,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLIframeElementTypeId) => generate_element!(HTMLIFrameElement),
ElementNodeTypeId(HTMLImageElementTypeId) => generate_element!(HTMLImageElement),
ElementNodeTypeId(HTMLInputElementTypeId) => generate_element!(HTMLInputElement),
ElementNodeTypeId(HTMLLegendElementTypeId) => generate_element!(HTMLLegendElement),
ElementNodeTypeId(HTMLLIElementTypeId) => generate_element!(HTMLLIElement),
ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement),
ElementNodeTypeId(HTMLMapElementTypeId) => generate_element!(HTMLMapElement),
Expand Down
1 change: 1 addition & 0 deletions src/components/script/dom/element.rs
Expand Up @@ -73,6 +73,7 @@ pub enum ElementTypeId {
HTMLIframeElementTypeId,
HTMLImageElementTypeId,
HTMLInputElementTypeId,
HTMLLegendElementTypeId,
HTMLLinkElementTypeId,
HTMLLIElementTypeId,
HTMLMapElementTypeId,
Expand Down
19 changes: 19 additions & 0 deletions src/components/script/dom/htmllegendelement.rs
@@ -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/. */

use dom::bindings::utils::{DOMString, null_string, ErrorResult};
use dom::htmlelement::HTMLElement;

pub struct HTMLLegendElement {
parent: HTMLElement,
}

impl HTMLLegendElement {
pub fn Align(&self) -> DOMString {
null_string
}

pub fn SetAlign(&mut self, _align: &DOMString, _rv: &mut ErrorResult) {
}
}
1 change: 1 addition & 0 deletions src/components/script/html/hubbub_html_parser.rs
Expand Up @@ -208,6 +208,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "head", HTMLHeadElementTypeId, HTMLHeadElement, []);
handle_element!(cx, tag, "html", HTMLHtmlElementTypeId, HTMLHtmlElement, []);
handle_element!(cx, tag, "input", HTMLInputElementTypeId, HTMLInputElement, []);
handle_element!(cx, tag, "legend", HTMLLegendElementTypeId, HTMLLegendElement, []);
handle_element!(cx, tag, "link", HTMLLinkElementTypeId, HTMLLinkElement, []);
handle_element!(cx, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []);
handle_element!(cx, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []);
Expand Down
1 change: 1 addition & 0 deletions src/components/script/script.rc
Expand Up @@ -84,6 +84,7 @@ pub mod dom {
pub mod htmliframeelement;
pub mod htmlimageelement;
pub mod htmlinputelement;
pub mod htmllegendelement;
pub mod htmllielement;
pub mod htmllinkelement;
pub mod htmlmapelement;
Expand Down

0 comments on commit f7bc8be

Please sign in to comment.