Changeset 220731 in webkit


Ignore:
Timestamp:
Aug 14, 2017 6:36:04 PM (7 years ago)
Author:
Chris Dumez
Message:

XHR should only fire an abort event if the cancellation was requested by the client
https://bugs.webkit.org/show_bug.cgi?id=175546

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline several WPT tests now that a different error is sometimes used and that
more checks are passing.

  • web-platform-tests/XMLHttpRequest/open-url-multi-window-4-expected.txt:
  • web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt:
  • web-platform-tests/cors/allow-headers-expected.txt:
  • web-platform-tests/cors/origin-expected.txt:
  • web-platform-tests/cors/request-headers-expected.txt:
  • web-platform-tests/cors/response-headers-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_multi-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_null-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_origin-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_space-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt:
  • web-platform-tests/resource-timing/resource_TAO_zero-expected.txt:

Source/WebCore:

XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
Blink and Gecko already match the specification.

Specification:

Test: http/tests/navigation/page-cache-xhr-in-pagehide.html

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::abort):
(WebCore::XMLHttpRequest::abortError):
(WebCore::XMLHttpRequest::didFail):

  • xml/XMLHttpRequest.h:

LayoutTests:

  • http/tests/navigation/page-cache-xhr-expected.txt:
  • http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt: Copied from LayoutTests/http/tests/navigation/page-cache-xhr-expected.txt.
  • http/tests/navigation/page-cache-xhr-in-pagehide.html: Copied from LayoutTests/http/tests/navigation/page-cache-xhr.html.
  • http/tests/navigation/page-cache-xhr.html:

When an XHR is pending and navigating away, we would send an abort event before the navigation and an error event after
restoring from PageCache. This bug was not seen before because the test only checked for error events, not abort ones.
The expected behavior is now that we fire an error event before navigating away, similar to the non-PageCache case.
The only case where the error event should be fired after restoring from PageCache is when an XHR is done in the pagehide
event handler, because it is too late to send the error event to the page before navigating in this case. I added test
coverage for this case.

  • http/tests/xmlhttprequest/navigation-should-abort-expected.txt:
  • http/tests/xmlhttprequest/navigation-should-abort.html:

This test was expecting an abort event on navigation which is against spec. This test was failing in Blink too.
Update the test to expect an error event instead.

