summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-06-07 18:15:00 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-07 19:09:03 +0200
commit767daf1c1284cc4acd9c0ad8cf657a5ff7897694 (patch)
tree42d834ce18f493cbeeb2a5027e764fbd17c26b78 /Libraries
parent61ac1d3ffa1adb3df7d8787d78eab2399352a942 (diff)
downloadserenity-767daf1c1284cc4acd9c0ad8cf657a5ff7897694.zip
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.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibWeb/PageView.cpp2
1 files changed, 2 insertions, 0 deletions
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);
}