Skip to content

Commit

Permalink
LibWeb: Use viewport position for did_enter_tooltip_area
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 990cf9b4e9476d15494a9538614762119d759b2d)
  • Loading branch information
circl-lastname authored and nico committed Jul 10, 2024
1 parent 02c66c8 commit 3961002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Page/EventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,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();
}
Expand Down

0 comments on commit 3961002

Please sign in to comment.