Generate bindings for HTMLMeterElement.

This commit is contained in:
Josh Matthews 2013-08-28 01:20:44 -04:00
parent 6c90dd54b2
commit 0fae7afa54
8 changed files with 96 additions and 2 deletions

View file

@ -585,6 +585,7 @@ addHTMLElement('HTMLLIElement')
addHTMLElement('HTMLLinkElement') addHTMLElement('HTMLLinkElement')
addHTMLElement('HTMLMapElement') addHTMLElement('HTMLMapElement')
addHTMLElement('HTMLMetaElement') addHTMLElement('HTMLMetaElement')
addHTMLElement('HTMLMeterElement')
addHTMLElement('HTMLOListElement') addHTMLElement('HTMLOListElement')
addHTMLElement('HTMLParagraphElement') addHTMLElement('HTMLParagraphElement')
addHTMLElement('HTMLProgressElement') addHTMLElement('HTMLProgressElement')

View file

@ -0,0 +1,33 @@
/* -*- 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-meter-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-meter-element
interface HTMLMeterElement : HTMLElement {
[SetterThrows]
attribute double value;
[SetterThrows]
attribute double min;
[SetterThrows]
attribute double max;
[SetterThrows]
attribute double low;
[SetterThrows]
attribute double high;
[SetterThrows]
attribute double optimum;
/**
* The labels attribute will be done with bug 556743.
*/
//readonly attribute NodeList labels;
};

View file

@ -393,6 +393,8 @@ generate_cacheable_wrapper!(HTMLMapElement, HTMLMapElementBinding::Wrap)
generate_binding_object!(HTMLMapElement) generate_binding_object!(HTMLMapElement)
generate_cacheable_wrapper!(HTMLMetaElement, HTMLMetaElementBinding::Wrap) generate_cacheable_wrapper!(HTMLMetaElement, HTMLMetaElementBinding::Wrap)
generate_binding_object!(HTMLMetaElement) generate_binding_object!(HTMLMetaElement)
generate_cacheable_wrapper!(HTMLMeterElement, HTMLMeterElementBinding::Wrap)
generate_binding_object!(HTMLMeterElement)
generate_cacheable_wrapper!(HTMLOListElement, HTMLOListElementBinding::Wrap) generate_cacheable_wrapper!(HTMLOListElement, HTMLOListElementBinding::Wrap)
generate_binding_object!(HTMLOListElement) generate_binding_object!(HTMLOListElement)
generate_cacheable_wrapper!(HTMLParagraphElement, HTMLParagraphElementBinding::Wrap) generate_cacheable_wrapper!(HTMLParagraphElement, HTMLParagraphElementBinding::Wrap)

View file

@ -17,7 +17,7 @@ use dom::element::{HTMLElementTypeId,
HTMLHRElementTypeId, HTMLHtmlElementTypeId, HTMLIframeElementTypeId, HTMLHRElementTypeId, HTMLHtmlElementTypeId, HTMLIframeElementTypeId,
HTMLImageElementTypeId, HTMLInputElementTypeId, HTMLLIElementTypeId, HTMLImageElementTypeId, HTMLInputElementTypeId, HTMLLIElementTypeId,
HTMLLinkElementTypeId, HTMLMapElementTypeId, HTMLMetaElementTypeId, HTMLLinkElementTypeId, HTMLMapElementTypeId, HTMLMetaElementTypeId,
HTMLOListElementTypeId, HTMLParagraphElementTypeId, HTMLMeterElementTypeId, HTMLOListElementTypeId, HTMLParagraphElementTypeId,
HTMLProgressElementTypeId, HTMLQuoteElementTypeId, HTMLScriptElementTypeId, HTMLProgressElementTypeId, HTMLQuoteElementTypeId, HTMLScriptElementTypeId,
HTMLSpanElementTypeId, HTMLSourceElementTypeId, HTMLSpanElementTypeId, HTMLSourceElementTypeId,
HTMLStyleElementTypeId, HTMLTextAreaElementTypeId, HTMLStyleElementTypeId, HTMLTextAreaElementTypeId,
@ -120,6 +120,7 @@ pub fn create(cx: *JSContext, node: &mut AbstractNode<ScriptView>) -> *JSObject
ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement), ElementNodeTypeId(HTMLLinkElementTypeId) => generate_element!(HTMLLinkElement),
ElementNodeTypeId(HTMLMapElementTypeId) => generate_element!(HTMLMapElement), ElementNodeTypeId(HTMLMapElementTypeId) => generate_element!(HTMLMapElement),
ElementNodeTypeId(HTMLMetaElementTypeId) => generate_element!(HTMLMetaElement), ElementNodeTypeId(HTMLMetaElementTypeId) => generate_element!(HTMLMetaElement),
ElementNodeTypeId(HTMLMeterElementTypeId) => generate_element!(HTMLMeterElement),
ElementNodeTypeId(HTMLOListElementTypeId) => generate_element!(HTMLOListElement), ElementNodeTypeId(HTMLOListElementTypeId) => generate_element!(HTMLOListElement),
ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement), ElementNodeTypeId(HTMLParagraphElementTypeId) => generate_element!(HTMLParagraphElement),
ElementNodeTypeId(HTMLProgressElementTypeId) => generate_element!(HTMLProgressElement), ElementNodeTypeId(HTMLProgressElementTypeId) => generate_element!(HTMLProgressElement),

