mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb: Do not assume hovered URLs are valid
Let's just not display any tooltip for invalid URLs. This matches how Firefox behaves.
This commit is contained in:
parent
73b01a975a
commit
2a68087dfc
|
|
@ -874,8 +874,10 @@ EventResult EventHandler::handle_mousemove(CSSPixelPoint visual_viewport_positio
|
|||
}
|
||||
|
||||
if (is_hovering_link) {
|
||||
page.set_is_hovering_link(true);
|
||||
page.client().page_did_hover_link(*document.encoding_parse_url(hovered_link_element->href()));
|
||||
if (auto link_url = document.encoding_parse_url(hovered_link_element->href()); link_url.has_value()) {
|
||||
page.set_is_hovering_link(true);
|
||||
page.client().page_did_hover_link(*link_url);
|
||||
}
|
||||
} else if (page.is_hovering_link()) {
|
||||
page.set_is_hovering_link(false);
|
||||
page.client().page_did_unhover_link();
|
||||
|
|
|
|||
4
Tests/LibWeb/Crash/UIEvents/hover-invalid-url.html
Normal file
4
Tests/LibWeb/Crash/UIEvents/hover-invalid-url.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<a href="https://xn--a.com">Invalid URL</a>
|
||||
<script>
|
||||
internals.movePointerTo(30, 20);
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user