diff options
author | yodalee <lc85301@gmail.com> | 2015-01-06 01:50:37 +0800 |
---|---|---|
committer | yodalee <lc85301@gmail.com> | 2015-02-03 19:45:03 +0800 |
commit | c5a5db6324c3ef1c1d25b2a87edcebcd408a4c8b (patch) | |
tree | 537832361cfe7df9d03dcfe62df06f9e499f3e70 /components/script/dom/htmlbuttonelement.rs | |
parent | ff53354ba7716fadc7656891d7b0723a3730e890 (diff) | |
download | servo-c5a5db6324c3ef1c1d25b2a87edcebcd408a4c8b.tar.gz servo-c5a5db6324c3ef1c1d25b2a87edcebcd408a4c8b.zip |
add button type into HTMLButtonElement
Diffstat (limited to 'components/script/dom/htmlbuttonelement.rs')
-rw-r--r-- | components/script/dom/htmlbuttonelement.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index 04c827056b7..c84d964e13f 100644 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -21,11 +21,23 @@ use dom::virtualmethods::VirtualMethods; use std::ascii::OwnedAsciiExt; use std::borrow::ToOwned; use util::str::DOMString; +use std::cell::Cell; use string_cache::Atom; +#[jstraceable] +#[derive(PartialEq, Copy)] +#[allow(dead_code)] +enum ButtonType { + ButtonSubmit, + ButtonReset, + ButtonButton, + ButtonMenu +} + #[dom_struct] pub struct HTMLButtonElement { - htmlelement: HTMLElement + htmlelement: HTMLElement, + button_type: Cell<ButtonType> } impl HTMLButtonElementDerived for EventTarget { @@ -37,7 +49,8 @@ impl HTMLButtonElementDerived for EventTarget { impl HTMLButtonElement { fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLButtonElement { HTMLButtonElement { - htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLButtonElement, localName, prefix, document) + htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLButtonElement, localName, prefix, document), + button_type: Cell::new(ButtonType::ButtonSubmit) } } |