Update webidl and implement setter for the files property of a file input (#31934)

The files attribute was previously readonly, but was later updated to allow mutation via input.files = ...

see https://github.com/whatwg/html/issues/2861
This commit is contained in:
shanehandley 2024-04-01 20:12:07 +11:00 committed by GitHub
parent 8c25336e9a
commit 8c1a72f130
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 13 deletions

View file

@ -1186,6 +1186,13 @@ impl HTMLInputElementMethods for HTMLInputElement {
self.filelist.get().as_ref().cloned()
}
/// <https://html.spec.whatwg.org/multipage/#dom-input-files>
fn SetFiles(&self, files: Option<&FileList>) {
if self.input_type() == InputType::File && files.is_some() {
self.filelist.set(files);
}
}
// https://html.spec.whatwg.org/multipage/#dom-input-defaultchecked
make_bool_getter!(DefaultChecked, "checked");