1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibWeb: Use root content width as automatic width if children inline

Returning greatest_child_width() from automatic_content_width() in BFC
if root box children are inline and there are min/max-width that caused
width to be changed after IFC layout while content_width should be
always set to correct value by layout_inline_children() regardless of
layout mode.
This commit is contained in:
Aliaksandr Kalenik 2023-08-09 16:59:20 +02:00 committed by Andreas Kling
parent 1f88109d78
commit b34b0a1cd3
4 changed files with 37 additions and 8 deletions

View file

@ -40,6 +40,8 @@ BlockFormattingContext::~BlockFormattingContext()
CSSPixels BlockFormattingContext::automatic_content_width() const
{
if (root().children_are_inline())
return m_state.get(root()).content_width();
return greatest_child_width(root());
}