From 435ced70b80070e3b38b8a4ce8d94c7bdd72f309 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sun, 2 Jul 2023 21:35:48 -0700 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index d7d9e8b3cbe..a347c1d6b54 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -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, } m_display_time = move(display_time); + + if (auto* layout_node = this->layout_node()) + layout_node->set_needs_display(); } double HTMLMediaElement::layout_display_time(Badge) const