Created attachment 328552 [details]
change event dispatched when .files set at <input type="file">
Programmatically set .files property of <input type="file"> element to a FileList object
Expected behaviour: change event should not be dispatched to the element
Actual result: change event is dispatched to the element
Browser: Chromium 62
See https://bugs.chromium.org/p/chromium/issues/detail?id=792336, https://github.com/whatwg/html/issues/3269
Does this reproduce in Safari? Chrome bugs should be filed in the Chromium bug tracker.
This is a Safari only bug, still reproducible in current TP Release 128 (Safari 15.0, WebKit 166188.8.131.52.3)
Here is a fiddle reproducing the issue: https://jsfiddle.net/34sxmbqc/
Specs (https://html.spec.whatwg.org/multipage/input.html#dom-input-files) do not ask to fire an event here, since the change has been caused by script manipulation.
The particularly alarming point is that this event even has the `isTrusted` property set to `true`.
Created attachment 436325 [details]
Committed r281527 (240899@main): <https://commits.webkit.org/240899@main>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 436325 [details].