1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:07:35 +00:00

LibWeb: Convert background-position to LengthPercentage

Not much needed changing this time, hurrah! :^)
This commit is contained in:
Sam Atkins 2022-01-19 11:20:40 +00:00 committed by Andreas Kling
parent 0162ca912b
commit 784ba2ec42
4 changed files with 36 additions and 21 deletions

View file

@ -1215,21 +1215,21 @@ private:
class PositionStyleValue final : public StyleValue {
public:
static NonnullRefPtr<PositionStyleValue> create(PositionEdge edge_x, Length const& offset_x, PositionEdge edge_y, Length const& offset_y)
static NonnullRefPtr<PositionStyleValue> create(PositionEdge edge_x, LengthPercentage const& offset_x, PositionEdge edge_y, LengthPercentage const& offset_y)
{
return adopt_ref(*new PositionStyleValue(edge_x, offset_x, edge_y, offset_y));
}
virtual ~PositionStyleValue() override { }
PositionEdge edge_x() const { return m_edge_x; }
Length const& offset_x() const { return m_offset_x; }
LengthPercentage const& offset_x() const { return m_offset_x; }
PositionEdge edge_y() const { return m_edge_y; }
Length const& offset_y() const { return m_offset_y; }
LengthPercentage const& offset_y() const { return m_offset_y; }
virtual String to_string() const override;
private:
PositionStyleValue(PositionEdge edge_x, Length const& offset_x, PositionEdge edge_y, Length const& offset_y)
PositionStyleValue(PositionEdge edge_x, LengthPercentage const& offset_x, PositionEdge edge_y, LengthPercentage const& offset_y)
: StyleValue(Type::Position)
, m_edge_x(edge_x)
, m_offset_x(offset_x)
@ -1239,9 +1239,9 @@ private:
}
PositionEdge m_edge_x;
Length m_offset_x;
LengthPercentage m_offset_x;
PositionEdge m_edge_y;
Length m_offset_y;
LengthPercentage m_offset_y;
};
class StringStyleValue : public StyleValue {