LibWeb: Use the soon-to-be hovered element for tooltip notifications

Instead of the currently hovered element.
This commit is contained in:
Andreas Kling 2025-08-06 17:46:34 +02:00 committed by Sam Atkins
commit 74722cc499
Notes: github-actions[bot] 2025-08-06 16:27:30 +00:00

View file

@ -848,7 +848,7 @@ EventResult EventHandler::handle_mousemove(CSSPixelPoint viewport_position, CSSP
}
if (hovered_node_changed) {
GC::Ptr<HTML::HTMLElement const> hovered_html_element = document.hovered_node() ? document.hovered_node()->enclosing_html_element_with_attribute(HTML::AttributeNames::title) : nullptr;
GC::Ptr<HTML::HTMLElement const> hovered_html_element = node ? node->enclosing_html_element_with_attribute(HTML::AttributeNames::title) : nullptr;
if (hovered_html_element && hovered_html_element->title().has_value()) {
page.set_is_in_tooltip_area(true);