From 0c7b1d27b4d785512e9131397c3fa6c2079ebfce Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 26 Dec 2023 22:38:44 +0100 Subject: [PATCH] LibWeb: Remove incomplete attempt to avoid repaints outside viewport This code didn't account for position:fixed elements, which meant that we'd swallow repaints for such elements when the viewport wasn't scrolled to the top of the page. We replace the incomplete optimization with a FIXME noting that this needs to be handled correctly when reintroduced. --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 49f75c5b41..b23abbfd6c 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -1981,8 +1981,8 @@ void Navigable::set_needs_display() void Navigable::set_needs_display(CSSPixelRect const& rect) { - if (!viewport_rect().intersects(rect)) - return; + // FIXME: Ignore updates outside the visible viewport rect. + // This requires accounting for fixed-position elements in the input rect, which we don't do yet. if (is(*this)) { static_cast(this)->page().client().page_did_invalidate(to_top_level_rect(rect));