RESOLVED FIXED 40996
Progress event should not be fired during synchronous XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=40996
Summary Progress event should not be fired during synchronous XMLHttpRequest
Stuart Ng
Reported 2010-06-22 10:50:19 PDT
OnProgress Event was fired once during a synchronous XHR request Event.Total is some garbage value, while Event.lengthComputable and Event.loaded is correct. OnProgress should never be fired according to w3C spec.
Attachments
proposed fix (18.69 KB, patch)
2010-07-19 11:27 PDT, Alexey Proskuryakov
darin: review+
Alexey Proskuryakov
Comment 1 2010-06-23 09:59:27 PDT
This also means that having progress event handlers installed probably shouldn't force preflight for sync requests, since they will be ignored anyway.
Alexey Proskuryakov
Comment 2 2010-07-19 11:27:24 PDT
Created attachment 61970 [details] proposed fix
Alexey Proskuryakov
Comment 3 2010-07-19 11:47:13 PDT
*** Bug 17502 has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 4 2010-07-19 11:48:07 PDT
Committed <http://trac.webkit.org/changeset/63680>. Anne, any comments you may have about this change would be highly appreciated.
Anne van Kesteren
Comment 5 2010-07-26 01:23:35 PDT
What you are saying in comment 2 is addressed by step 5 of the send() algorithm. The way the specification is meant to be written (and I think it is) is that for synchronous requests no tasks are added to the task queue as defined by HTML5. So nothing can happen during a synchronous request, no events, no timeouts, etc.
Alexey Proskuryakov
Comment 6 2010-08-01 23:42:22 PDT
I think that we'll have/want to continue sending events that aren't async in nature, such as readystatechange for states UNSENT, OPENED and DONE. There doesn't seem to be any harm in that. These aren't added to task queue, they are dispatched right away.
Anne van Kesteren
Comment 7 2010-08-03 06:09:12 PDT
Yes. But they are not dispatched during a request. But you are right. Those will be always dispatched (and their definition also does not depend on the asynchronous flag like the events under discussion here).
Note You need to log in before you can comment on or make changes to this bug.