Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
window.stop() should fire abort events on XMLHttpRequest asynchronously
https://bugs.webkit.org/show_bug.cgi?id=257397 Reviewed by Darin Adler and Youenn Fablet. window.stop() should fire an abort event on XMLHttpRequest asynchronously, to match the behavior of Blink and Gecko. It should schedule a asynchronous task, which should get cancelled if the JavaScript calls `open()` on the XMLHttpRequest again. This is covered by WPT tests. * LayoutTests/imported/w3c/web-platform-tests/xhr/abort-after-stop.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/xhr/open-after-stop.window-expected.txt: Rebaseline tests now that more checks are passing. * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-basic-cors-not-enabled-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-basic-cors-not-enabled.htm: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-cors-basic-setrequestheader-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-cors-basic-setrequestheader.htm: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-authentication-cors-setrequestheader-no-cred.htm: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-network-error-sync-events.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/xhr/send-network-error-sync-events.sub.htm: Fix tests to use get_host_info() instead of hardcoding custom domains which don't work with the WebKit layout tests infrastructure. This improves test coverage. I'll upstream those changes. * Source/WebCore/xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::internalAbort): (WebCore::XMLHttpRequest::abortError): (WebCore::XMLHttpRequest::handleCancellation): (WebCore::XMLHttpRequest::didFail): * Source/WebCore/xml/XMLHttpRequest.h: Align our behavior with Blink and Gecko. Canonical link: https://commits.webkit.org/264765@main
- Loading branch information
Showing
14 changed files
with
38 additions
and
28 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
LayoutTests/imported/w3c/web-platform-tests/xhr/abort-after-stop.window-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL XMLHttpRequest: abort event should fire when stop() method is used assert_equals: expected true but got false | ||
PASS XMLHttpRequest: abort event should fire when stop() method is used | ||
|
2 changes: 1 addition & 1 deletion
2
LayoutTests/imported/w3c/web-platform-tests/xhr/open-after-stop.window-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL open() after window.stop() assert_unreached: loadend should not be fired after window.stop() and open() Reached unreachable code | ||
PASS open() after window.stop() | ||
|
1 change: 0 additions & 1 deletion
1
...ported/w3c/web-platform-tests/xhr/send-authentication-basic-cors-not-enabled-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Blocked access to external URL http://www1.localhost:8800/xhr/resources/auth10/auth.py | ||
|
||
PASS XMLHttpRequest: send() - "Basic" authenticated CORS requests with user name and password passed to open() (asserts failure) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...d/w3c/web-platform-tests/xhr/send-authentication-cors-basic-setrequestheader-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Blocked access to external URL http://www1.localhost:8800/xhr/resources/auth2/corsenabled.py | ||
|
||
FAIL XMLHttpRequest: send() - "Basic" authenticated CORS request using setRequestHeader() (expects to succeed) A network error occurred. | ||
PASS XMLHttpRequest: send() - "Basic" authenticated CORS request using setRequestHeader() (expects to succeed) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...w3c/web-platform-tests/xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
Blocked access to external URL http://www1.localhost:8800/xhr/resources/auth7/corsenabled.py | ||
Blocked access to external URL http://www1.localhost:8800/xhr/resources/auth8/corsenabled-no-authorize.py | ||
|
||
FAIL CORS request with setRequestHeader auth to URL accepting Authorization header assert_true: responseText should contain the right user and password expected true got false | ||
PASS CORS request with setRequestHeader auth to URL accepting Authorization header | ||
PASS CORS request with setRequestHeader auth to URL NOT accepting Authorization header | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...Tests/imported/w3c/web-platform-tests/xhr/send-network-error-sync-events.sub-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
Blocked access to external URL http://nonexistent.localhost:8800/ | ||
|
||
PASS http URL | ||
PASS data URL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters