mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Mimic if-condition from spec
https://xhr.spec.whatwg.org/#dom-xmlhttprequest-abort
This commit is contained in:
parent
5e9a11b13d
commit
d56f6805d3
Notes:
github-actions[bot]
2025-04-17 12:29:56 +00:00
Author: https://github.com/vishalbiswas
Commit: d56f6805d3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4382
Reviewed-by: https://github.com/trflynn89 ✅
1 changed files with 1 additions and 1 deletions
|
@ -1129,7 +1129,7 @@ void XMLHttpRequest::abort()
|
|||
m_fetch_controller->abort(realm(), {});
|
||||
|
||||
// 2. If this’s state is opened with this’s send() flag set, headers received, or loading, then run the request error steps for this and abort.
|
||||
if ((m_state == State::Opened || m_state == State::HeadersReceived || m_state == State::Loading) && m_send) {
|
||||
if ((m_state == State::Opened && m_send) || m_state == State::HeadersReceived || m_state == State::Loading) {
|
||||
// NOTE: This cannot throw as we don't pass in an exception. XHR::abort cannot be reached in a synchronous context where the state matches above.
|
||||
// This is because it pauses inside XHR::send until the request is done or times out and then immediately calls `handle_response_end_of_body`
|
||||
// which will always set `m_state` to `Done`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue