1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibWeb: Resolve percentage padding and margins for grid items in GFC

Adds a second pass to resolve percentage paddings and margins of grid
items after track sizes are known. If resolving percentage paddings
or margins affects tracks sizes then second pass to re-resolve track
sizes might also be needed but I cannot come up with an example to
reproduce that so we can leave it to improve in the future :)
This commit is contained in:
Aliaksandr Kalenik 2023-06-08 02:49:30 +03:00 committed by Andreas Kling
parent 775742b35d
commit 1c979e0ed7
4 changed files with 68 additions and 18 deletions

View file

@ -124,6 +124,8 @@ public:
Box const& grid_container() const { return context_box(); }
private:
void resolve_items_box_metrics(GridDimension const dimension);
CSSPixels m_automatic_content_height { 0 };
bool is_auto_positioned_row(CSS::GridTrackPlacement const&, CSS::GridTrackPlacement const&) const;
bool is_auto_positioned_column(CSS::GridTrackPlacement const&, CSS::GridTrackPlacement const&) const;