mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb/FileAPI: Correctly fire an error event on error reading file
I can't find of a way to trigger this codepath, and there is for sure no correpsonding WPT test, but let's fix this up for whenever it does become relevant.
This commit is contained in:
parent
b58ba2e1bd
commit
33e80fbf51
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
|
||||
* Copyright (c) 2023-2025, Shannon Booth <shannon@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
|
@ -235,7 +235,7 @@ WebIDL::ExceptionOr<void> FileReader::read_operation(Blob& blob, Type type, Opti
|
|||
if (m_state != State::Loading)
|
||||
dispatch_event(DOM::Event::create(realm, HTML::EventNames::loadend));
|
||||
|
||||
// NOTE: Event handler for the load or error events could have started another load, if that happens the loadend event for this load is not fired.
|
||||
// Spec-Note: Event handler for the load or error events could have started another load, if that happens the loadend event for this load is not fired.
|
||||
}));
|
||||
|
||||
return;
|
||||
|
|
@ -248,14 +248,14 @@ WebIDL::ExceptionOr<void> FileReader::read_operation(Blob& blob, Type type, Opti
|
|||
|
||||
// FIXME: 2. Set fr’s error to error.
|
||||
|
||||
// 5. Fire a progress event called error at fr.
|
||||
dispatch_event(DOM::Event::create(realm, HTML::EventNames::loadend));
|
||||
// 3. Fire a progress event called error at fr.
|
||||
dispatch_event(DOM::Event::create(realm, HTML::EventNames::error));
|
||||
|
||||
// 4. If fr’s state is not "loading", fire a progress event called loadend at fr.
|
||||
if (m_state != State::Loading)
|
||||
dispatch_event(DOM::Event::create(realm, HTML::EventNames::loadend));
|
||||
|
||||
// 5. Note: Event handler for the error event could have started another load, if that happens the loadend event for this load is not fired.
|
||||
// Spec-Note: Event handler for the error event could have started another load, if that happens the loadend event for this load is not fired.
|
||||
}));
|
||||
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user