1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 10:05:10 +00:00

LibWeb: Implement HTMLVideoElement's video{Width,Height} attributes

This commit is contained in:
Timothy Flynn 2023-04-04 16:57:56 -04:00 committed by Linus Groh
parent becd70eccb
commit 725d7c3699
4 changed files with 37 additions and 1 deletions

View file

@ -603,7 +603,10 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::process_media_data(Function<void()>
// 5. For video elements, set the videoWidth and videoHeight attributes, and queue a media element task given the media element to fire an event
// named resize at the media element.
if (is<HTMLVideoElement>(*this)) {
// FIXME: Set the videoWidth and videoHeight attributes.
auto& video_element = verify_cast<HTMLVideoElement>(*this);
video_element.set_video_width(video_track->pixel_width());
video_element.set_video_height(video_track->pixel_height());
queue_a_media_element_task([this] {
dispatch_event(DOM::Event::create(this->realm(), HTML::EventNames::resize.to_deprecated_fly_string()).release_value_but_fixme_should_propagate_errors());
});