aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcomponents/script/dom/htmlinputelement.rs7
-rw-r--r--components/script/dom/webidls/HTMLInputElement.webidl2
-rw-r--r--tests/wpt/meta-legacy-layout/html/dom/idlharness.https.html.ini3
-rw-r--r--tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/files.html.ini3
-rw-r--r--tests/wpt/meta/html/dom/idlharness.https.html.ini3
-rw-r--r--tests/wpt/meta/html/semantics/forms/the-input-element/files.html.ini3
6 files changed, 8 insertions, 13 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs
index b00d2079db6..5ebd9c2cdc0 100755
--- a/components/script/dom/htmlinputelement.rs
+++ b/components/script/dom/htmlinputelement.rs
@@ -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");
diff --git a/components/script/dom/webidls/HTMLInputElement.webidl b/components/script/dom/webidls/HTMLInputElement.webidl
index 160b3904439..519198cebd9 100644
--- a/components/script/dom/webidls/HTMLInputElement.webidl
+++ b/components/script/dom/webidls/HTMLInputElement.webidl
@@ -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]
diff --git a/tests/wpt/meta-legacy-layout/html/dom/idlharness.https.html.ini b/tests/wpt/meta-legacy-layout/html/dom/idlharness.https.html.ini
index 1c687a2cd70..92748e2d98d 100644
--- a/tests/wpt/meta-legacy-layout/html/dom/idlharness.https.html.ini
+++ b/tests/wpt/meta-legacy-layout/html/dom/idlharness.https.html.ini
@@ -3381,9 +3381,6 @@
[HTMLSlotElement interface: operation assignedElements(AssignedNodesOptions)]
expected: FAIL
- [HTMLInputElement interface: attribute files]
- expected: FAIL
-
[Stringification of document.all]
expected: FAIL
diff --git a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/files.html.ini b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/files.html.ini
index a45bcbac700..348c5a89466 100644
--- a/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/files.html.ini
+++ b/tests/wpt/meta-legacy-layout/html/semantics/forms/the-input-element/files.html.ini
@@ -1,7 +1,4 @@
[files.html]
type: testharness
- [setting <input type=file>.files]
- expected: FAIL
-
[setting <input type=file>.files from DataTransfer]
expected: FAIL
diff --git a/tests/wpt/meta/html/dom/idlharness.https.html.ini b/tests/wpt/meta/html/dom/idlharness.https.html.ini
index 06dc5306659..59a3d470e29 100644
--- a/tests/wpt/meta/html/dom/idlharness.https.html.ini
+++ b/tests/wpt/meta/html/dom/idlharness.https.html.ini
@@ -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
diff --git a/tests/wpt/meta/html/semantics/forms/the-input-element/files.html.ini b/tests/wpt/meta/html/semantics/forms/the-input-element/files.html.ini
index a45bcbac700..348c5a89466 100644
--- a/tests/wpt/meta/html/semantics/forms/the-input-element/files.html.ini
+++ b/tests/wpt/meta/html/semantics/forms/the-input-element/files.html.ini
@@ -1,7 +1,4 @@
[files.html]
type: testharness
- [setting <input type=file>.files]
- expected: FAIL
-
[setting <input type=file>.files from DataTransfer]
expected: FAIL