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:
Zaggy1024
2025-10-09 16:56:36 -05:00
committed by Jelle Raaijmakers
parent 412467cc70
commit 45727d7a58
Notes: github-actions[bot] 2025-10-28 00:31:16 +00:00

View File

@@ -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()