mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
8c25336e9a
commit
8c1a72f130
6 changed files with 8 additions and 13 deletions
|
@ -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");
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ interface HTMLInputElement : HTMLElement {
|
|||
[CEReactions]
|
||||
attribute boolean disabled;
|
||||
readonly attribute HTMLFormElement? form;
|
||||
readonly attribute FileList? files;
|
||||
attribute FileList? files;
|
||||
[CEReactions]
|
||||
attribute DOMString formAction;
|
||||
[CEReactions]
|
||||
|
|
|
@ -3381,9 +3381,6 @@
|
|||
[HTMLSlotElement interface: operation assignedElements(AssignedNodesOptions)]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLInputElement interface: attribute files]
|
||||
expected: FAIL
|
||||
|
||||
[Stringification of document.all]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
[files.html]
|
||||
type: testharness
|
||||
[setting <input type=file>.files]
|
||||
expected: FAIL
|
||||
|
||||
[setting <input type=file>.files from DataTransfer]
|
||||
expected: FAIL
|
||||
|
|
|
@ -3219,9 +3219,6 @@
|
|||
[HTMLInputElement interface: createInput("image") must inherit property "width" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLInputElement interface: attribute files]
|
||||
expected: FAIL
|
||||
|
||||
[Stringification of document.all]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
[files.html]
|
||||
type: testharness
|
||||
[setting <input type=file>.files]
|
||||
expected: FAIL
|
||||
|
||||
[setting <input type=file>.files from DataTransfer]
|
||||
expected: FAIL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue