mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
LibWeb: Make serializing GridTrack classes infallible
This commit is contained in:
parent
6bee81cfb6
commit
2754c16e97
7 changed files with 31 additions and 31 deletions
|
@ -34,13 +34,13 @@ ErrorOr<String> GridAreaShorthandStyleValue::to_string() const
|
|||
{
|
||||
StringBuilder builder;
|
||||
if (!m_properties.row_start->as_grid_track_placement().grid_track_placement().is_auto())
|
||||
TRY(builder.try_appendff("{}", TRY(m_properties.row_start->as_grid_track_placement().grid_track_placement().to_string())));
|
||||
TRY(builder.try_appendff("{}", m_properties.row_start->as_grid_track_placement().grid_track_placement().to_string()));
|
||||
if (!m_properties.column_start->as_grid_track_placement().grid_track_placement().is_auto())
|
||||
TRY(builder.try_appendff(" / {}", TRY(m_properties.column_start->as_grid_track_placement().grid_track_placement().to_string())));
|
||||
TRY(builder.try_appendff(" / {}", m_properties.column_start->as_grid_track_placement().grid_track_placement().to_string()));
|
||||
if (!m_properties.row_end->as_grid_track_placement().grid_track_placement().is_auto())
|
||||
TRY(builder.try_appendff(" / {}", TRY(m_properties.row_end->as_grid_track_placement().grid_track_placement().to_string())));
|
||||
TRY(builder.try_appendff(" / {}", m_properties.row_end->as_grid_track_placement().grid_track_placement().to_string()));
|
||||
if (!m_properties.column_end->as_grid_track_placement().grid_track_placement().is_auto())
|
||||
TRY(builder.try_appendff(" / {}", TRY(m_properties.column_end->as_grid_track_placement().grid_track_placement().to_string())));
|
||||
TRY(builder.try_appendff(" / {}", m_properties.column_end->as_grid_track_placement().grid_track_placement().to_string()));
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ ValueComparingNonnullRefPtr<GridTrackPlacementShorthandStyleValue> GridTrackPlac
|
|||
ErrorOr<String> GridTrackPlacementShorthandStyleValue::to_string() const
|
||||
{
|
||||
if (m_properties.end->grid_track_placement().is_auto())
|
||||
return String::formatted("{}", TRY(m_properties.start->grid_track_placement().to_string()));
|
||||
return String::formatted("{} / {}", TRY(m_properties.start->grid_track_placement().to_string()), TRY(m_properties.end->grid_track_placement().to_string()));
|
||||
return String::formatted("{}", m_properties.start->grid_track_placement().to_string());
|
||||
return String::formatted("{} / {}", m_properties.start->grid_track_placement().to_string(), m_properties.end->grid_track_placement().to_string());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ ErrorOr<String> GridTrackSizeListShorthandStyleValue::to_string() const
|
|||
}
|
||||
TRY(builder.try_append("\" "sv));
|
||||
}
|
||||
TRY(builder.try_append(TRY(row.to_string())));
|
||||
TRY(builder.try_append(row.to_string()));
|
||||
if (idx < m_properties.rows->grid_track_size_list().track_list().size() - 1)
|
||||
TRY(builder.try_append(' '));
|
||||
idx++;
|
||||
|
@ -42,7 +42,7 @@ ErrorOr<String> GridTrackSizeListShorthandStyleValue::to_string() const
|
|||
|
||||
if (m_properties.columns->grid_track_size_list().track_list().size() == 0)
|
||||
return String::formatted("{}", TRY(construct_rows_string()));
|
||||
return String::formatted("{} / {}", TRY(construct_rows_string()), TRY(m_properties.columns->grid_track_size_list().to_string()));
|
||||
return String::formatted("{} / {}", TRY(construct_rows_string()), m_properties.columns->grid_track_size_list().to_string());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue