mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Keep delaying the load if an error event changes the media src
This commit is contained in:
committed by
Gregory Bertilson
parent
44ed83f4fe
commit
02a2eb6da5
Notes:
github-actions[bot]
2026-02-27 04:04:01 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/02a2eb6da5e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8179 Reviewed-by: https://github.com/shannonbooth Reviewed-by: https://github.com/trflynn89
@@ -1629,6 +1629,12 @@ void HTMLMediaElement::handle_media_source_failure(Span<GC::Ref<WebIDL::Promise>
|
||||
// 5. Fire an event named error at the media element.
|
||||
dispatch_event(DOM::Event::create(realm, HTML::EventNames::error));
|
||||
|
||||
// NB: If the error has been reset, that means we've entered load_element() within the error
|
||||
// event handler. If that's the case, as part of the resource selection algorithm, these
|
||||
// steps must abort.
|
||||
if (!m_error)
|
||||
return;
|
||||
|
||||
// 6. Reject pending play promises with promises and a "NotSupportedError" DOMException.
|
||||
reject_pending_play_promises<WebIDL::NotSupportedError>(promises, "Media is not supported"_utf16);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user