Summary: This allows assigning to a file input from script when getting
a file drop event, amongst other use cases.
Bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=757664
Standards status: Incessant wrangling. Everyone agrees this would be
good to do, in general. Chrome implements something where you can
assign a FileList to HTMLInputElement.files. See below for our proposed
behavior.
Platform coverage: all
Estimated or target release: Gecko 40.
Preference behind which this will be implemented: None for the moment.
If necessary, we could sorta put this behind a pref or channel ifdef,
but it would still have observably different behavior from what we have
now when the setter is actually invoked (either strict mode would no-op
instead of throwing or non-strict mode would throw instead of no-opping).
DevTools bug: Doesn't seem applicable.
The behavior we propose to implement:
1) The setter treats its single argument as a sequence<Blob>. Any
Blobs that are not already Files get upgraded to Files, identical to how
https://xhr.spec.whatwg.org/#create-an-entry behaves.
2) If the input is not in the "file" state after the argument coercion
described in step 1, the operation is a no-op (as opposed to throwing).
3) The existing .files value, if any, is thrown away and a new FileList
created in its place.
-Boris