mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibWeb: Use UA shadow DOM for media elements' controls
Instead of using a custom paintable to draw the controls for video and audio elements, we build them out of plain old HTML elements within a shadow root. This required a few hacks in the previous commits in order to allow a replaced element to host children within a shadow root, but it's fairly self-contained. A big benefit is that we can drive all the UI updates off of plain old DOM events (except the play button overlay on videos, which uses the video element representation), so we can test our media and input event handling more thoroughly. :^) The control bar visibility is now more similar to how other browsers handle it. It will show upon hovering over the element, but if the cursor is kept still for more than a second, it will hide again. While dragging, the controls remain visible, and will then hide after the mouse button is released. The icons have been redesigned from scratch, and the mute icon now visualizes the volume level along with indicating the mute state.
This commit is contained in:
committed by
Alexander Kalenik
parent
bacf689c88
commit
21019c2fa9
Notes:
github-actions[bot]
2026-02-23 06:28:40 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/21019c2fa93 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8056 Reviewed-by: https://github.com/kalenikaliaksandr ✅ Reviewed-by: https://github.com/konradekk
@@ -729,6 +729,10 @@ video {
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
audio {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
/* 15.4.3 Attributes for embedded content and images
|
||||
* https://html.spec.whatwg.org/multipage/rendering.html#attributes-for-embedded-content-and-images
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user