mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
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:
parent
b57199ccb9
commit
435ced70b8
Notes:
sideshowbarker
2024-07-17 02:06:40 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/435ced70b8 Pull-request: https://github.com/SerenityOS/serenity/pull/19771
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user