XMLHttpRequest.abort() in loadstart event handler should terminate the fetching |
||
Issue description
Example:
const xhr = new XMLHttpRequest();
xhr.open("GET", "hello.txt");
xhr.addEventListener("loadstart", () => {
xhr.abort();
});
xhr.send();
Reported by the Edge of Microsoft. Thanks.
,
Nov 16 2016
,
Nov 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/13c30eae8fbe5a1b9927c12be1cd88d102009932 commit 13c30eae8fbe5a1b9927c12be1cd88d102009932 Author: sigbjornf <sigbjornf@opera.com> Date: Fri Nov 18 09:07:27 2016 XMLHttpRequest: check if 'loadstart' handler cancelled send(). 'loadstart' is dispatched to both 'download' and upload event handlers while initiating a send() operation. Should those event handlers cause the ongoing send operation to be aborted/stopped/cancelled, this outer send() operation shouldn't proceed upon return. R=yhirano BUG= 642242 Review-Url: https://codereview.chromium.org/2507773002 Cr-Commit-Position: refs/heads/master@{#433157} [add] https://crrev.com/13c30eae8fbe5a1b9927c12be1cd88d102009932/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/onloadstart-abort.html [modify] https://crrev.com/13c30eae8fbe5a1b9927c12be1cd88d102009932/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
,
Nov 21 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by sigbjo...@opera.com
, Nov 12 2016