From b3d85afd92132eabd074f6ed53cc621ba6ff4856 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 11 Apr 2022 23:58:41 +0200 Subject: [PATCH] LibWeb: Make Layout::Box::set_needs_display() work for all boxes For inline-blocks and inline replaced elements, we previously fell into a code path that tried to find a corresponding line box fragment to invalidate. However, we don't need to do any of that, all we need to do is get the absolute rect from our paintable, and invalidate that. This makes CRC2D invalidations happen immediately instead of as a side effect of some other invalidation. --- Userland/Libraries/LibWeb/Layout/Box.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/Box.cpp b/Userland/Libraries/LibWeb/Layout/Box.cpp index fa50bc15b5..73d770968d 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.cpp +++ b/Userland/Libraries/LibWeb/Layout/Box.cpp @@ -31,12 +31,8 @@ Box::~Box() void Box::set_needs_display() { - if (!is_inline()) { + if (paint_box()) browsing_context().set_needs_display(enclosing_int_rect(paint_box()->absolute_rect())); - return; - } - - Node::set_needs_display(); } bool Box::is_body() const