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:
parent
8cb0197eeb
commit
55b61724a0
2 changed files with 6 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue