LibWeb: Merge consecutive grid lines in GridTrackSizeList

Fixes a bug where consecutively defined grid lines were not merged
during serialization.
This commit is contained in:
Aliaksandr Kalenik 2025-06-22 20:41:51 +02:00 committed by Alexander Kalenik
commit 6ec6e755b2
Notes: github-actions[bot] 2025-06-22 19:16:36 +00:00
3 changed files with 10 additions and 6 deletions

View file

@ -209,6 +209,11 @@ bool GridTrackSizeList::operator==(GridTrackSizeList const& other) const = defau
void GridTrackSizeList::append(GridLineNames&& line_names)
{
if (!m_list.is_empty() && m_list.last().has<GridLineNames>()) {
auto& last_line_names = m_list.last().get<GridLineNames>();
last_line_names.names.extend(move(line_names.names));
return;
}
m_list.append(move(line_names));
}