mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
add button type into HTMLButtonElement
This commit is contained in:
parent
ff53354ba7
commit
c5a5db6324
1 changed files with 15 additions and 2 deletions
|
@ -21,11 +21,23 @@ use dom::virtualmethods::VirtualMethods;
|
||||||
use std::ascii::OwnedAsciiExt;
|
use std::ascii::OwnedAsciiExt;
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
use util::str::DOMString;
|
use util::str::DOMString;
|
||||||
|
use std::cell::Cell;
|
||||||
use string_cache::Atom;
|
use string_cache::Atom;
|
||||||
|
|
||||||
|
#[jstraceable]
|
||||||
|
#[derive(PartialEq, Copy)]
|
||||||
|
#[allow(dead_code)]
|
||||||
|
enum ButtonType {
|
||||||
|
ButtonSubmit,
|
||||||
|
ButtonReset,
|
||||||
|
ButtonButton,
|
||||||
|
ButtonMenu
|
||||||
|
}
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct HTMLButtonElement {
|
pub struct HTMLButtonElement {
|
||||||
htmlelement: HTMLElement
|
htmlelement: HTMLElement,
|
||||||
|
button_type: Cell<ButtonType>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HTMLButtonElementDerived for EventTarget {
|
impl HTMLButtonElementDerived for EventTarget {
|
||||||
|
@ -37,7 +49,8 @@ impl HTMLButtonElementDerived for EventTarget {
|
||||||
impl HTMLButtonElement {
|
impl HTMLButtonElement {
|
||||||
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLButtonElement {
|
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLButtonElement {
|
||||||
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue