mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibWeb: Add GridTrackPlacementStyleValue
Add GridTrackPlacementStyleValue for the use of CSS properties grid-column-start, grid-column-end, grid-row-start, grid-row-end.
This commit is contained in:
parent
0148260b5f
commit
08b832eb69
3 changed files with 49 additions and 0 deletions
|
@ -120,6 +120,12 @@ FrequencyStyleValue const& StyleValue::as_frequency() const
|
|||
return static_cast<FrequencyStyleValue const&>(*this);
|
||||
}
|
||||
|
||||
GridTrackPlacementStyleValue const& StyleValue::as_grid_track_placement() const
|
||||
{
|
||||
VERIFY(is_grid_track_placement());
|
||||
return static_cast<GridTrackPlacementStyleValue const&>(*this);
|
||||
}
|
||||
|
||||
IdentifierStyleValue const& StyleValue::as_identifier() const
|
||||
{
|
||||
VERIFY(is_identifier());
|
||||
|
@ -1204,6 +1210,19 @@ bool FrequencyStyleValue::equals(StyleValue const& other) const
|
|||
return m_frequency == other.as_frequency().m_frequency;
|
||||
}
|
||||
|
||||
String GridTrackPlacementStyleValue::to_string() const
|
||||
{
|
||||
return m_grid_track_placement.to_string();
|
||||
}
|
||||
|
||||
bool GridTrackPlacementStyleValue::equals(StyleValue const& other) const
|
||||
{
|
||||
if (type() != other.type())
|
||||
return false;
|
||||
auto const& typed_other = other.as_grid_track_placement();
|
||||
return m_grid_track_placement == typed_other.grid_track_placement();
|
||||
}
|
||||
|
||||
String GridTrackSizeStyleValue::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
@ -1931,6 +1950,11 @@ NonnullRefPtr<ColorStyleValue> ColorStyleValue::create(Color color)
|
|||
return adopt_ref(*new ColorStyleValue(color));
|
||||
}
|
||||
|
||||
NonnullRefPtr<GridTrackPlacementStyleValue> GridTrackPlacementStyleValue::create(CSS::GridTrackPlacement grid_track_placement)
|
||||
{
|
||||
return adopt_ref(*new GridTrackPlacementStyleValue(grid_track_placement));
|
||||
}
|
||||
|
||||
NonnullRefPtr<GridTrackSizeStyleValue> GridTrackSizeStyleValue::create(Vector<CSS::GridTrackSize> grid_track_size)
|
||||
{
|
||||
return adopt_ref(*new GridTrackSizeStyleValue(grid_track_size));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue