diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index 0e195b84e3..502846a024 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -574,9 +574,6 @@ public: Length const& vertical_radius() const { return m_vertical_radius; } bool is_elliptical() const { return m_is_elliptical; } - // FIXME: Remove this once we support elliptical border-radius in Layout/Node. - virtual Length to_length() const override { return horizontal_radius(); } - virtual String to_string() const override { return String::formatted("{} / {}", m_horizontal_radius.to_string(), m_vertical_radius.to_string()); diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 27dfbeaaf1..b94e987521 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -341,20 +341,20 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style) // FIXME: BorderXRadius properties are now BorderRadiusStyleValues, so make use of that. auto border_bottom_left_radius = specified_style.property(CSS::PropertyID::BorderBottomLeftRadius); - if (border_bottom_left_radius.has_value()) - computed_values.set_border_bottom_left_radius(border_bottom_left_radius.value()->to_length()); + if (border_bottom_left_radius.has_value() && border_bottom_left_radius.value()->is_border_radius()) + computed_values.set_border_bottom_left_radius(border_bottom_left_radius.value()->as_border_radius().horizontal_radius()); auto border_bottom_right_radius = specified_style.property(CSS::PropertyID::BorderBottomRightRadius); - if (border_bottom_right_radius.has_value()) - computed_values.set_border_bottom_right_radius(border_bottom_right_radius.value()->to_length()); + if (border_bottom_right_radius.has_value() && border_bottom_right_radius.value()->is_border_radius()) + computed_values.set_border_bottom_right_radius(border_bottom_right_radius.value()->as_border_radius().horizontal_radius()); auto border_top_left_radius = specified_style.property(CSS::PropertyID::BorderTopLeftRadius); - if (border_top_left_radius.has_value()) - computed_values.set_border_top_left_radius(border_top_left_radius.value()->to_length()); + if (border_top_left_radius.has_value() && border_top_left_radius.value()->is_border_radius()) + computed_values.set_border_top_left_radius(border_top_left_radius.value()->as_border_radius().horizontal_radius()); auto border_top_right_radius = specified_style.property(CSS::PropertyID::BorderTopRightRadius); - if (border_top_right_radius.has_value()) - computed_values.set_border_top_right_radius(border_top_right_radius.value()->to_length()); + if (border_top_right_radius.has_value() && border_top_right_radius.value()->is_border_radius()) + computed_values.set_border_top_right_radius(border_top_right_radius.value()->as_border_radius().horizontal_radius()); computed_values.set_display(specified_style.display());