mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
LibWeb: Rename CombinedBorderRadiusSV -> BorderRadiusShorthandSV
This commit is contained in:
parent
e1cd36559d
commit
d9afc2d6f2
3 changed files with 34 additions and 34 deletions
|
@ -281,7 +281,7 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
|||
bottom_right_radius = maybe_bottom_right_radius.value().value->as_border_radius();
|
||||
}
|
||||
|
||||
return CombinedBorderRadiusStyleValue::create(top_left_radius.release_nonnull(), top_right_radius.release_nonnull(), bottom_right_radius.release_nonnull(), bottom_left_radius.release_nonnull());
|
||||
return BorderRadiusShorthandStyleValue::create(top_left_radius.release_nonnull(), top_right_radius.release_nonnull(), bottom_right_radius.release_nonnull(), bottom_left_radius.release_nonnull());
|
||||
}
|
||||
// FIXME: The two radius components are not yet stored, as we currently don't actually render them.
|
||||
case CSS::PropertyID::BorderBottomLeftRadius:
|
||||
|
|
|
@ -1004,7 +1004,7 @@ String ColorStyleValue::to_string() const
|
|||
return String::formatted("rgba({}, {}, {}, {})", m_color.red(), m_color.green(), m_color.blue(), (float)(m_color.alpha()) / 255.0f);
|
||||
}
|
||||
|
||||
String CombinedBorderRadiusStyleValue::to_string() const
|
||||
String BorderRadiusShorthandStyleValue::to_string() const
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -84,9 +84,9 @@ public:
|
|||
BackgroundSize,
|
||||
Border,
|
||||
BorderRadius,
|
||||
BorderRadiusShorthand,
|
||||
Calculated,
|
||||
Color,
|
||||
CombinedBorderRadius,
|
||||
Content,
|
||||
Flex,
|
||||
FlexFlow,
|
||||
|
@ -472,6 +472,37 @@ private:
|
|||
LengthPercentage m_vertical_radius;
|
||||
};
|
||||
|
||||
class BorderRadiusShorthandStyleValue final : public StyleValue {
|
||||
public:
|
||||
static NonnullRefPtr<BorderRadiusShorthandStyleValue> create(NonnullRefPtr<BorderRadiusStyleValue> top_left, NonnullRefPtr<BorderRadiusStyleValue> top_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_left)
|
||||
{
|
||||
return adopt_ref(*new BorderRadiusShorthandStyleValue(top_left, top_right, bottom_right, bottom_left));
|
||||
}
|
||||
virtual ~BorderRadiusShorthandStyleValue() override = default;
|
||||
|
||||
NonnullRefPtr<BorderRadiusStyleValue> top_left() const { return m_top_left; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> top_right() const { return m_top_right; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> bottom_right() const { return m_bottom_right; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> bottom_left() const { return m_bottom_left; }
|
||||
|
||||
virtual String to_string() const override;
|
||||
|
||||
private:
|
||||
BorderRadiusShorthandStyleValue(NonnullRefPtr<BorderRadiusStyleValue> top_left, NonnullRefPtr<BorderRadiusStyleValue> top_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_left)
|
||||
: StyleValue(Type::BorderRadiusShorthand)
|
||||
, m_top_left(top_left)
|
||||
, m_top_right(top_right)
|
||||
, m_bottom_right(bottom_right)
|
||||
, m_bottom_left(bottom_left)
|
||||
{
|
||||
}
|
||||
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_top_left;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_top_right;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_bottom_right;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_bottom_left;
|
||||
};
|
||||
|
||||
class CalculatedStyleValue : public StyleValue {
|
||||
public:
|
||||
enum class ResolvedType {
|
||||
|
@ -686,37 +717,6 @@ private:
|
|||
Color m_color;
|
||||
};
|
||||
|
||||
class CombinedBorderRadiusStyleValue final : public StyleValue {
|
||||
public:
|
||||
static NonnullRefPtr<CombinedBorderRadiusStyleValue> create(NonnullRefPtr<BorderRadiusStyleValue> top_left, NonnullRefPtr<BorderRadiusStyleValue> top_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_left)
|
||||
{
|
||||
return adopt_ref(*new CombinedBorderRadiusStyleValue(top_left, top_right, bottom_right, bottom_left));
|
||||
}
|
||||
virtual ~CombinedBorderRadiusStyleValue() override = default;
|
||||
|
||||
NonnullRefPtr<BorderRadiusStyleValue> top_left() const { return m_top_left; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> top_right() const { return m_top_right; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> bottom_right() const { return m_bottom_right; }
|
||||
NonnullRefPtr<BorderRadiusStyleValue> bottom_left() const { return m_bottom_left; }
|
||||
|
||||
virtual String to_string() const override;
|
||||
|
||||
private:
|
||||
CombinedBorderRadiusStyleValue(NonnullRefPtr<BorderRadiusStyleValue> top_left, NonnullRefPtr<BorderRadiusStyleValue> top_right, NonnullRefPtr<BorderRadiusStyleValue> bottom_right, NonnullRefPtr<BorderRadiusStyleValue> 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<BorderRadiusStyleValue> m_top_left;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_top_right;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_bottom_right;
|
||||
NonnullRefPtr<BorderRadiusStyleValue> m_bottom_left;
|
||||
};
|
||||
|
||||
class ContentStyleValue final : public StyleValue {
|
||||
public:
|
||||
static NonnullRefPtr<ContentStyleValue> create(NonnullRefPtr<StyleValueList> content, RefPtr<StyleValueList> alt_text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue