LibWeb: Unbreak <a title> tooltips in the main frame

The main frame doesn't have a host element, so we can't go trying to
offset things by the host element's layout rect.
This commit is contained in:
Andreas Kling 2020-06-07 18:15:00 +02:00
parent 61ac1d3ffa
commit 767daf1c12

View file

@ -319,6 +319,8 @@ Gfx::Point PageView::to_screen_position(const Web::Frame& frame, const Gfx::Poin
{
Gfx::Point offset;
for (auto* f = &frame; f; f = f->parent()) {
if (f->is_main_frame())
break;
auto f_position = f->host_element()->layout_node()->box_type_agnostic_position().to_int_point();
offset.move_by(f_position);
}