LibWeb: Let FormattingContext decide the automatic width of its root

Instead of special-casing FlexFormattingContext in the intrinsic sizing
layout helpers, add FormattingContext::automatic_content_width() and let
each context subclass decide what that means.

No behavior change here, just moving this responsibility.
This commit is contained in:
Andreas Kling 2023-03-19 09:57:31 +01:00
commit 00999a245c
Notes: sideshowbarker 2024-07-16 22:39:49 +09:00
12 changed files with 42 additions and 18 deletions

View file

@ -542,6 +542,11 @@ void TableFormattingContext::run(Box const& box, LayoutMode layout_mode, Availab
m_automatic_content_height = total_content_height;
}
CSSPixels TableFormattingContext::automatic_content_width() const
{
return greatest_child_width(context_box());
}
CSSPixels TableFormattingContext::automatic_content_height() const
{
return m_automatic_content_height;