LibWeb: Update the media element's display in a couple situations

Mostly seen on macOS, but when we toggle playing a media element, we
need to update its layout node's display to ensure the change is
reflected on the playback button. Further, when setting the element's
display time, we need to update the display to ensure the change is
refelected on the media timeline.
This commit is contained in:
Timothy Flynn 2023-07-02 21:35:48 -07:00 committed by Andreas Kling
parent b57199ccb9
commit 435ced70b8
Notes: sideshowbarker 2024-07-17 02:06:40 +09:00

View File

@ -1574,6 +1574,9 @@ void HTMLMediaElement::set_paused(bool paused)
if (m_paused)
on_paused();
if (auto* layout_node = this->layout_node())
layout_node->set_needs_display();
}
// https://html.spec.whatwg.org/multipage/media.html#blocked-media-element
@ -1852,6 +1855,9 @@ void HTMLMediaElement::set_layout_display_time(Badge<Painting::MediaPaintable>,
}
m_display_time = move(display_time);
if (auto* layout_node = this->layout_node())
layout_node->set_needs_display();
}
double HTMLMediaElement::layout_display_time(Badge<Painting::MediaPaintable>) const