aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/htmloptionelement.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2013-11-01 21:52:43 +0100
committerMs2ger <ms2ger@gmail.com>2013-11-01 21:52:43 +0100
commit6c217c6872651729c162bd3092f700177cf24abc (patch)
tree98f39fd2a97c18a192a2694b223992415dbc7fc4 /src/components/script/dom/htmloptionelement.rs
parent21be4752a1640dcffa91cab93447b3d9af6ca771 (diff)
downloadservo-6c217c6872651729c162bd3092f700177cf24abc.tar.gz
servo-6c217c6872651729c162bd3092f700177cf24abc.zip
Introduce HTMLOptionElement::new.
Diffstat (limited to 'src/components/script/dom/htmloptionelement.rs')
-rw-r--r--src/components/script/dom/htmloptionelement.rs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/components/script/dom/htmloptionelement.rs b/src/components/script/dom/htmloptionelement.rs
index 7e3b4ff31a4..52c5daf8bf9 100644
--- a/src/components/script/dom/htmloptionelement.rs
+++ b/src/components/script/dom/htmloptionelement.rs
@@ -2,15 +2,31 @@
* 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::codegen::HTMLOptionElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult};
+use dom::document::AbstractDocument;
+use dom::element::HTMLOptionElementTypeId;
use dom::htmlelement::HTMLElement;
-use dom::node::{AbstractNode, ScriptView};
+use dom::node::{AbstractNode, Node, ScriptView};
pub struct HTMLOptionElement {
htmlelement: HTMLElement
}
impl HTMLOptionElement {
+ pub fn new_inherited(localName: ~str, document: AbstractDocument) -> HTMLOptionElement {
+ HTMLOptionElement {
+ htmlelement: HTMLElement::new(HTMLOptionElementTypeId, localName, document)
+ }
+ }
+
+ pub fn new(localName: ~str, document: AbstractDocument) -> AbstractNode<ScriptView> {
+ let element = HTMLOptionElement::new_inherited(localName, document);
+ Node::reflect_node(@mut element, document, HTMLOptionElementBinding::Wrap)
+ }
+}
+
+impl HTMLOptionElement {
pub fn Disabled(&self) -> bool {
false
}