Generate bindings for HTMLOutputElement.

This commit is contained in:
Josh Matthews 2013-08-28 17:47:29 -04:00
parent cb0adec792
commit 8693459b28
8 changed files with 116 additions and 1 deletions

View file

@ -591,6 +591,7 @@ addHTMLElement('HTMLObjectElement')
addHTMLElement('HTMLOListElement')
addHTMLElement('HTMLOptGroupElement')
addHTMLElement('HTMLOptionElement')
addHTMLElement('HTMLOutputElement')
addHTMLElement('HTMLParagraphElement')
addHTMLElement('HTMLProgressElement')
addHTMLElement('HTMLQuoteElement')

View file

@ -0,0 +1,37 @@
/* -*- 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-output-element
*
* © 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.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
interface HTMLOutputElement : HTMLElement {
/*[PutForwards=value, Constant]
readonly attribute DOMSettableTokenList htmlFor;*/
readonly attribute HTMLFormElement? form;
[SetterThrows, Pure]
attribute DOMString name;
[Constant]
readonly attribute DOMString type;
[SetterThrows, Pure]
attribute DOMString defaultValue;
[SetterThrows, Pure]
attribute DOMString value;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
// Not yet implemented (bug 556743).
// readonly attribute NodeList labels;
};

View file

@ -405,6 +405,8 @@ generate_cacheable_wrapper!(HTMLOptGroupElement, HTMLOptGroupElementBinding::Wra
generate_binding_object!(HTMLOptGroupElement)
generate_cacheable_wrapper!(HTMLOptionElement, HTMLOptionElementBinding::Wrap)
generate_binding_object!(HTMLOptionElement)
generate_cacheable_wrapper!(HTMLOutputElement, HTMLOutputElementBinding::Wrap)
generate_binding_object!(HTMLOutputElement)
generate_cacheable_wrapper!(HTMLParagraphElement, HTMLParagraphElementBinding::Wrap)
generate_binding_object!(HTMLParagraphElement)
generate_cacheable_wrapper!(HTMLProgressElement, HTMLProgressElementBinding::Wrap)

View file

@ -108,6 +108,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLOListElementTypeId) => generate_element!(HTMLOListElement),
ElementNodeTypeId(HTMLOptGroupElementTypeId) => generate_element!(HTMLOptGroupElement),
ElementNodeTypeId(HTMLOptionElementTypeId) => generate_element!(HTMLOptionElement),
ElementNodeTypeId(HTMLOutputElementTypeId) => generate_element!(HTMLOutputElement),
ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement),
ElementNodeTypeId(HTMLProgressElementTypeId) => generate_element!(HTMLProgressElement),
ElementNodeTypeId(HTMLQuoteElementTypeId) => generate_element!(HTMLQuoteElement),

View file

@ -82,8 +82,9 @@ pub enum ElementTypeId {
HTMLModElementTypeId,
HTMLObjectElementTypeId,
HTMLOListElementTypeId,
HTMLOptionElementTypeId,
HTMLOptGroupElementTypeId,
HTMLOptionElementTypeId,
HTMLOutputElementTypeId,
HTMLParagraphElementTypeId,
HTMLProgressElementTypeId,
HTMLQuoteElementTypeId,

View file

@ -0,0 +1,71 @@
/* 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, ErrorResult, null_string};
use dom::htmlelement::HTMLElement;
use dom::node::{AbstractNode, ScriptView};
use dom::validitystate::ValidityState;
pub struct HTMLOutputElement {
parent: HTMLElement
}
impl HTMLOutputElement {
pub fn GetForm(&self) -> Option<AbstractNode<ScriptView>> {
None
}
pub fn Name(&self) -> DOMString {
null_string
}
pub fn SetName(&mut self, _name: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Type(&self) -> DOMString {
null_string
}
pub fn DefaultValue(&self) -> DOMString {
null_string
}
pub fn SetDefaultValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
}
pub fn Value(&self) -> DOMString {
null_string
}
pub fn SetValue(&mut self, _value: &DOMString, _rv: &mut ErrorResult) {
}
pub fn WillValidate(&self) -> bool {
false
}
pub fn SetWillValidate(&mut self, _will_validate: bool) {
}
pub fn Validity(&self) -> @mut ValidityState {
@mut ValidityState::valid()
}
pub fn SetValidity(&mut self, _validity: @mut ValidityState) {
}
pub fn ValidationMessage(&self) -> DOMString {
null_string
}
pub fn SetValidationMessage(&mut self, _message: &DOMString, _rv: &mut ErrorResult) {
}
pub fn CheckValidity(&self) -> bool {
true
}
pub fn SetCustomValidity(&mut self, _error: &DOMString) {
}
}

View file

@ -218,6 +218,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []);
handle_element!(cx, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []);
handle_element!(cx, tag, "optgroup",HTMLOptGroupElementTypeId, HTMLOptGroupElement, []);
handle_element!(cx, tag, "output", HTMLOutputElementTypeId, HTMLOutputElement, []);
handle_element!(cx, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []);
handle_element!(cx, tag, "progress",HTMLProgressElementTypeId, HTMLProgressElement, []);
handle_element!(cx, tag, "q", HTMLQuoteElementTypeId, HTMLQuoteElement, []);

View file

@ -93,6 +93,7 @@ pub mod dom {
pub mod htmlolistelement;
pub mod htmloptgroupelement;
pub mod htmloptionelement;
pub mod htmloutputelement;
pub mod htmlparagraphelement;
pub mod htmlprogresselement;
pub mod htmlquoteelement;