mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Adds reset method to FormControl
This commit is contained in:
parent
f0ce2af89c
commit
a3b3295d80
2 changed files with 20 additions and 20 deletions
|
@ -571,6 +571,20 @@ impl<'a> FormControl<'a> for JSRef<'a, HTMLInputElement> {
|
|||
// https://html.spec.whatwg.org/multipage/forms.html#the-readonly-attribute:concept-fe-mutable
|
||||
!(self.Disabled() || self.ReadOnly())
|
||||
}
|
||||
|
||||
fn reset(self) {
|
||||
let ty = self.Type();
|
||||
|
||||
match ty.as_slice() {
|
||||
"radio" | "checkbox" => {
|
||||
// TODO Reset radios/checkboxes here
|
||||
},
|
||||
"image" => (),
|
||||
_ => ()
|
||||
}
|
||||
|
||||
self.SetValue(self.DefaultValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue