mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:07:34 +00:00
LibWeb: Add GridTrackPlacement for grid-[column/row]-[start/end]
Add GridTrackPlacement to use with grid-column-start and related CSS properties.
This commit is contained in:
parent
fc36970973
commit
ca286fc220
4 changed files with 76 additions and 0 deletions
36
Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp
Normal file
36
Userland/Libraries/LibWeb/CSS/GridTrackPlacement.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Martin Falisse <mfalisse@outlook.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "GridTrackPlacement.h"
|
||||
#include <AK/String.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
GridTrackPlacement::GridTrackPlacement(int position, bool has_span)
|
||||
: m_position(position)
|
||||
, m_has_span(has_span)
|
||||
{
|
||||
}
|
||||
|
||||
GridTrackPlacement::GridTrackPlacement(int position)
|
||||
: m_position(position)
|
||||
{
|
||||
}
|
||||
|
||||
GridTrackPlacement::GridTrackPlacement()
|
||||
{
|
||||
}
|
||||
|
||||
String GridTrackPlacement::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
if (m_has_span)
|
||||
builder.append("span "sv);
|
||||
builder.append(String::number(m_position));
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue