[Webkit-unassigned] [Bug 54118] XMLHttpRequest::abort() should call clearResponse()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 9 17:08:50 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=54118





--- Comment #14 from Jarred Nicholls <jarred.nicholls at gmail.com>  2011-02-09 17:08:50 PST ---
Ok, I am convinced that clearing the response is the right (i.e. safe) thing to do here.  I was debating on whether to revise this patch and create a clearResponseBuffers() function that was used in both clearResponse() and abort().  However, anytime a response error occurs (abort, network, generic, timeout), all of the response attributes/getters (status, statusText, headers, etc.) are not meant to be accessible according to W3.  Therefore, clearing the response "shouldn't matter" if we were compliant.  I would even further do checks on m_state and m_error in status/statusText, but it's technically not necessary since we do proper checks on the response variables; in other words, clearing the response nets the same effect as checking m_state/m_error in status/statusText.

Firefox allows access to status, statusText, and all headers even after an abort.
Opera throws DOM exceptions when accessing any of these fields after a response error/abort.
Haven't tested IE yet.

WebKit will allow access to status and statusText, but throw INVALID_STATE exceptions if trying to retrieve headers.  WebKit is completely inconsistent, and out of the 3 tested browsers, the only inconsistent one.

W3 says that an abort will both 1) set error flag to true, and 2) change the state to UNSENT.  It also says that for status, statusText, and the header getter functions, that if the error flag is true or the status is < HEADERS_RECEIVED, that these response attributes/getters should return 0/""/null values.  We don't follow the standard on status and statusText, and we throw an INVALID_STATE exception on the header getters.  We should make ourselves consistent across the board; but that is a separate issue and we can open another bug for that discussion.

With that said, this patch will get us "one step closer" to the W3 standard by making status and statusText behave according to spec.  We can talk about the header getters and whether an exception is the right thing to do in another conversation.  The spec 

I'll create the regression test(s) and report my findings in IE 6 & 8.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list