[whatwg] Fetch: number of tasks queued

I tested data URLs and network errors in
http://software.hixie.ch/utilities/js/live-dom-viewer/ using this
test:

<!doctype html><script>
 var url = "http://test.invalid",
     x = new XMLHttpRequest()
 x.open("GET", url)
 x.onreadystatechange = function() { w(x.readyState + " " + x.responseText) }
 x.send()
</script>

And also tried with url being "data:text/html," and it being
"data:text/html,test".

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.

For the "data:text/html," case Gecko reports both 2 and 4. For
"data:text/html,test" you get 2, 3 test, 4 test. Chrome/Safari
dispatch 4 (without test) and then throw mentioning a synchronous
request. Seems very much like an implementation bug. IE10 throws on
the open() call which is a bug too. I'm leaning towards just reporting
4 for data/about as all the data is already in.

I also tried this case:

<!doctype html><script>
 var url = "http://dump.testsuite.org/xhr/ldv-204.php",
      x = new XMLHttpRequest()
 x.open("GET", url)
 x.onreadystatechange = function() { w(x.readyState + " " + x.statusText) }
 x.send()
</script>

Where ldv-204.php has no entity body. Chrome/Safari/Firefox report 2
and 4. IE10 2,3,4 (as XMLHttpRequest currently requires). I'm leaning
towards Chrome/Safari/Firefox here. Have a special task for when
headers are received, have a special task for when there's an entity
body and some of it is transmitted (and more if there's more) and have
a special task when you're done. In this case there's no entity body
so no task for that, so only 2 and 4.

FWIW, current sketch of Fetch is still being updated at
http://html5.org/temp/fetch.html for now. Hopefully it will soon be
more complete.


-- 
http://annevankesteren.nl/

Received on Wednesday, 13 March 2013 14:37:29 UTC