1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

LibWeb: Introduce structure that maintains collapsible margins in BFC

Previously y position of boxes in block formatting context
was calculated by looking at y position of previous in-flow
sibling and adding collapsed margin of "collapse through"
boxes lying between box currently being laid out and it's
previous in-flow sibling.

Here introduced BlockMarginState structure that maintains
array of currently collapsible margins hence we no longer
need to look at previous sibling to calculate y position
of a box.
This commit is contained in:
Aliaksandr Kalenik 2022-12-25 17:13:21 +03:00 committed by Andreas Kling
parent e3d5b67eaf
commit fe8304d5de
5 changed files with 93 additions and 89 deletions

View file

@ -71,8 +71,6 @@ public:
static float containing_block_width_for(Box const&, LayoutState const&);
static float containing_block_height_for(Box const&, LayoutState const&);
float compute_box_y_position_with_respect_to_siblings(Box const&) const;
[[nodiscard]] float calculate_stretch_fit_width(Box const&, AvailableSize const&) const;
[[nodiscard]] float calculate_stretch_fit_height(Box const&, AvailableSize const&) const;