[whatwg] Fetch: number of tasks queued
Glenn Maynard
glenn at zewt.org
Wed Mar 13 08:00:37 PDT 2013
On Wed, Mar 13, 2013 at 9:36 AM, Anne van Kesteren <annevk at annevk.nl> wrote:
> For the test.invalid case Gecko reports both 2 and 4, Chrome/Safari
> only 4, and IE10 1 and then a while later 4. I think we should go with
> a single network task for this scenario and align with Chrome/Safari.
>
It's safer to guarantee that we always send a message for each state.
Otherwise, code like this will work with network fetches but then suddenly
fail if pointed at a data URL:
client.onreadystatechange = function() { if(client.readyState ==
client.someState) doSomething(); };
It doesn't matter how many network tasks there are, though. We can just
say that if the old state is (eg.) OPENED, and we're now in DONE, that we
iterate through all of the intermediary states, setting readyState and
firing onreadystatecomplete.
--
Glenn Maynard
More information about the whatwg
mailing list