mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:07:35 +00:00
LibWeb/Layout: Add support for grid-auto-flow
in GFC
This commit is contained in:
parent
703c2bb06e
commit
37f5253ec9
3 changed files with 38 additions and 3 deletions
|
@ -534,6 +534,8 @@ void GridFormattingContext::place_item_with_no_declared_position(Box const& chil
|
|||
row_span = child_box.computed_values().grid_row_end().raw_value();
|
||||
auto found_unoccupied_area = false;
|
||||
|
||||
auto const& auto_flow = grid_container().computed_values().grid_auto_flow();
|
||||
|
||||
while (true) {
|
||||
while (auto_placement_cursor_x <= m_occupation_grid.max_column_index()) {
|
||||
if (auto_placement_cursor_x + static_cast<int>(column_span) <= m_occupation_grid.max_column_index() + 1) {
|
||||
|
@ -562,9 +564,13 @@ void GridFormattingContext::place_item_with_no_declared_position(Box const& chil
|
|||
// row position (creating new rows in the implicit grid as necessary), set its column position to the
|
||||
// start-most column line in the implicit grid, and return to the previous step.
|
||||
if (!found_unoccupied_area) {
|
||||
auto_placement_cursor_x = m_occupation_grid.min_column_index();
|
||||
auto_placement_cursor_y++;
|
||||
row_start = auto_placement_cursor_y;
|
||||
if (auto_flow.row) {
|
||||
auto_placement_cursor_x = m_occupation_grid.min_column_index();
|
||||
auto_placement_cursor_y++;
|
||||
} else {
|
||||
m_occupation_grid.set_max_column_index(auto_placement_cursor_x);
|
||||
auto_placement_cursor_y = m_occupation_grid.min_row_index();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue