diff options
author | Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | 2023-05-09 18:38:53 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-09 20:34:28 +0200 |
commit | 0a1bffdd92858361ce4d219f521b5659d903c6b8 (patch) | |
tree | 6b7951bad560eaf6390ac0f0d208778f1a4f832b /Userland/Libraries | |
parent | 62d26a5afbfcfaec25a341fa3819936b56e1f3a5 (diff) | |
download | serenity-0a1bffdd92858361ce4d219f521b5659d903c6b8.zip |
LibWeb: Move gap tracks initialization into separate method in GFC
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/GridFormattingContext.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp index 3de1a00d2d..70a4dd63d5 100644 --- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp @@ -610,7 +610,10 @@ void GridFormattingContext::initialize_grid_tracks(AvailableSpace const& availab m_grid_columns.append(TemporaryTrack()); for (int row_index = m_grid_rows.size(); row_index < m_occupation_grid.row_count(); row_index++) m_grid_rows.append(TemporaryTrack()); +} +void GridFormattingContext::initialize_gap_tracks(AvailableSpace const& available_space) +{ // https://www.w3.org/TR/css-grid-2/#gutters // 11.1. Gutters: the row-gap, column-gap, and gap properties // For the purpose of track sizing, each gutter is treated as an extra, empty, fixed-size track of @@ -1337,6 +1340,8 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const // The grid sizing algorithm defines how to resolve these sizing constraints into used track sizes. initialize_grid_tracks(available_space); + initialize_gap_tracks(available_space); + // https://www.w3.org/TR/css-grid-2/#algo-overview // 12.1. Grid Sizing Algorithm diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h index 429510c88b..a81ab876c2 100644 --- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.h @@ -163,6 +163,7 @@ private: void place_item_with_no_declared_position(Box const& child_box, int& auto_placement_cursor_x, int& auto_placement_cursor_y); void initialize_grid_tracks(AvailableSpace const&); + void initialize_gap_tracks(AvailableSpace const&); void run_track_sizing(GridDimension const dimension, AvailableSpace const& available_space, Vector<TemporaryTrack>& tracks); CSSPixels content_based_minimum_height(GridItem const&); |