View file

@ -78,6 +78,7 @@ pub enum ElementTypeId {
HTMLLIElementTypeId, HTMLLIElementTypeId,
HTMLMapElementTypeId, HTMLMapElementTypeId,
HTMLMetaElementTypeId, HTMLMetaElementTypeId,
HTMLMeterElementTypeId,
HTMLOListElementTypeId, HTMLOListElementTypeId,
HTMLOptionElementTypeId, HTMLOptionElementTypeId,
HTMLParagraphElementTypeId, HTMLParagraphElementTypeId,

View file

@ -0,0 +1,54 @@
/* 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::ErrorResult;
use dom::htmlelement::HTMLElement;
pub struct HTMLMeterElement {
parent: HTMLElement
}
impl HTMLMeterElement {
pub fn Value(&self) -> f64 {
0.0
}
pub fn SetValue(&mut self, _value: f64, _rv: &mut ErrorResult) {
}
pub fn Min(&self) -> f64 {
0.0
}
pub fn SetMin(&mut self, _min: f64, _rv: &mut ErrorResult) {
}
pub fn Max(&self) -> f64 {
0.0
}
pub fn SetMax(&mut self, _max: f64, _rv: &mut ErrorResult) {
}
pub fn Low(&self) -> f64 {
0.0
}
pub fn SetLow(&mut self, _low: f64, _rv: &mut ErrorResult) {
}
pub fn High(&self) -> f64 {
0.0
}
pub fn SetHigh(&mut self, _high: f64, _rv: &mut ErrorResult) {
}
pub fn Optimum(&self) -> f64 {
0.0
}
pub fn SetOptimum(&mut self, _optimum: f64, _rv: &mut ErrorResult) {
}
}

View file

@ -13,7 +13,7 @@ use dom::element::{HTMLElementTypeId,
HTMLHeadElementTypeId, HTMLHtmlElementTypeId, HTMLImageElementTypeId, HTMLHeadElementTypeId, HTMLHtmlElementTypeId, HTMLImageElementTypeId,
HTMLIframeElementTypeId, HTMLInputElementTypeId, HTMLLinkElementTypeId, HTMLIframeElementTypeId, HTMLInputElementTypeId, HTMLLinkElementTypeId,
HTMLLIElementTypeId, HTMLMapElementTypeId, HTMLMetaElementTypeId, HTMLLIElementTypeId, HTMLMapElementTypeId, HTMLMetaElementTypeId,
HTMLOListElementTypeId, HTMLOptionElementTypeId, HTMLMeterElementTypeId, HTMLOListElementTypeId, HTMLOptionElementTypeId,
HTMLParagraphElementTypeId, HTMLProgressElementTypeId, HTMLParagraphElementTypeId, HTMLProgressElementTypeId,
HTMLQuoteElementTypeId, HTMLScriptElementTypeId, HTMLQuoteElementTypeId, HTMLScriptElementTypeId,
HTMLSelectElementTypeId, HTMLSmallElementTypeId, HTMLSourceElementTypeId, HTMLSelectElementTypeId, HTMLSmallElementTypeId, HTMLSourceElementTypeId,
@ -235,6 +235,7 @@ fn build_element_from_tag(cx: *JSContext, tag: &str) -> AbstractNode<ScriptView>
handle_element!(cx, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []); handle_element!(cx, tag, "li", HTMLLIElementTypeId, HTMLLIElement, []);
handle_element!(cx, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []); handle_element!(cx, tag, "map", HTMLMapElementTypeId, HTMLMapElement, []);
handle_element!(cx, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []); handle_element!(cx, tag, "meta", HTMLMetaElementTypeId, HTMLMetaElement, []);
handle_element!(cx, tag, "meter", HTMLMeterElementTypeId, HTMLMeterElement, []);
handle_element!(cx, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []); handle_element!(cx, tag, "ol", HTMLOListElementTypeId, HTMLOListElement, []);
handle_element!(cx, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []); handle_element!(cx, tag, "option", HTMLOptionElementTypeId, HTMLOptionElement, []);
handle_element!(cx, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []); handle_element!(cx, tag, "p", HTMLParagraphElementTypeId, HTMLParagraphElement, []);

View file

@ -87,6 +87,7 @@ pub mod dom {
pub mod htmllinkelement; pub mod htmllinkelement;
pub mod htmlmapelement; pub mod htmlmapelement;
pub mod htmlmetaelement; pub mod htmlmetaelement;
pub mod htmlmeterelement;
pub mod htmlolistelement; pub mod htmlolistelement;
pub mod htmlparagraphelement; pub mod htmlparagraphelement;
pub mod htmlprogresselement; pub mod htmlprogresselement;