mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
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:
parent
e945994877
commit
00999a245c
12 changed files with 42 additions and 18 deletions
|
@ -75,9 +75,14 @@ FlexFormattingContext::FlexFormattingContext(LayoutState& state, Box const& flex
|
|||
|
||||
FlexFormattingContext::~FlexFormattingContext() = default;
|
||||
|
||||
CSSPixels FlexFormattingContext::automatic_content_width() const
|
||||
{
|
||||
return m_flex_container_state.content_width();
|
||||
}
|
||||
|
||||
CSSPixels FlexFormattingContext::automatic_content_height() const
|
||||
{
|
||||
return m_state.get(flex_container()).content_height();
|
||||
return m_flex_container_state.content_height();
|
||||
}
|
||||
|
||||
void FlexFormattingContext::run(Box const& run_box, LayoutMode, AvailableSpace const& available_content_space)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue