aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rwxr-xr-xcomponents/script/dom/htmlinputelement.rs7
-rw-r--r--components/script/dom/webidls/HTMLInputElement.webidl2
2 files changed, 8 insertions, 1 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]