LibWeb+UI: Add tooltip overriding and use it for <video> tags

This call is used to inform the chrome that it should display a tooltip
now and avoid any hovering timers. This is used by <video> tags to
display the volume percentage when it is changed.
This commit is contained in:
circl 2024-07-02 16:48:57 +02:00 committed by Andreas Kling
commit ceb9c3b797
Notes: sideshowbarker 2024-07-17 01:55:29 +09:00
11 changed files with 79 additions and 5 deletions

View file

@ -318,6 +318,17 @@ Gfx::IntRect PageClient::page_did_request_fullscreen_window()
return client().did_request_fullscreen_window(m_id);
}
void PageClient::page_did_request_tooltip_override(Web::CSSPixelPoint position, ByteString const& title)
{
auto device_position = page().css_to_device_point(position);
client().async_did_request_tooltip_override(m_id, { device_position.x(), device_position.y() }, title);
}
void PageClient::page_did_stop_tooltip_override()
{
client().async_did_leave_tooltip_area(m_id);
}
void PageClient::page_did_enter_tooltip_area(ByteString const& title)
{
client().async_did_enter_tooltip_area(m_id, title);