mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibWeb: Get the first DOM node with a 'title' attribute for tooltip area
Rather than expecting the first parent to have a 'title' attribute, search all ancestors.
This commit is contained in:
parent
4fac577cf0
commit
c503047c71
3 changed files with 11 additions and 1 deletions
|
@ -357,7 +357,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
|
|||
page->client().page_did_request_cursor_change(hovered_node_cursor);
|
||||
|
||||
if (hovered_node_changed) {
|
||||
RefPtr<HTML::HTMLElement> hovered_html_element = document.hovered_node() ? document.hovered_node()->enclosing_html_element() : nullptr;
|
||||
RefPtr<HTML::HTMLElement> 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().is_null()) {
|
||||
page->client().page_did_enter_tooltip_area(m_frame.to_main_frame_position(position), hovered_html_element->title());
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue