From d93bf7834650708e5445ac12b83936e4c4c1e5ed Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 7 Jun 2020 17:12:42 +0200 Subject: [PATCH] LibWeb: Fix broken paint invalidation after subframe changes Now that PageView actually respects the invalidation rect provided by the layout system, it turns out we were invalidating too little. Unfortunately, this is not really fixable until the initial containing block starts having the right size (same as viewport), but that will require a bunch of work to make overflow work again. So it's a FIXME for now, and we'll return to this. --- Libraries/LibWeb/PageView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibWeb/PageView.cpp b/Libraries/LibWeb/PageView.cpp index f26332d1c6..bdd5eeba01 100644 --- a/Libraries/LibWeb/PageView.cpp +++ b/Libraries/LibWeb/PageView.cpp @@ -329,6 +329,8 @@ Gfx::Rect PageView::to_widget_rect(const Web::Frame& frame, const Gfx::Rect& fra { Gfx::Point offset; for (auto* f = &frame; f; f = f->parent()) { + if (f->is_main_frame()) + break; if (!f->host_element()) return {}; if (!f->host_element()->layout_node()) @@ -366,6 +368,10 @@ void PageView::notify_tooltip_area_leave(Badge, Web::Frame&) void PageView::notify_needs_display(Badge, Web::Frame& frame, const Gfx::Rect& rect) { update(to_widget_rect(frame, rect)); + + // FIXME: This is a total hack that forces a full repaint every time. + // We shouldn't have to do this, but until the ICB is actually viewport-sized, we have no choice. + update(); } }