mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Fire the media element ended event inside a task
The spec changed in this regard, and this change ensures that once the ended attribute is updated only during event loop step 1, ended event handlers will see the ended attribute set to true.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
412467cc70
commit
45727d7a58
Notes:
github-actions[bot]
2025-10-28 00:31:16 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/45727d7a581 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/gmta ✅
@@ -2024,10 +2024,10 @@ void HTMLMediaElement::reached_end_of_media_playback()
|
||||
auto promises = take_pending_play_promises();
|
||||
reject_pending_play_promises<WebIDL::AbortError>(promises, "Media playback has ended"_utf16);
|
||||
}
|
||||
});
|
||||
|
||||
// 4. Fire an event named ended at the media element.
|
||||
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::ended));
|
||||
// 3. Fire an event named ended at the media element.
|
||||
dispatch_event(DOM::Event::create(realm(), HTML::EventNames::ended));
|
||||
});
|
||||
}
|
||||
|
||||
void HTMLMediaElement::dispatch_time_update_event()
|
||||
|
||||
Reference in New Issue
Block a user