From XMLHttpRequest spec draft: ------------------------ responseText of type DOMString, readonly If the state is not receiving or loaded, the user agent must raise an INVALID_STATE_ERR exception. ... responseXML of type Document, readonly If the state is not loaded, user agents must raise an INVALID_STATE_ERR exception. ------------------------
Created attachment 17309 [details] Patch + test cases Tested other browsers' behaviour : IE 7: raises an exception if readyState is not Loaded in both tests Firefox: does not raise any exception in both tests Opera: Fully implements the standard. Judging from the results, I have sided with the specification (which is close to IE behaviour) and fully implemented it. Patch tested on mac without any regression.
Comment on attachment 17309 [details] Patch + test cases + if (responseXML) return toJS(exec, responseXML); - return jsNull(); + else + return jsNull(); We normally do *not* do else after return in the WebKit project. + if (m_state < Receiving) { + ec = INVALID_STATE_ERR; + } We do not put braces around single-line bodies of if statements. +Should see "PASS" four times: + +PASSED +PASSED +PASSED +PASSED Probably should say "PASSED" or "PASS" consistently. Change looks good, so I'll say r=me, but it would be nice to fix these minor style issues.
Created attachment 17333 [details] Patches updated with Darin's comments
Comment on attachment 17333 [details] Patches updated with Darin's comments Please set the "review?" flag, not the "review+" flag. Thanks!
Comment on attachment 17333 [details] Patches updated with Darin's comments r=me
Landed in r27898.