[Bug 27033] XHR request termination doesn't terminate queued tasks

https://www.w3.org/Bugs/Public/show_bug.cgi?id=27033

--- Comment #17 from Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com> ---
(In reply to Anne from comment #16)
> No, so per the specification timeout can no longer happen at that point, as
> you reached the point where you have received headers. 

I tested this in both Firefox and Chrome and both fire a timeout event after
the headers are received.

Here is  a test page where you can experiment with different timeout values.

http://mukilan.github.io/xhr_timeout_and_headers_received.html

Depending on your network latency, for some values you can observe that
timeouts do get triggered after the headers are received.

In my case a value of 500 ms resulted in the following events:
Event Type: readystatechange; Ready State: 1
Event Type: readystatechange; Ready State: 2 
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 3
Event Type: readystatechange; Ready State: 4 
Event Type: timeout; Ready State: 4

The spec says that a non-zero timeout will:

> cause fetching to terminate after the given time has passed. When the time 
> has passed, the request has not yet completed [...],

But neither the XHR spec nor the HTTP Fetch spec defines *when* a request is
considered to be complete.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 20 October 2014 18:30:42 UTC