W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

XMLHttpRequest and timing of upload events

From: Anne van Kesteren <annevk@annevk.nl>
Date: Tue, 20 May 2014 14:55:37 +0200
Message-ID: <CADnb78jS=p_xhDrwVo3AnQnk0kcae7qB2XAgEfC=9oc1ynihbw@mail.gmail.com>
To: WebApps WG <public-webapps@w3.org>
Because redirects are atomic, we cannot dispatch loadend events and
such on the XMLHttpRequestUpload class.

This effectively means that the moment we know we are not going to
follow a redirect, we know we "completed" uploading (potentially
several times).

>From what I observed in Safari/Chrome it seems a separate task is what
we want. This means e.g. a setTimeout() callback can run between
loadend for upload and state switching to HEADERS_RECEIVED.

Firefox also reports state as OPENED, though the setTimeout() callback
runs much later (maybe due to a lower limit).

http://dump.testsuite.org/xhr/upload-events.html was my test.

Let me know if you have any concerns. This change will mostly be done
in Fetch as that queues the networking tasks these days.


-- 
http://annevankesteren.nl/
Received on Tuesday, 20 May 2014 12:56:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC