Bug 101776 - [XHR2] XMLHttpRequest.status does not behave according to specification
Summary: [XHR2] XMLHttpRequest.status does not behave according to specification
Status: RESOLVED DUPLICATE of bug 45994
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: http://www.w3.org/TR/XMLHttpRequest2/...
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2012-11-09 10:33 PST by Chris Dumez
Modified: 2014-03-18 08:28 PDT (History)
15 users (show)

See Also:


Attachments
Results with different browsers (3.35 KB, text/plain)
2012-11-09 10:39 PST, Chris Dumez
no flags Details
Patch (9.95 KB, patch)
2012-11-09 11:38 PST, Chris Dumez
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch (35.02 KB, patch)
2012-11-09 14:25 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2012-11-09 10:33:57 PST
According to specification, the behavior for XMLHttpRequest.status should be as follows:

The status attribute must return the result of running these steps:
   * If the state is UNSENT or OPENED, return 0 and terminate these steps.
   * If the error flag is set, return 0 and terminate these steps.
   * Return the HTTP status code.

Currently, WebKit does:
  * Return 0 if the state in UNSET
  * Throw an INVALID_STATE_ERR if state is OPENED
  * Return HTTP status code (even if error flag is set)

Firefox and Opera both follow the spec exactly.

What IE9 does:
  * If the state is UNSENT or OPENED, throw an exception
  * If the error flag is set, throw an exception
  * Return HTTP status code.
Comment 1 Chris Dumez 2012-11-09 10:39:10 PST
Created attachment 173335 [details]
Results with different browsers
Comment 2 Chris Dumez 2012-11-09 10:40:06 PST
I attached the results of LayoutTests/http/tests/xmlhttprequest/status-after-abort.html with all major browsers.
Comment 3 Chris Dumez 2012-11-09 11:38:07 PST
Created attachment 173342 [details]
Patch
Comment 4 WebKit Review Bot 2012-11-09 13:40:14 PST
Comment on attachment 173342 [details]
Patch

Attachment 173342 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14788251

New failing tests:
fast/js/dfg-custom-getter-throw.html
fast/js/dfg-custom-getter-throw-inlined.html
Comment 5 Chris Dumez 2012-11-09 14:25:22 PST
Created attachment 173364 [details]
Patch

Update the following tests since they relied on XMLHTTPRequest.status to throw:
  fast/js/dfg-custom-getter-throw.html
  fast/js/dfg-custom-getter-throw-inlined.html
Comment 6 Alexey Proskuryakov 2012-11-09 14:27:45 PST
This changes many behaviors at once. To pick one, both IE and WebKit raise an exception in OPENED state. Why shouldn't the spec be changed to match the vast majority of browsers here?

Generally, speaking, Firefox, Opera and a spec combined don't have enough weight for us to change unless there is an additional good reason to.
Comment 7 Anders Carlsson 2014-02-05 11:07:34 PST
Comment on attachment 173364 [details]
Patch

Clearing review flag on patches from before 2014. If this patch is still relevant, please reset the r? flag.
Comment 8 youenn fablet 2014-02-10 00:55:37 PST
This bug is handled by bug 45994 last patch.
Once bug 45994 is closed, this bug should probably be closed as well.
Comment 9 youenn fablet 2014-03-18 08:28:36 PDT

*** This bug has been marked as a duplicate of bug 45994 ***