Changeset 161058 in webkit


Ignore:
Timestamp:
Dec 24, 2013 12:43:03 PM (10 years ago)
Author:
rniwa@webkit.org
Message:

Unreviewed, rolling out r161051.
http://trac.webkit.org/changeset/161051
https://bugs.webkit.org/show_bug.cgi?id=45994

Caused two DFG tests to hit assertions due to a separate bug

Source/WebCore:

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::status):
(WebCore::XMLHttpRequest::statusText):

  • xml/XMLHttpRequest.h:
  • xml/XMLHttpRequest.idl:

LayoutTests:

  • http/tests/xmlhttprequest/exceptions-expected.txt:
  • http/tests/xmlhttprequest/exceptions.html:
  • http/tests/xmlhttprequest/status-after-abort-expected.txt:
  • http/tests/xmlhttprequest/zero-length-response-expected.txt:
  • js/dom/dfg-custom-getter-throw-expected.txt:
  • js/dom/script-tests/dfg-custom-getter-throw-inlined.js:

(foo):
(bar):

  • js/dom/script-tests/dfg-custom-getter-throw.js:

(foo):
(bar):

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r161056 r161058  
     12013-12-24  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Unreviewed, rolling out r161051.
     4        http://trac.webkit.org/changeset/161051
     5        https://bugs.webkit.org/show_bug.cgi?id=45994
     6
     7        Caused two DFG tests to hit assertions due to a separate bug
     8
     9        * http/tests/xmlhttprequest/exceptions-expected.txt:
     10        * http/tests/xmlhttprequest/exceptions.html:
     11        * http/tests/xmlhttprequest/status-after-abort-expected.txt:
     12        * http/tests/xmlhttprequest/zero-length-response-expected.txt:
     13        * js/dom/dfg-custom-getter-throw-expected.txt:
     14        * js/dom/script-tests/dfg-custom-getter-throw-inlined.js:
     15        (foo):
     16        (bar):
     17        * js/dom/script-tests/dfg-custom-getter-throw.js:
     18        (foo):
     19        (bar):
     20
    1212013-12-24  Radu Stavila  <stavila@adobe.com>
    222
  • trunk/LayoutTests/http/tests/xmlhttprequest/exceptions-expected.txt

    r161051 r161058  
    77PASS: req.setRequestHeader() threw exception TypeError: Not enough arguments.
    88PASS: req.setRequestHeader("Foo") threw exception TypeError: Not enough arguments.
     9PASS: req.status() threw exception Error: InvalidStateError: DOM Exception 11.
     10PASS: req.statusText() threw exception Error: InvalidStateError: DOM Exception 11.
    911send()
    1012PASS: req.send(null) threw exception Error: InvalidStateError: DOM Exception 11.
  • trunk/LayoutTests/http/tests/xmlhttprequest/exceptions.html

    r161051 r161058  
    6565    shouldThrow('req.setRequestHeader()');
    6666    shouldThrow('req.setRequestHeader("Foo")');
     67    shouldThrow('req.status()');
     68    shouldThrow('req.statusText()');
    6769   
    6870    req.send(null);
  • trunk/LayoutTests/http/tests/xmlhttprequest/status-after-abort-expected.txt

    r161051 r161058  
    33A newly created request. Response status: 0; statusText: ''; readyState: 0
    44Opening...
    5 Onreadystatechange. Response status: 0; statusText: ''; readyState: 1
    6 Opened request. Response status: 0; statusText: ''; readyState: 1
    7 Sent request. Response status: 0; statusText: ''; readyState: 1
     5Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 1
     6Opened request. Response status: [exception]; statusText: '[exception]'; readyState: 1
     7Sent request. Response status: [exception]; statusText: '[exception]'; readyState: 1
    88Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 2
    99Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 3
    1010Onreadystatechange. Response status: 200; statusText: 'OK'; readyState: 4
    1111Aborting the request...
    12 After aborting the request. Response status: 0; statusText: ''; readyState: 0
     12After aborting the request. Response status: 200; statusText: 'OK'; readyState: 0
    1313Reopening the request to check that the status is reset...
    14 Onreadystatechange. Response status: 0; statusText: ''; readyState: 1
     14Onreadystatechange. Response status: [exception]; statusText: '[exception]'; readyState: 1
    1515Done.
    1616
  • trunk/LayoutTests/http/tests/xmlhttprequest/zero-length-response-expected.txt

    r161051 r161058  
    99after setting onreadystatechange: Uninitialized
    1010onreadystatechange: Open
    11   Status: 0
    12   StatusText: ""
     11  Exception getting status: InvalidStateError: DOM Exception 11
     12  Exception getting StatusText: InvalidStateError: DOM Exception 11
    1313  ResponseText: ""
    1414  ResponseXML: null
    1515  ResponseXML serialized: n/a
    1616after open(): Open
    17   Status: 0
    18   StatusText: ""
     17  Exception getting status: InvalidStateError: DOM Exception 11
     18  Exception getting StatusText: InvalidStateError: DOM Exception 11
    1919  ResponseText: ""
    2020  ResponseXML: null
  • trunk/LayoutTests/js/dom/dfg-custom-getter-throw-expected.txt

    r161051 r161058  
    44
    55
    6 PASS bar(i >= 100) is "Returned result: "
    7 PASS bar(i >= 100) is "Returned result: "
    8 PASS bar(i >= 100) is "Returned result: "
    9 PASS bar(i >= 100) is "Returned result: "
    10 PASS bar(i >= 100) is "Returned result: "
    11 PASS bar(i >= 100) is "Returned result: "
    12 PASS bar(i >= 100) is "Returned result: "
    13 PASS bar(i >= 100) is "Returned result: "
    14 PASS bar(i >= 100) is "Returned result: "
    15 PASS bar(i >= 100) is "Returned result: "
    16 PASS bar(i >= 100) is "Returned result: "
    17 PASS bar(i >= 100) is "Returned result: "
    18 PASS bar(i >= 100) is "Returned result: "
    19 PASS bar(i >= 100) is "Returned result: "
    20 PASS bar(i >= 100) is "Returned result: "
    21 PASS bar(i >= 100) is "Returned result: "
    22 PASS bar(i >= 100) is "Returned result: "
    23 PASS bar(i >= 100) is "Returned result: "
    24 PASS bar(i >= 100) is "Returned result: "
    25 PASS bar(i >= 100) is "Returned result: "
    26 PASS bar(i >= 100) is "Returned result: "
    27 PASS bar(i >= 100) is "Returned result: "
    28 PASS bar(i >= 100) is "Returned result: "
    29 PASS bar(i >= 100) is "Returned result: "
    30 PASS bar(i >= 100) is "Returned result: "
    31 PASS bar(i >= 100) is "Returned result: "
    32 PASS bar(i >= 100) is "Returned result: "
    33 PASS bar(i >= 100) is "Returned result: "
    34 PASS bar(i >= 100) is "Returned result: "
    35 PASS bar(i >= 100) is "Returned result: "
    36 PASS bar(i >= 100) is "Returned result: "
    37 PASS bar(i >= 100) is "Returned result: "
    38 PASS bar(i >= 100) is "Returned result: "
    39 PASS bar(i >= 100) is "Returned result: "
    40 PASS bar(i >= 100) is "Returned result: "
    41 PASS bar(i >= 100) is "Returned result: "
    42 PASS bar(i >= 100) is "Returned result: "
    43 PASS bar(i >= 100) is "Returned result: "
    44 PASS bar(i >= 100) is "Returned result: "
    45 PASS bar(i >= 100) is "Returned result: "
    46 PASS bar(i >= 100) is "Returned result: "
    47 PASS bar(i >= 100) is "Returned result: "
    48 PASS bar(i >= 100) is "Returned result: "
    49 PASS bar(i >= 100) is "Returned result: "
    50 PASS bar(i >= 100) is "Returned result: "
    51 PASS bar(i >= 100) is "Returned result: "
    52 PASS bar(i >= 100) is "Returned result: "
    53 PASS bar(i >= 100) is "Returned result: "
    54 PASS bar(i >= 100) is "Returned result: "
    55 PASS bar(i >= 100) is "Returned result: "
    56 PASS bar(i >= 100) is "Returned result: "
    57 PASS bar(i >= 100) is "Returned result: "
    58 PASS bar(i >= 100) is "Returned result: "
    59 PASS bar(i >= 100) is "Returned result: "
    60 PASS bar(i >= 100) is "Returned result: "
    61 PASS bar(i >= 100) is "Returned result: "
    62 PASS bar(i >= 100) is "Returned result: "
    63 PASS bar(i >= 100) is "Returned result: "
    64 PASS bar(i >= 100) is "Returned result: "
    65 PASS bar(i >= 100) is "Returned result: "
    66 PASS bar(i >= 100) is "Returned result: "
    67 PASS bar(i >= 100) is "Returned result: "
    68 PASS bar(i >= 100) is "Returned result: "
    69 PASS bar(i >= 100) is "Returned result: "
    70 PASS bar(i >= 100) is "Returned result: "
    71 PASS bar(i >= 100) is "Returned result: "
    72 PASS bar(i >= 100) is "Returned result: "
    73 PASS bar(i >= 100) is "Returned result: "
    74 PASS bar(i >= 100) is "Returned result: "
    75 PASS bar(i >= 100) is "Returned result: "
    76 PASS bar(i >= 100) is "Returned result: "
    77 PASS bar(i >= 100) is "Returned result: "
    78 PASS bar(i >= 100) is "Returned result: "
    79 PASS bar(i >= 100) is "Returned result: "
    80 PASS bar(i >= 100) is "Returned result: "
    81 PASS bar(i >= 100) is "Returned result: "
    82 PASS bar(i >= 100) is "Returned result: "
    83 PASS bar(i >= 100) is "Returned result: "
    84 PASS bar(i >= 100) is "Returned result: "
    85 PASS bar(i >= 100) is "Returned result: "
    86 PASS bar(i >= 100) is "Returned result: "
    87 PASS bar(i >= 100) is "Returned result: "
    88 PASS bar(i >= 100) is "Returned result: "
    89 PASS bar(i >= 100) is "Returned result: "
    90 PASS bar(i >= 100) is "Returned result: "
    91 PASS bar(i >= 100) is "Returned result: "
    92 PASS bar(i >= 100) is "Returned result: "
    93 PASS bar(i >= 100) is "Returned result: "
    94 PASS bar(i >= 100) is "Returned result: "
    95 PASS bar(i >= 100) is "Returned result: "
    96 PASS bar(i >= 100) is "Returned result: "
    97 PASS bar(i >= 100) is "Returned result: "
    98 PASS bar(i >= 100) is "Returned result: "
    99 PASS bar(i >= 100) is "Returned result: "
    100 PASS bar(i >= 100) is "Returned result: "
    101 PASS bar(i >= 100) is "Returned result: "
    102 PASS bar(i >= 100) is "Returned result: "
    103 PASS bar(i >= 100) is "Returned result: "
    104 PASS bar(i >= 100) is "Returned result: "
    105 PASS bar(i >= 100) is "Returned result: "
     6PASS bar(i >= 100) is "Returned result: 0"
     7PASS bar(i >= 100) is "Returned result: 0"
     8PASS bar(i >= 100) is "Returned result: 0"
     9PASS bar(i >= 100) is "Returned result: 0"
     10PASS bar(i >= 100) is "Returned result: 0"
     11PASS bar(i >= 100) is "Returned result: 0"
     12PASS bar(i >= 100) is "Returned result: 0"
     13PASS bar(i >= 100) is "Returned result: 0"
     14PASS bar(i >= 100) is "Returned result: 0"
     15PASS bar(i >= 100) is "Returned result: 0"
     16PASS bar(i >= 100) is "Returned result: 0"
     17PASS bar(i >= 100) is "Returned result: 0"
     18PASS bar(i >= 100) is "Returned result: 0"
     19PASS bar(i >= 100) is "Returned result: 0"
     20PASS bar(i >= 100) is "Returned result: 0"
     21PASS bar(i >= 100) is "Returned result: 0"
     22PASS bar(i >= 100) is "Returned result: 0"
     23PASS bar(i >= 100) is "Returned result: 0"
     24PASS bar(i >= 100) is "Returned result: 0"
     25PASS bar(i >= 100) is "Returned result: 0"
     26PASS bar(i >= 100) is "Returned result: 0"
     27PASS bar(i >= 100) is "Returned result: 0"
     28PASS bar(i >= 100) is "Returned result: 0"
     29PASS bar(i >= 100) is "Returned result: 0"
     30PASS bar(i >= 100) is "Returned result: 0"
     31PASS bar(i >= 100) is "Returned result: 0"
     32PASS bar(i >= 100) is "Returned result: 0"
     33PASS bar(i >= 100) is "Returned result: 0"
     34PASS bar(i >= 100) is "Returned result: 0"
     35PASS bar(i >= 100) is "Returned result: 0"
     36PASS bar(i >= 100) is "Returned result: 0"
     37PASS bar(i >= 100) is "Returned result: 0"
     38PASS bar(i >= 100) is "Returned result: 0"
     39PASS bar(i >= 100) is "Returned result: 0"
     40PASS bar(i >= 100) is "Returned result: 0"
     41PASS bar(i >= 100) is "Returned result: 0"
     42PASS bar(i >= 100) is "Returned result: 0"
     43PASS bar(i >= 100) is "Returned result: 0"
     44PASS bar(i >= 100) is "Returned result: 0"
     45PASS bar(i >= 100) is "Returned result: 0"
     46PASS bar(i >= 100) is "Returned result: 0"
     47PASS bar(i >= 100) is "Returned result: 0"
     48PASS bar(i >= 100) is "Returned result: 0"
     49PASS bar(i >= 100) is "Returned result: 0"
     50PASS bar(i >= 100) is "Returned result: 0"
     51PASS bar(i >= 100) is "Returned result: 0"
     52PASS bar(i >= 100) is "Returned result: 0"
     53PASS bar(i >= 100) is "Returned result: 0"
     54PASS bar(i >= 100) is "Returned result: 0"
     55PASS bar(i >= 100) is "Returned result: 0"
     56PASS bar(i >= 100) is "Returned result: 0"
     57PASS bar(i >= 100) is "Returned result: 0"
     58PASS bar(i >= 100) is "Returned result: 0"
     59PASS bar(i >= 100) is "Returned result: 0"
     60PASS bar(i >= 100) is "Returned result: 0"
     61PASS bar(i >= 100) is "Returned result: 0"
     62PASS bar(i >= 100) is "Returned result: 0"
     63PASS bar(i >= 100) is "Returned result: 0"
     64PASS bar(i >= 100) is "Returned result: 0"
     65PASS bar(i >= 100) is "Returned result: 0"
     66PASS bar(i >= 100) is "Returned result: 0"
     67PASS bar(i >= 100) is "Returned result: 0"
     68PASS bar(i >= 100) is "Returned result: 0"
     69PASS bar(i >= 100) is "Returned result: 0"
     70PASS bar(i >= 100) is "Returned result: 0"
     71PASS bar(i >= 100) is "Returned result: 0"
     72PASS bar(i >= 100) is "Returned result: 0"
     73PASS bar(i >= 100) is "Returned result: 0"
     74PASS bar(i >= 100) is "Returned result: 0"
     75PASS bar(i >= 100) is "Returned result: 0"
     76PASS bar(i >= 100) is "Returned result: 0"
     77PASS bar(i >= 100) is "Returned result: 0"
     78PASS bar(i >= 100) is "Returned result: 0"
     79PASS bar(i >= 100) is "Returned result: 0"
     80PASS bar(i >= 100) is "Returned result: 0"
     81PASS bar(i >= 100) is "Returned result: 0"
     82PASS bar(i >= 100) is "Returned result: 0"
     83PASS bar(i >= 100) is "Returned result: 0"
     84PASS bar(i >= 100) is "Returned result: 0"
     85PASS bar(i >= 100) is "Returned result: 0"
     86PASS bar(i >= 100) is "Returned result: 0"
     87PASS bar(i >= 100) is "Returned result: 0"
     88PASS bar(i >= 100) is "Returned result: 0"
     89PASS bar(i >= 100) is "Returned result: 0"
     90PASS bar(i >= 100) is "Returned result: 0"
     91PASS bar(i >= 100) is "Returned result: 0"
     92PASS bar(i >= 100) is "Returned result: 0"
     93PASS bar(i >= 100) is "Returned result: 0"
     94PASS bar(i >= 100) is "Returned result: 0"
     95PASS bar(i >= 100) is "Returned result: 0"
     96PASS bar(i >= 100) is "Returned result: 0"
     97PASS bar(i >= 100) is "Returned result: 0"
     98PASS bar(i >= 100) is "Returned result: 0"
     99PASS bar(i >= 100) is "Returned result: 0"
     100PASS bar(i >= 100) is "Returned result: 0"
     101PASS bar(i >= 100) is "Returned result: 0"
     102PASS bar(i >= 100) is "Returned result: 0"
     103PASS bar(i >= 100) is "Returned result: 0"
     104PASS bar(i >= 100) is "Returned result: 0"
     105PASS bar(i >= 100) is "Returned result: 0"
    106106PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11"
    107107PASS bar(i >= 100) is "Threw exception: Error: InvalidStateError: DOM Exception 11"
  • trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw-inlined.js

    r161051 r161058  
    44
    55function foo(x) {
    6     return x.responseText;
     6    return x.status;
    77}
    88
     
    1111}
    1212
    13 function bar(binary) {
     13function bar(doOpen) {
    1414    var x = new XMLHttpRequest();
    15     x.open("GET", "http://foo.bar.com/");
    16     if (binary)
    17         x.responseType = "arraybuffer";
     15    if (doOpen)
     16        x.open("GET", "http://foo.bar.com/");
    1817    try {
    1918        return "Returned result: " + baz(x);
     
    2726
    2827for (var i = 0; i < 200; i = dfgIncrement({f:baz, i:i + 1, n:50})) {
    29     shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \"");
     28    shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");
    3029}
    3130
  • trunk/LayoutTests/js/dom/script-tests/dfg-custom-getter-throw.js

    r161051 r161058  
    44
    55function foo(x) {
    6     return x.responseText;
     6    return x.status;
    77}
    88
    9 function bar(binary) {
     9function bar(doOpen) {
    1010    var x = new XMLHttpRequest();
    11     x.open("GET", "http://foo.bar.com/");
    12     if (binary)
    13         x.responseType = "arraybuffer";
     11    if (doOpen)
     12        x.open("GET", "http://foo.bar.com/");
    1413    try {
    1514        return "Returned result: " + foo(x);
     
    2019
    2120for (var i = 0; i < 200; ++i) {
    22     shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: \"");
     21    shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: Error: InvalidStateError: DOM Exception 11\"" : "\"Returned result: 0\"");
    2322}
    2423
  • trunk/Source/WebCore/ChangeLog

    r161054 r161058  
     12013-12-24  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Unreviewed, rolling out r161051.
     4        http://trac.webkit.org/changeset/161051
     5        https://bugs.webkit.org/show_bug.cgi?id=45994
     6
     7        Caused two DFG tests to hit assertions due to a separate bug
     8
     9        * xml/XMLHttpRequest.cpp:
     10        (WebCore::XMLHttpRequest::status):
     11        (WebCore::XMLHttpRequest::statusText):
     12        * xml/XMLHttpRequest.h:
     13        * xml/XMLHttpRequest.idl:
     14
    1152013-12-24  Mihnea Ovidenie  <mihnea@adobe.com>
    216
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r161051 r161058  
    10901090}
    10911091
    1092 int XMLHttpRequest::status() const
    1093 {
    1094     if (m_state == UNSENT || m_state == OPENED || m_error)
    1095         return 0;
    1096 
     1092int XMLHttpRequest::status(ExceptionCode& ec) const
     1093{
    10971094    if (m_response.httpStatusCode())
    10981095        return m_response.httpStatusCode();
    10991096
     1097    if (m_state == OPENED) {
     1098        // Firefox only raises an exception in this state; we match it.
     1099        // Note the case of local file requests, where we have no HTTP response code! Firefox never raises an exception for those, but we match HTTP case for consistency.
     1100        ec = INVALID_STATE_ERR;
     1101    }
     1102
    11001103    return 0;
    11011104}
    11021105
    1103 String XMLHttpRequest::statusText() const
    1104 {
    1105     if (m_state == UNSENT || m_state == OPENED || m_error)
    1106         return String();
    1107 
     1106String XMLHttpRequest::statusText(ExceptionCode& ec) const
     1107{
    11081108    if (!m_response.httpStatusText().isNull())
    11091109        return m_response.httpStatusText();
     1110
     1111    if (m_state == OPENED) {
     1112        // See comments in status() above.
     1113        ec = INVALID_STATE_ERR;
     1114    }
    11101115
    11111116    return String();
  • trunk/Source/WebCore/xml/XMLHttpRequest.h

    r161051 r161058  
    8686
    8787    const URL& url() const { return m_url; }
    88     String statusText() const;
    89     int status() const;
     88    String statusText(ExceptionCode&) const;
     89    int status(ExceptionCode&) const;
    9090    State readyState() const;
    9191    bool withCredentials() const { return m_includeCredentials; }
  • trunk/Source/WebCore/xml/XMLHttpRequest.idl

    r161051 r161058  
    8989    [GetterRaisesException, CachedAttribute, CustomGetter] readonly attribute Object response;
    9090
    91     readonly attribute unsigned short status;
    92     readonly attribute DOMString statusText;
     91    [GetterRaisesException] readonly attribute unsigned short status;
     92    [GetterRaisesException] readonly attribute DOMString statusText;
    9393
    9494    // Extension
Note: See TracChangeset for help on using the changeset viewer.