Summary: | Trying to access XMLHttpRequest.responseText or responseXML when they are not available should raise an exception | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||||
Component: | XML | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | jchaffraix | ||||||
Priority: | P3 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
Attachments: |
|
Description
Alexey Proskuryakov
2007-01-10 04:01:22 PST
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
|