coding style in htmlinputelement, TODO in button

add comment, empty line in inputelement
add button type TODO in buttonelement
This commit is contained in:
yodalee 2015-02-03 20:48:11 +08:00
parent 0f2b1c4856
commit 5f82780d3a
2 changed files with 4 additions and 0 deletions

View file

@ -53,6 +53,7 @@ impl HTMLButtonElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>) -> HTMLButtonElement {
HTMLButtonElement {
htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLButtonElement, localName, prefix, document),
//TODO: implement button_type in after_set_attr
button_type: Cell::new(ButtonType::ButtonSubmit)
}
}

View file

@ -394,6 +394,7 @@ impl<'a> HTMLInputElementHelpers for JSRef<'a, HTMLInputElement> {
fn get_indeterminate_state(self) -> bool {
self.indeterminate.get()
}
// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-mutable
fn mutable(self) -> bool {
// https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-fe-mutable
@ -401,6 +402,8 @@ impl<'a> HTMLInputElementHelpers for JSRef<'a, HTMLInputElement> {
let node: JSRef<Node> = NodeCast::from_ref(self);
!(node.get_disabled_state() || self.ReadOnly())
}
// https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-form-reset-control
fn reset(self) {
match self.input_type.get() {
InputType::InputRadio | InputType::InputCheckbox => {