LibWeb: Ensure shortest serialization is used for grid-row values

This commit is contained in:
Tim Ledbetter 2025-03-18 15:03:35 +00:00 committed by Alexander Kalenik
commit 6811264b11
Notes: github-actions[bot] 2025-03-19 01:09:02 +00:00
4 changed files with 14 additions and 14 deletions

View file

@ -337,7 +337,7 @@ String ShorthandStyleValue::to_string(SerializationMode mode) const
case PropertyID::GridRow: {
auto start = longhand(PropertyID::GridRowStart);
auto end = longhand(PropertyID::GridRowEnd);
if (end->as_grid_track_placement().grid_track_placement().is_auto())
if (end->as_grid_track_placement().grid_track_placement().is_auto() || start == end)
return start->to_string(mode);
return MUST(String::formatted("{} / {}", start->to_string(mode), end->to_string(mode)));
}