diff options
-rw-r--r-- | src/components/script/dom/bindings/codegen/Bindings.conf | 1 | ||||
-rw-r--r-- | src/components/script/dom/bindings/codegen/HTMLOutputElement.webidl | 37 | ||||
-rw-r--r-- | src/components/script/dom/bindings/element.rs | 2 | ||||
-rw-r--r-- | src/components/script/dom/bindings/node.rs | 1 | ||||
-rw-r--r-- | src/components/script/dom/element.rs | 3 | ||||
-rw-r--r-- | src/components/script/dom/htmloutputelement.rs | 71 | ||||
-rw-r--r-- | src/components/script/html/hubbub_html_parser.rs | 1 | ||||
-rw-r--r-- | src/components/script/script.rc | 1 |
8 files changed, 116 insertions, 1 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf index bd772f12669..94612333bce 100644 --- a/src/components/script/dom/bindings/codegen/Bindings.conf +++ b/src/components/script/dom/bindings/codegen/Bindings.conf @@ -591,6 +591,7 @@ addHTMLElement('HTMLObjectElement') addHTMLElement('HTMLOListElement') addHTMLElement('HTMLOptGroupElement') addHTMLElement('HTMLOptionElement') +addHTMLElement('HTMLOutputElement') addHTMLElement('HTMLParagraphElement') addHTMLElement('HTMLProgressElement') addHTMLElement('HTMLQuoteElement') diff --git a/src/components/script/dom/bindings/codegen/HTMLOutputElement.webidl b/src/components/script/dom/bindings/codegen/HTMLOutputElement.webidl new file mode 100644 index 00000000000..e706465d974 --- /dev/null +++ b/src/components/script/dom/bindings/codegen/HTMLOutputElement.webidl @@ -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; +}; diff --git a/src/components/script/dom/bindings/element.rs b/src/components/script/dom/bindings/element.rs index c41940a9ff8..f1e25725566 100644 --- a/src/components/script/dom/bindings/element.rs +++ b/src/components/script/dom/bindings/element.rs @@ -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) diff --git a/src/components/script/dom/bindings/node.rs b/src/components/script/dom/bindings/node.rs index 73d4734837c..0918aaf0e91 100644 --- a/src/components/script/dom/bindings/node.rs +++ b/src/components/script/dom/bindings/node.rs @@ -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), diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs index 3bd21a60593..be373fae8ae 100644 --- a/src/components/script/dom/element.rs +++ b/src/components/script/dom/element.rs @@ -82,8 +82,9 @@ pub enum ElementTypeId { HTMLModElementTypeId, HTMLObjectElementTypeId, HTMLOListElementTypeId, - HTMLOptionElementTypeId, HTMLOptGroupElementTypeId, + HTMLOptionElementTypeId, + HTMLOutputElementTypeId, HTMLParagraphElementTypeId, HTMLProgressElementTypeId, HTMLQuoteElementTypeId, diff --git a/src/components/script/dom/htmloutputelement.rs b/src/components/script/dom/htmloutputelement.rs new file mode 100644 index 00000000000..934cf23883b --- /dev/null +++ b/src/components/script/dom/htmloutputelement.rs @@ -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) { + } +} diff --git a/src/components/script/html/hubbub_html_parser.rs b/src/components/script/html/hubbub_html_parser.rs index 36dc9e00902..93df39cc3d6 100644 --- a/src/components/script/html/hubbub_html_parser.rs +++ b/src/components/script/html/hubbub_html_parser.rs @@ -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, []); diff --git a/src/components/script/script.rc b/src/components/script/script.rc index 9f7f9c7131d..93857862eb1 100644 --- a/src/components/script/script.rc +++ b/src/components/script/script.rc @@ -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; |