LibWeb: Use viewport position for did_enter_tooltip_area

This now matches the behavior of did_request_link_context_menu and
friends. Previously the coordinates relative to the page rather than
viewport were sent to the chrome.
This commit is contained in:
circl 2024-06-09 18:22:24 +02:00 committed by Andreas Kling
parent cb657a038f
commit 990cf9b4e9
Notes: sideshowbarker 2024-07-17 08:25:15 +09:00

View File

@ -564,7 +564,7 @@ bool EventHandler::handle_mousemove(CSSPixelPoint viewport_position, CSSPixelPoi
if (hovered_node_changed) {
JS::GCPtr<HTML::HTMLElement const> hovered_html_element = document.hovered_node() ? document.hovered_node()->enclosing_html_element_with_attribute(HTML::AttributeNames::title) : nullptr;
if (hovered_html_element && hovered_html_element->title().has_value()) {
page.client().page_did_enter_tooltip_area(m_navigable->active_document()->navigable()->to_top_level_position(position), hovered_html_element->title()->to_byte_string());
page.client().page_did_enter_tooltip_area(viewport_position, hovered_html_element->title()->to_byte_string());
} else {
page.client().page_did_leave_tooltip_area();
}