LibWeb: Always fire the link hover hooks when moving between links
Some broken logic was preventing us from firing the hover hooks when the cursor jumped directly from one link to another.
This commit is contained in:
parent
63d796312d
commit
d4fe3e8009
Notes:
sideshowbarker
2024-07-19 05:07:55 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d4fe3e8009b
1 changed files with 0 additions and 3 deletions
|
@ -171,7 +171,6 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
|
||||||
|
|
||||||
bool hovered_node_changed = false;
|
bool hovered_node_changed = false;
|
||||||
bool is_hovering_link = false;
|
bool is_hovering_link = false;
|
||||||
bool was_hovering_link = document.hovered_node() && document.hovered_node()->is_link();
|
|
||||||
auto result = layout_root.hit_test(position);
|
auto result = layout_root.hit_test(position);
|
||||||
const HTMLAnchorElement* hovered_link_element = nullptr;
|
const HTMLAnchorElement* hovered_link_element = nullptr;
|
||||||
if (result.layout_node) {
|
if (result.layout_node) {
|
||||||
|
@ -210,8 +209,6 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
|
||||||
} else {
|
} else {
|
||||||
page_client.page_did_leave_tooltip_area();
|
page_client.page_did_leave_tooltip_area();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (is_hovering_link != was_hovering_link) {
|
|
||||||
if (is_hovering_link)
|
if (is_hovering_link)
|
||||||
page_client.page_did_hover_link(document.complete_url(hovered_link_element->href()));
|
page_client.page_did_hover_link(document.complete_url(hovered_link_element->href()));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue