whatwg / xhr

XMLHttpRequest Standard
https://xhr.spec.whatwg.org/
Other
315 stars 131 forks source link

Should sync XHR fire a progress event? #207

Closed ricea closed 6 years ago

ricea commented 6 years ago

https://xhr.spec.whatwg.org/commit-snapshots/02600c40359bd70229606c33b3e2ca27308ffb04/#ref-for-concept-event-fire-progress⑦

Fire a progress event named progress with transmitted and length.

This appears to imply that the progress event is fired even when the synchronous flag is set.

I have been investigating Chromium issue https://crbug.com/402986 which is about Chromium not firing this event for sync XHR. I checked in Chrome, Firefox, Safari, IE and Edge, and only Firefox ever fires a progress event for sync XHR, and even then only about 50% of the time.

I would prefer to change the standard to not fire a progress event for sync XHR, to match the majority behaviour.

annevk commented 6 years ago

This would mean updating https://xhr.spec.whatwg.org/#handle-response-end-of-body only, right? I'd be okay making it conditional there.

ricea commented 6 years ago

Yes. It should be a tiny change. I can write a test if it helps.

annevk commented 6 years ago

Yeah it would, thanks.