LibWeb: Leave tooltip or unhover link only if page entered/hovered one

Before, on a mouse-move event, if the hovered html element did not have
a tooltip or it was not a link, `page_did_leave_tooltip_area()` and
`page_did_unhover_link()` virtual functions would get called.

Now, the page remembers if it is in a tooltip area or hovering a link
and only informs of leaving or unhovering only if it was.
This commit is contained in:
ronak69 2024-04-20 10:14:31 +00:00 committed by Tim Flynn
commit d48831e893
Notes: github-actions[bot] 2024-12-10 13:30:47 +00:00
2 changed files with 19 additions and 3 deletions

View file

@ -121,6 +121,12 @@ public:
bool is_webdriver_active() const { return m_is_webdriver_active; }
void set_is_webdriver_active(bool b) { m_is_webdriver_active = b; }
bool is_hovering_link() const { return m_is_hovering_link; }
void set_is_hovering_link(bool b) { m_is_hovering_link = b; }
bool is_in_tooltip_area() const { return m_is_in_tooltip_area; }
void set_is_in_tooltip_area(bool b) { m_is_in_tooltip_area = b; }
Gfx::StandardCursor current_cursor() const { return m_current_cursor; }
void set_current_cursor(Gfx::StandardCursor cursor) { m_current_cursor = cursor; }
@ -249,6 +255,9 @@ private:
// The webdriver-active flag is set to true when the user agent is under remote control. It is initially false.
bool m_is_webdriver_active { false };
bool m_is_hovering_link { false };
bool m_is_in_tooltip_area { false };
Gfx::StandardCursor m_current_cursor { Gfx::StandardCursor::Arrow };
DevicePixelPoint m_window_position {};