[whatwg] Adding progress event for native <form>?

I see that https://xhr.spec.whatwg.org/ already defines ProgressEvent
for XMLHttpRequest.

Would it be possible to add "progress", "load", etc. events to normal
form elements, too? Basically, I would like to do

  form.addEventListener('progress', function (e) {...})

and if the end user hits the Submit button, my progress listener would
get called with ProgressEvent with lengthComputable, loaded and total
attributes.

If I have understood correctly, this does not make any information
available to JavaScript that is not already available because JavaScript
*can* already evaluate all form fields, use FileReader API to get all
the files in file inputs and submit the form to the same action URL
using XMLHttpRequest. In addition, browsers already implement all the
required code because XMLHttpRequest needs that behavior.

If listening for "progress" were allowed, I could implement my own form
submission UI and still use regular forms that would work even without
JavaScript.

-- 
Mikko

Received on Tuesday, 11 April 2017 12:45:25 UTC