1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:15:06 +00:00

LibWeb: Handle media elements being painted before their duration is set

It can take some time to download / decode a media resource. During this
time, its duration is set to NaN. The media control box would then have
some odd rendering glitches as it tried to treat NaN as an actual time.
Once we do have a duration, we also must ensure the media control box is
updated.
This commit is contained in:
Timothy Flynn 2023-06-14 15:35:20 -04:00 committed by Andreas Kling
parent 8cb0197eeb
commit 55b61724a0
2 changed files with 6 additions and 2 deletions

View file

@ -303,6 +303,9 @@ void HTMLMediaElement::set_duration(double duration)
}
m_duration = duration;
if (auto* layout_node = this->layout_node())
layout_node->set_needs_display();
}
WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> HTMLMediaElement::play()