1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:37: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:
Andreas Kling 2023-03-19 09:57:31 +01:00
parent e945994877
commit 00999a245c
12 changed files with 42 additions and 18 deletions

View file

@ -22,6 +22,7 @@ public:
~BlockFormattingContext();
virtual void run(Box const&, LayoutMode, AvailableSpace const&) override;
virtual CSSPixels automatic_content_width() const override;
virtual CSSPixels automatic_content_height() const override;
auto const& left_side_floats() const { return m_left_floats; }
@ -40,7 +41,7 @@ public:
SpaceUsedByFloats space_used_by_floats(CSSPixels y) const;
virtual CSSPixels greatest_child_width(Box const&) override;
virtual CSSPixels greatest_child_width(Box const&) const override;
void layout_floating_box(Box const& child, BlockContainer const& containing_block, LayoutMode, AvailableSpace const&, CSSPixels y, LineBuilder* = nullptr);