Skip to content

Commit

Permalink
coding style in htmlinputelement, TODO in button
Browse files Browse the repository at this point in the history
add comment, empty line in inputelement
add button type TODO in buttonelement
  • Loading branch information
yodalee committed Feb 3, 2015
1 parent 0f2b1c4 commit 5f82780
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/script/dom/htmlbuttonelement.rs
Expand Up @@ -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)
}
}
Expand Down
3 changes: 3 additions & 0 deletions components/script/dom/htmlinputelement.rs
Expand Up @@ -394,13 +394,16 @@ 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
// https://html.spec.whatwg.org/multipage/forms.html#the-readonly-attribute:concept-fe-mutable
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 => {
Expand Down

0 comments on commit 5f82780

Please sign in to comment.