From 767daf1c1284cc4acd9c0ad8cf657a5ff7897694 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Jun 2020 18:15:00 +0200 Subject: [PATCH] LibWeb: Unbreak 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. --- Libraries/LibWeb/PageView.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibWeb/PageView.cpp b/Libraries/LibWeb/PageView.cpp index bdd5eeba01..e1c9a74a4d 100644 --- a/Libraries/LibWeb/PageView.cpp +++ b/Libraries/LibWeb/PageView.cpp @@ -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); }