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.
This commit is contained in:
Andreas Kling 2022-04-11 23:58:41 +02:00
parent 7e18d1c078
commit b3d85afd92
Notes: sideshowbarker 2024-07-17 12:04:18 +09:00

View File

@ -31,12 +31,8 @@ Box::~Box()
void Box::set_needs_display() void Box::set_needs_display()
{ {
if (!is_inline()) { if (paint_box())
browsing_context().set_needs_display(enclosing_int_rect(paint_box()->absolute_rect())); browsing_context().set_needs_display(enclosing_int_rect(paint_box()->absolute_rect()));
return;
}
Node::set_needs_display();
} }
bool Box::is_body() const bool Box::is_body() const