LibWeb: Always call Layout::Box::did_set_rect()

Since paintables have a default content size of 0x0, we were neglecting
to notify the corresponding layout node about size changes, if the used
content size came out to 0x0.

This fixes an issue where resizing an iframe to 0x0 didn't take effect.
This commit is contained in:
Andreas Kling 2022-03-20 19:00:22 +01:00
parent 07a4d590dd
commit 8cc757b92b
Notes: sideshowbarker 2024-07-17 17:02:42 +09:00

View file

@ -39,8 +39,6 @@ PaintableWithLines::~PaintableWithLines()
void PaintableBox::set_offset(const Gfx::FloatPoint& offset)
{
if (m_offset == offset)
return;
m_offset = offset;
// FIXME: This const_cast is gross.
const_cast<Layout::Box&>(layout_box()).did_set_rect();
@ -48,8 +46,6 @@ void PaintableBox::set_offset(const Gfx::FloatPoint& offset)
void PaintableBox::set_content_size(Gfx::FloatSize const& size)
{
if (m_content_size == size)
return;
m_content_size = size;
// FIXME: This const_cast is gross.
const_cast<Layout::Box&>(layout_box()).did_set_rect();