diff options
Diffstat (limited to 'src/components/script/dom/htmloptionelement.rs')
-rw-r--r-- | src/components/script/dom/htmloptionelement.rs | 18 |
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 } |