Location:
trunk
Files:
26 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r220730 r220731  
     12017-08-14  Chris Dumez  <cdumez@apple.com>
     2
     3        XHR should only fire an abort event if the cancellation was requested by the client
     4        https://bugs.webkit.org/show_bug.cgi?id=175546
     5
     6        Reviewed by Youenn Fablet.
     7
     8        * http/tests/navigation/page-cache-xhr-expected.txt:
     9        * http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt: Copied from LayoutTests/http/tests/navigation/page-cache-xhr-expected.txt.
     10        * http/tests/navigation/page-cache-xhr-in-pagehide.html: Copied from LayoutTests/http/tests/navigation/page-cache-xhr.html.
     11        * http/tests/navigation/page-cache-xhr.html:
     12        When an XHR is pending and navigating away, we would send an abort event before the navigation and an error event after
     13        restoring from PageCache. This bug was not seen before because the test only checked for error events, not abort ones.
     14        The expected behavior is now that we fire an error event before navigating away, similar to the non-PageCache case.
     15        The only case where the error event should be fired after restoring from PageCache is when an XHR is done in the pagehide
     16        event handler, because it is too late to send the error event to the page before navigating in this case. I added test
     17        coverage for this case.
     18
     19        * http/tests/xmlhttprequest/navigation-should-abort-expected.txt:
     20        * http/tests/xmlhttprequest/navigation-should-abort.html:
     21        This test was expecting an abort event on navigation which is against spec. This test was failing in Blink too.
     22        Update the test to expect an error event instead.
     23
    1242017-08-14  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/LayoutTests/fast/frames/frame-unload-crash-expected.txt

    r204163 r220731  
    11frame "<!--framePath //<!--frame0-->/<!--frame0-->-->" - has 1 onunload handler(s)
    2 CONSOLE MESSAGE: line 13: XMLHttpRequest cannot load frame-unload-crash-2.html due to access control checks.
    32This is a test for bug 25136: CRASH in DocumentLoader::removeSubresourceLoader due to null m_frame. If successful, PASS should be printed below.
    43
  • trunk/LayoutTests/http/tests/navigation/page-cache-xhr-expected.txt

    r181480 r220731  
    55
    66pageshow - not from cache
     7PASS Executed the XHR error handler before entering PageCache
     8PASS xhr.status is 0
    79pagehide - entering cache
    810pageshow - from cache
    911PASS Page did enter and was restored from the page cache
    10 PASS Executed the XHR error handler after restoring from page cache
    11 PASS xhr.status is 0
    1212PASS successfullyParsed is true
    1313
  • trunk/LayoutTests/http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt

    r220730 r220731  
     1CONSOLE MESSAGE: line 35: XMLHttpRequest cannot load http://127.0.0.1:8000/resources/load-and-stall.cgi?name=load-and-stall.cgi&stallFor=3&stallAt=0&mimeType=text/plain due to access control checks.
    12Tests that a page with a loading XMLHttpRequest goes into the page cache.
    23
     
    89pageshow - from cache
    910PASS Page did enter and was restored from the page cache
    10 PASS Executed the XHR error handler after restoring from page cache
     11PASS Executed the XHR error handler after restoring from PageCache
    1112PASS xhr.status is 0
    1213PASS successfullyParsed is true
  • trunk/LayoutTests/http/tests/navigation/page-cache-xhr-in-pagehide.html

    r220730 r220731  
    2727        finishJSTest();
    2828    }
     29    xhr = new XMLHttpRequest();
     30    xhr.onload = xhrLoaded;
     31    xhr.onabort = xhrAbort;
     32    xhr.onerror = xhrError;
     33    // Slow loading XHR (3-second stall).
     34    xhr.open("GET", "/resources/load-and-stall.cgi?name=load-and-stall.cgi&stallFor=3&stallAt=0&mimeType=text/plain", true);
     35    xhr.send();
    2936}, false);
    3037
     
    3542}
    3643
     44function xhrAbort() {
     45    testFailed("Executed the XHR abort handler unexpectedly");
     46    finishJSTest();
     47}
     48
    3749function xhrError() {
    3850    if (restoredFromPageCache)
    39         testPassed("Executed the XHR error handler after restoring from page cache");
     51        testPassed("Executed the XHR error handler after restoring from PageCache");
    4052    else
    41         testFailed("Executed the XHR error handler before restoring from page cache");
    42 
     53        testFailed("Executed the XHR error handler before entering PageCache");
    4354    shouldBe("xhr.status", "0");
    4455    finishJSTest();
     
    4657
    4758window.addEventListener('load', function() {
    48     xhr = new XMLHttpRequest();
    49     xhr.onload = xhrLoaded;
    50     xhr.onerror = xhrError;
    51     // Slow loading XHR (3-second stall).
    52     xhr.open("GET", "/resources/load-and-stall.cgi?name=load-and-stall.cgi&stallFor=3&stallAt=0&mimeType=text/plain", true);
    53     xhr.send();
    54 
    5559    // This needs to happen in a setTimeout because a navigation inside the onload handler would
    5660    // not create a history entry.
  • trunk/LayoutTests/http/tests/navigation/page-cache-xhr.html

    r196988 r220731  
    1818        testPassed("Page did enter and was restored from the page cache");
    1919        restoredFromPageCache = true;
     20        setTimeout(finishJSTest, 0);
    2021    }
    2122}, false);
     
    3536}
    3637
     38function xhrAbort() {
     39    testFailed("Executed the XHR abort handler unexpectedly");
     40    finishJSTest();
     41}
     42
    3743function xhrError() {
    38     if (restoredFromPageCache)
    39         testPassed("Executed the XHR error handler after restoring from page cache");
    40     else
    41         testFailed("Executed the XHR error handler before restoring from page cache");
     44    if (restoredFromPageCache) {
     45        testFailed("Executed the XHR error handler after restoring from PageCache");
     46        return;
     47    }
    4248
     49    testPassed("Executed the XHR error handler before entering PageCache");
    4350    shouldBe("xhr.status", "0");
    44     finishJSTest();
    4551}
    4652
     
    4854    xhr = new XMLHttpRequest();
    4955    xhr.onload = xhrLoaded;
     56    xhr.onabort = xhrAbort;
    5057    xhr.onerror = xhrError;
    5158    // Slow loading XHR (3-second stall).
  • trunk/LayoutTests/http/tests/xmlhttprequest/navigation-should-abort-expected.txt

    r144430 r220731  
    1 CONSOLE MESSAGE: line 14: PASS: Expected 'abort', got 'abort'.
     1CONSOLE MESSAGE: line 11: PASS: Expected 'error', got 'error'.
    22If this text shows up, you've successfully navigated to 'navigation-target.html'.
  • trunk/LayoutTests/http/tests/xmlhttprequest/navigation-should-abort.html

    r144430 r220731  
    99        req.open("GET", "resources/endlessxml.php");
    1010        req.onerror = function () {
    11             console.log("FAIL: Expected 'abort', got 'error'.");
     11            console.log("PASS: Expected 'error', got 'error'.");
    1212        };
    1313        req.onabort = function () {
    14             console.log("PASS: Expected 'abort', got 'abort'.");
     14            console.log("FAIL: Expected 'error', got 'abort'.");
    1515        };
    1616        req.send(null);
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r220707 r220731  
     12017-08-14  Chris Dumez  <cdumez@apple.com>
     2
     3        XHR should only fire an abort event if the cancellation was requested by the client
     4        https://bugs.webkit.org/show_bug.cgi?id=175546
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Rebaseline several WPT tests now that a different error is sometimes used and that
     9        more checks are passing.
     10
     11        * web-platform-tests/XMLHttpRequest/open-url-multi-window-4-expected.txt:
     12        * web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt:
     13        * web-platform-tests/cors/allow-headers-expected.txt:
     14        * web-platform-tests/cors/origin-expected.txt:
     15        * web-platform-tests/cors/request-headers-expected.txt:
     16        * web-platform-tests/cors/response-headers-expected.txt:
     17        * web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt:
     18        * web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt:
     19        * web-platform-tests/resource-timing/resource_TAO_multi-expected.txt:
     20        * web-platform-tests/resource-timing/resource_TAO_null-expected.txt:
     21        * web-platform-tests/resource-timing/resource_TAO_origin-expected.txt:
     22        * web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt:
     23        * web-platform-tests/resource-timing/resource_TAO_space-expected.txt:
     24        * web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt:
     25        * web-platform-tests/resource-timing/resource_TAO_zero-expected.txt:
     26
    1272017-08-14  Chris Dumez  <cdumez@apple.com>
    228
  • trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-url-multi-window-4-expected.txt

    r204090 r220731  
    11
    2 FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 4; evil) assert_true: should get an error event expected true got false
     2PASS XMLHttpRequest: open() resolving URLs (multi-Window; 4; evil)
    33
  • trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt

    r219663 r220731  
    11Blocked access to external URL http://nonexistent-origin.localhost}:8800/
    22
    3 FAIL XMLHttpRequest: The send() method: Throw a "throw an "NetworkError" exception when Network error happens (synchronous flag is set) assert_throws: function "function ()
    4             {
    5                 xhr.send("Test Message");
    6             }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
     3PASS XMLHttpRequest: The send() method: Throw a "throw an "NetworkError" exception when Network error happens (synchronous flag is set)
    74
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cors/allow-headers-expected.txt

    r219663 r220731  
    4646
    4747
    48 FAIL Allow origin: * The operation was aborted.
    49 FAIL Allow origin: _*__ The operation was aborted.
    50 FAIL Allow origin: [tab]* The operation was aborted.
    51 FAIL Allow origin: http://localhost:8800 The operation was aborted.
    52 FAIL Allow origin: _http://localhost:8800 The operation was aborted.
    53 FAIL Allow origin: _http://localhost:8800___[tab]_ The operation was aborted.
    54 FAIL Allow origin: [tab]http://localhost:8800 The operation was aborted.
    55 FAIL Disallow origin: http://www1.localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    56 FAIL Disallow origin: //localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    57 FAIL Disallow origin: ://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    58 FAIL Disallow origin: ftp://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    59 FAIL Disallow origin: http:://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    60 FAIL Disallow origin: http:/localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    61 FAIL Disallow origin: http:localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    62 FAIL Disallow origin: localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    63 FAIL Disallow origin: http://localhost:8800? assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    64 FAIL Disallow origin: http://localhost:8800/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    65 FAIL Disallow origin: http://localhost:8800 / assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    66 FAIL Disallow origin: http://localhost:8800# assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    67 FAIL Disallow origin: http://localhost:8800%23 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    68 FAIL Disallow origin: http://localhost:8800:80 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    69 FAIL Disallow origin: http://localhost:8800, * assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    70 FAIL Disallow origin: http://localhost:8800\0 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    71 FAIL Disallow origin: HTTP://LOCALHOST:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    72 FAIL Disallow origin: HTTP://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    73 FAIL Disallow origin: - assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    74 FAIL Disallow origin: ** assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    75 FAIL Disallow origin: \0* assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    76 FAIL Disallow origin: *\0 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    77 FAIL Disallow origin: '*' assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    78 FAIL Disallow origin: "*" assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    79 FAIL Disallow origin: * * assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    80 FAIL Disallow origin: *http://* assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    81 FAIL Disallow origin: *http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    82 FAIL Disallow origin: * http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    83 FAIL Disallow origin: *, http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    84 FAIL Disallow origin: \0http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    85 FAIL Disallow origin: null http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    86 FAIL Disallow origin: http://example.net assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    87 FAIL Disallow origin: null assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    88 FAIL Disallow origin:  assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    89 FAIL Disallow origin: http://localhost:8800/cors/allow-headers.htm assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    90 FAIL Disallow origin: http://localhost:8800/cors/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    91 FAIL Disallow origin: http://www1.localhost:8800/cors/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
     48FAIL Allow origin: *  A network error occurred.
     49FAIL Allow origin: _*__  A network error occurred.
     50FAIL Allow origin: [tab]*  A network error occurred.
     51FAIL Allow origin: http://localhost:8800  A network error occurred.
     52FAIL Allow origin: _http://localhost:8800  A network error occurred.
     53FAIL Allow origin: _http://localhost:8800___[tab]_  A network error occurred.
     54FAIL Allow origin: [tab]http://localhost:8800  A network error occurred.
     55PASS Disallow origin: http://www1.localhost:8800
     56PASS Disallow origin: //localhost:8800
     57PASS Disallow origin: ://localhost:8800
     58PASS Disallow origin: ftp://localhost:8800
     59PASS Disallow origin: http:://localhost:8800
     60PASS Disallow origin: http:/localhost:8800
     61PASS Disallow origin: http:localhost:8800
     62PASS Disallow origin: localhost:8800
     63PASS Disallow origin: http://localhost:8800?
     64PASS Disallow origin: http://localhost:8800/
     65PASS Disallow origin: http://localhost:8800 /
     66PASS Disallow origin: http://localhost:8800#
     67PASS Disallow origin: http://localhost:8800%23
     68PASS Disallow origin: http://localhost:8800:80
     69PASS Disallow origin: http://localhost:8800, *
     70PASS Disallow origin: http://localhost:8800\0
     71PASS Disallow origin: HTTP://LOCALHOST:8800
     72PASS Disallow origin: HTTP://localhost:8800
     73PASS Disallow origin: -
     74PASS Disallow origin: **
     75PASS Disallow origin: \0*
     76PASS Disallow origin: *\0
     77PASS Disallow origin: '*'
     78PASS Disallow origin: "*"
     79PASS Disallow origin: * *
     80PASS Disallow origin: *http://*
     81PASS Disallow origin: *http://localhost:8800
     82PASS Disallow origin: * http://localhost:8800
     83PASS Disallow origin: *, http://localhost:8800
     84PASS Disallow origin: \0http://localhost:8800
     85PASS Disallow origin: null http://localhost:8800
     86PASS Disallow origin: http://example.net
     87PASS Disallow origin: null
     88PASS Disallow origin: 
     89PASS Disallow origin: http://localhost:8800/cors/allow-headers.htm
     90PASS Disallow origin: http://localhost:8800/cors/
     91PASS Disallow origin: http://www1.localhost:8800/cors/
    9292
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cors/origin-expected.txt

    r219663 r220731  
    6262Harness Error (FAIL), message = 1 duplicate test name: "Disallow origin: localhost:8800"
    6363
    64 FAIL Allow origin: * The operation was aborted.
    65 FAIL Allow origin: _*__ The operation was aborted.
    66 FAIL Allow origin: [tab]* The operation was aborted.
    67 FAIL Allow origin: http://localhost:8800 The operation was aborted.
    68 FAIL Allow origin: _http://localhost:8800 The operation was aborted.
    69 FAIL Allow origin: _http://localhost:8800___[tab]_ The operation was aborted.
    70 FAIL Allow origin: [tab]http://localhost:8800 The operation was aborted.
    71 FAIL Disallow origin: http://www1.localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    72 FAIL Disallow origin: //localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    73 FAIL Disallow origin: ://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    74 FAIL Disallow origin: ftp://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    75 FAIL Disallow origin: http:://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    76 FAIL Disallow origin: http:/localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    77 FAIL Disallow origin: http:localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    78 FAIL Disallow origin: localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    79 FAIL Disallow origin: http://localhost:8800? assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    80 FAIL Disallow origin: http://localhost:8800/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    81 FAIL Disallow origin: http://localhost:8800 / assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    82 FAIL Disallow origin: http://localhost:8800# assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    83 FAIL Disallow origin: http://localhost:8800%23 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    84 FAIL Disallow origin: http://localhost:8800:80 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    85 FAIL Disallow origin: http://localhost:8800, * assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    86 FAIL Disallow origin: http://localhost:8800\0 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    87 FAIL Disallow origin: HTTP://LOCALHOST:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    88 FAIL Disallow origin: HTTP://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    89 FAIL Disallow origin: - assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    90 FAIL Disallow origin: ** assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    91 FAIL Disallow origin: \0* assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    92 FAIL Disallow origin: *\0 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    93 FAIL Disallow origin: '*' assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    94 FAIL Disallow origin: "*" assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    95 FAIL Disallow origin: * * assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    96 FAIL Disallow origin: * null assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    97 FAIL Disallow origin: *http://* assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    98 FAIL Disallow origin: *http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    99 FAIL Disallow origin: * http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    100 FAIL Disallow origin: *, http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    101 FAIL Disallow origin: \0http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    102 FAIL Disallow origin: null http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    103 FAIL Disallow origin: http://example.net assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    104 FAIL Disallow origin: null assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    105 FAIL Disallow origin: null * assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    106 FAIL Disallow origin:  assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    107 FAIL Disallow origin: http://localhost:8800/cors/origin.htm assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    108 FAIL Disallow origin: http://localhost:8800/cors/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    109 FAIL Disallow origin: http://www1.localhost:8800/cors/ assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    110 FAIL Disallow origin: localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    111 FAIL Disallow origin: .localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    112 FAIL Disallow origin: *.localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    113 FAIL Disallow origin: http://localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    114 FAIL Disallow origin: http://.localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    115 FAIL Disallow origin: http://*.localhost:8800 assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    116 FAIL Disallow multiple headers (, *) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    117 FAIL Disallow multiple headers (*, ) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    118 FAIL Disallow multiple headers (*, *) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    119 FAIL Disallow multiple headers (, http://localhost:8800) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    120 FAIL Disallow multiple headers (*, http://localhost:8800) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
    121 FAIL Disallow multiple headers (http://localhost:8800, http://localhost:8800) assert_throws: send function "function () { client.send() }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
     64FAIL Allow origin: *  A network error occurred.
     65FAIL Allow origin: _*__  A network error occurred.
     66FAIL Allow origin: [tab]*  A network error occurred.
     67FAIL Allow origin: http://localhost:8800  A network error occurred.
     68FAIL Allow origin: _http://localhost:8800  A network error occurred.
     69FAIL Allow origin: _http://localhost:8800___[tab]_  A network error occurred.
     70FAIL Allow origin: [tab]http://localhost:8800  A network error occurred.
     71PASS Disallow origin: http://www1.localhost:8800
     72PASS Disallow origin: //localhost:8800
     73PASS Disallow origin: ://localhost:8800
     74PASS Disallow origin: ftp://localhost:8800
     75PASS Disallow origin: http:://localhost:8800
     76PASS Disallow origin: http:/localhost:8800
     77PASS Disallow origin: http:localhost:8800
     78PASS Disallow origin: localhost:8800
     79PASS Disallow origin: http://localhost:8800?
     80PASS Disallow origin: http://localhost:8800/
     81PASS Disallow origin: http://localhost:8800 /
     82PASS Disallow origin: http://localhost:8800#
     83PASS Disallow origin: http://localhost:8800%23
     84PASS Disallow origin: http://localhost:8800:80
     85PASS Disallow origin: http://localhost:8800, *
     86PASS Disallow origin: http://localhost:8800\0
     87PASS Disallow origin: HTTP://LOCALHOST:8800
     88PASS Disallow origin: HTTP://localhost:8800
     89PASS Disallow origin: -
     90PASS Disallow origin: **
     91PASS Disallow origin: \0*
     92PASS Disallow origin: *\0
     93PASS Disallow origin: '*'
     94PASS Disallow origin: "*"
     95PASS Disallow origin: * *
     96PASS Disallow origin: * null
     97PASS Disallow origin: *http://*
     98PASS Disallow origin: *http://localhost:8800
     99PASS Disallow origin: * http://localhost:8800
     100PASS Disallow origin: *, http://localhost:8800
     101PASS Disallow origin: \0http://localhost:8800
     102PASS Disallow origin: null http://localhost:8800
     103PASS Disallow origin: http://example.net
     104PASS Disallow origin: null
     105PASS Disallow origin: null *
     106PASS Disallow origin: 
     107PASS Disallow origin: http://localhost:8800/cors/origin.htm
     108PASS Disallow origin: http://localhost:8800/cors/
     109PASS Disallow origin: http://www1.localhost:8800/cors/
     110PASS Disallow origin: localhost:8800
     111PASS Disallow origin: .localhost:8800
     112PASS Disallow origin: *.localhost:8800
     113PASS Disallow origin: http://localhost:8800
     114PASS Disallow origin: http://.localhost:8800
     115PASS Disallow origin: http://*.localhost:8800
     116PASS Disallow multiple headers (, *)
     117PASS Disallow multiple headers (*, )
     118PASS Disallow multiple headers (*, *)
     119PASS Disallow multiple headers (, http://localhost:8800)
     120PASS Disallow multiple headers (*, http://localhost:8800)
     121PASS Disallow multiple headers (http://localhost:8800, http://localhost:8800)
    122122
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cors/request-headers-expected.txt

    r213914 r220731  
    1616FAIL Strange allowheaders (case insensitive)  A network error occurred.
    1717PASS INVALID_STATE_ERR on setRequestHeader before open()
    18 FAIL INVALID_STATE_ERR on setRequestHeader after send() The operation was aborted.
     18FAIL INVALID_STATE_ERR on setRequestHeader after send()  A network error occurred.
    1919
  • trunk/LayoutTests/imported/w3c/web-platform-tests/cors/response-headers-expected.txt

    r213914 r220731  
    1818
    1919
    20 FAIL getResponseHeader: Expose Access-Control-Expose-Headers (x-custom-header-comma) The operation was aborted.
    21 FAIL getResponseHeader: Expose second Access-Control-Expose-Headers (x-second-expose) The operation was aborted.
    22 FAIL getResponseHeader: Don't trim whitespace The operation was aborted.
    23 FAIL getResponseHeader: x-custom-header bytes The operation was aborted.
    24 FAIL getResponseHeader: Exposed server field readable (Date) The operation was aborted.
    25 FAIL getResponseHeader: Cache-Control: readable by default The operation was aborted.
    26 FAIL getResponseHeader: Content-Language: readable by default The operation was aborted.
    27 FAIL getResponseHeader: Expires: readable by default The operation was aborted.
    28 FAIL getResponseHeader: Last-Modified: readable by default The operation was aborted.
    29 FAIL getResponseHeader: Pragma: readable by default The operation was aborted.
    30 FAIL getResponseHeader: Server: unreadable by default The operation was aborted.
    31 FAIL getResponseHeader: X-Powered-By: unreadable by default The operation was aborted.
     20FAIL getResponseHeader: Expose Access-Control-Expose-Headers (x-custom-header-comma)  A network error occurred.
     21FAIL getResponseHeader: Expose second Access-Control-Expose-Headers (x-second-expose)  A network error occurred.
     22FAIL getResponseHeader: Don't trim whitespace  A network error occurred.
     23FAIL getResponseHeader: x-custom-header bytes  A network error occurred.
     24FAIL getResponseHeader: Exposed server field readable (Date)  A network error occurred.
     25FAIL getResponseHeader: Cache-Control: readable by default  A network error occurred.
     26FAIL getResponseHeader: Content-Language: readable by default  A network error occurred.
     27FAIL getResponseHeader: Expires: readable by default  A network error occurred.
     28FAIL getResponseHeader: Last-Modified: readable by default  A network error occurred.
     29FAIL getResponseHeader: Pragma: readable by default  A network error occurred.
     30FAIL getResponseHeader: Server: unreadable by default  A network error occurred.
     31FAIL getResponseHeader: X-Powered-By: unreadable by default  A network error occurred.
    3232FAIL getResponseHeader: Combined testing of cors response headers assert_equals: x-custom-header expected (string) "test, test" but got (object) null
    33 FAIL getResponse: don't expose x-nonexposed The operation was aborted.
    34 FAIL getAllResponseHeaders: don't expose x-nonexposed The operation was aborted.
     33FAIL getResponse: don't expose x-nonexposed  A network error occurred.
     34FAIL getAllResponseHeaders: don't expose x-nonexposed  A network error occurred.
    3535
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=match_origin
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=match_wildcard
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_multi-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=multi
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_null-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=null
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_origin-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=origin
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=uppercase
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_space-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=space
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=wildcard
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/resource-timing/resource_TAO_zero-expected.txt

    r219766 r220731  
    11Blocked access to external URL http://www.localhost:8800/resource-timing/resources/TAOResponse.py?tao=zero
    2 CONSOLE MESSAGE: line 13: AbortError: The operation was aborted.
     2CONSOLE MESSAGE: line 13: NetworkError:  A network error occurred.
    33Description
    44
  • trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt

    r219663 r220731  
    11Blocked access to external URL http://nonexistent-origin.localhost%7D:8800/
    22
    3 FAIL XMLHttpRequest: The send() method: Throw a "throw an "NetworkError" exception when Network error happens (synchronous flag is set) assert_throws: function "function ()
    4             {
    5                 xhr.send("Test Message");
    6             }" threw object "AbortError: The operation was aborted." that is not a DOMException NetworkError: property "code" is equal to 20, expected 19
     3PASS XMLHttpRequest: The send() method: Throw a "throw an "NetworkError" exception when Network error happens (synchronous flag is set)
    74
  • trunk/Source/WebCore/ChangeLog

    r220730 r220731  
     12017-08-14  Chris Dumez  <cdumez@apple.com>
     2
     3        XHR should only fire an abort event if the cancellation was requested by the client
     4        https://bugs.webkit.org/show_bug.cgi?id=175546
     5
     6        Reviewed by Youenn Fablet.
     7
     8        XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
     9        Blink and Gecko already match the specification.
     10
     11        Specification:
     12        - https://xhr.spec.whatwg.org/#handle-errors
     13        - https://xhr.spec.whatwg.org/#the-abort()-method
     14
     15        Test: http/tests/navigation/page-cache-xhr-in-pagehide.html
     16
     17        * xml/XMLHttpRequest.cpp:
     18        (WebCore::XMLHttpRequest::open):
     19        (WebCore::XMLHttpRequest::abort):
     20        (WebCore::XMLHttpRequest::abortError):
     21        (WebCore::XMLHttpRequest::didFail):
     22        * xml/XMLHttpRequest.h:
     23
    1242017-08-14  Simon Fraser  <simon.fraser@apple.com>
    225
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r219901 r220731  
    411411    m_sendFlag = false;
    412412    m_uploadComplete = false;
     413    m_wasAbortedByClient = false;
    413414
    414415    // clear stuff from possible previous load
     
    779780    Ref<XMLHttpRequest> protectedThis(*this);
    780781
     782    m_wasAbortedByClient = true;
    781783    if (!internalAbort())
    782784        return;
     
    873875void XMLHttpRequest::abortError()
    874876{
     877    ASSERT(m_wasAbortedByClient);
    875878    genericError();
    876879    dispatchErrorEvents(eventNames().abortEvent);
     
    10041007        return;
    10051008
    1006     if (error.isCancellation()) {
     1009    // The XHR specification says we should only fire an abort event if the cancelation was requested by the client.
     1010    if (m_wasAbortedByClient && error.isCancellation()) {
    10071011        m_exceptionCode = AbortError;
    10081012        abortError();
  • trunk/Source/WebCore/xml/XMLHttpRequest.h

    r219901 r220731  
    218218
    219219    bool m_sameOriginRequest { true };
     220    bool m_wasAbortedByClient { false };
    220221
    221222    // Used for progress event tracking.
Note: See TracChangeset for help on using the changeset viewer.