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

LibWeb: Account for auto-fill/fit when expanding grid lines in GFC

Named line placement now works when auto-fill or auto-fit is used to
define grid columns.
This commit is contained in:
Aliaksandr Kalenik 2024-01-05 21:32:47 +01:00 committed by Andreas Kling
parent 90142ad307
commit 9c72807976
3 changed files with 38 additions and 3 deletions

View file

@ -2279,11 +2279,17 @@ void GridFormattingContext::init_grid_lines(GridDimension dimension)
if (explicit_track.is_default() || explicit_track.is_minmax()) {
lines.append({ .names = line_names });
line_names.clear();
} else if (explicit_track.is_repeat() && explicit_track.repeat().is_default()) {
} else if (explicit_track.is_repeat()) {
int repeat_count = 0;
if (explicit_track.repeat().is_auto_fill() || explicit_track.repeat().is_auto_fit())
repeat_count = count_of_repeated_auto_fill_or_fit_tracks(lines_definition.track_list(), *m_available_space);
else
repeat_count = explicit_track.repeat().repeat_count();
auto const& repeat_track = explicit_track.repeat();
for (int i = 0; i < repeat_track.repeat_count(); i++) {
for (int i = 0; i < repeat_count; i++)
expand_lines_definition(repeat_track.grid_track_size_list());
}
} else {
VERIFY_NOT_REACHED();
}
}
}