[XHR] request error distinction: abort and error

Hi,

I would like to bring this topic back in the list: [XHR] remove "user
cancels request" [1]. It was quite a controversial topic and as far as I
recall the discussion was not clearly concluded.

We've had three different error cases to distinguish:
(A) Network initiated errors
(B) abort() call
(C) End user cancellation in the spec [2][3]: clicking on a stop button in
browser chrome, hitting escape, page navigation and window.stop() [4]

(A) and (B) are apparent; the question is whether (C) should be classified
as a network error or an abort error? Here's the implementation status
reported by @Yaffle. [5]

I support treating (C) as abort error. Semantically (B) and (C) are aligned
as behaviors to abort the request while (A) occurs when the request fails
by *error*. I believe, for authors, the request error handlers for (B) and
(C) have better chance to have the same code logic than that of (A) and
(C). (I suppose the ways to distinguish between (B) and (C) are beyond the
scope of XHR.) Accordingly, it'd be necessary to change the wordings as:

(before)
-> If the end user cancels the request
    This is an abort error.

(after)
-> If abort() method is invoked
-> If window.stop() is invoked
-> If the request cancellation is trigger by the end user
    This is an abort error.
Note: The request cancellations by the end user include clicking on a stop
button in browser chrome, hitting escape, page navigation, etc.

WDYT?


[1]
http://www.w3.org/Search/Mail/Public/advanced_search?keywords=&hdr-1-name=subject&hdr-1-query=%5BXHR%5D+remove+%22user+cancels+request%22&hdr-2-name=from&hdr-2-query=&hdr-3-name=message-id&hdr-3-query=&period_month=&period_year=&index-type=g&index-grp=Public__FULL&type-index=&resultsperpage=20&sortby=date
[2]
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#infrastructure-for-the-send()-method
[3] http://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method
[4] https://developer.mozilla.org/en-US/docs/Web/API/window.stop
[5]
https://github.com/w3c/web-platform-tests/issues/241#issuecomment-22750928


-- 

Jungkee Song

Received on Friday, 16 August 2013 17:26:07 UTC