diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index bba3b18f3d..12e1f52ff1 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -233,6 +233,7 @@ public: BackgroundRepeat, Border, BorderRadius, + CombinedBorderRadius, BoxShadow, Flex, FlexFlow, @@ -814,6 +815,40 @@ private: Length m_vertical_radius; }; +class CombinedBorderRadiusStyleValue final : public StyleValue { +public: + static NonnullRefPtr create(NonnullRefPtr top_left, NonnullRefPtr top_right, NonnullRefPtr bottom_right, NonnullRefPtr bottom_left) + { + return adopt_ref(*new CombinedBorderRadiusStyleValue(top_left, top_right, bottom_right, bottom_left)); + } + virtual ~CombinedBorderRadiusStyleValue() override { } + + NonnullRefPtr top_left() const { return m_top_left; } + NonnullRefPtr top_right() const { return m_top_right; } + NonnullRefPtr bottom_right() const { return m_bottom_right; } + NonnullRefPtr bottom_left() const { return m_bottom_left; } + + virtual String to_string() const override + { + return String::formatted("{} {} {} {} / {} {} {} {}", m_top_left->horizontal_radius().to_string(), m_top_right->horizontal_radius().to_string(), m_bottom_right->horizontal_radius().to_string(), m_bottom_left->horizontal_radius().to_string(), m_top_left->vertical_radius().to_string(), m_top_right->vertical_radius().to_string(), m_bottom_right->vertical_radius().to_string(), m_bottom_left->vertical_radius().to_string()); + } + +private: + CombinedBorderRadiusStyleValue(NonnullRefPtr top_left, NonnullRefPtr top_right, NonnullRefPtr bottom_right, NonnullRefPtr bottom_left) + : StyleValue(Type::CombinedBorderRadius) + , m_top_left(top_left) + , m_top_right(top_right) + , m_bottom_right(bottom_right) + , m_bottom_left(bottom_left) + { + } + + NonnullRefPtr m_top_left; + NonnullRefPtr m_top_right; + NonnullRefPtr m_bottom_right; + NonnullRefPtr m_bottom_left; +}; + class FlexStyleValue final : public StyleValue { public: static NonnullRefPtr create(