From f6a8e5aa6856a5a13b2a67eb9b331cbdff235046 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 18 Mar 2025 12:52:58 +0000 Subject: [PATCH] LibWeb: Use correct canonical serialization for `BorderRadiusStyleValue` --- .../LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp | 2 +- .../css/css-backgrounds/parsing/border-radius-valid.txt | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp index 0cba0161268..858983e778a 100644 --- a/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/BorderRadiusStyleValue.cpp @@ -15,7 +15,7 @@ String BorderRadiusStyleValue::to_string(SerializationMode) const { if (m_properties.horizontal_radius == m_properties.vertical_radius) return m_properties.horizontal_radius.to_string(); - return MUST(String::formatted("{} / {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string())); + return MUST(String::formatted("{} {}", m_properties.horizontal_radius.to_string(), m_properties.vertical_radius.to_string())); } ValueComparingNonnullRefPtr BorderRadiusStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-radius-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-radius-valid.txt index 32491ba978b..70537af92e7 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-radius-valid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-backgrounds/parsing/border-radius-valid.txt @@ -2,8 +2,7 @@ Harness status: OK Found 23 tests -21 Pass -2 Fail +23 Pass Pass e.style['border-radius'] = "initial" should set the property value Pass e.style['border-radius'] = "inherit" should set the property value Pass e.style['border-radius'] = "unset" should set the property value @@ -25,5 +24,5 @@ Pass e.style['border-radius'] = "1px 2% 1px 1px" should set the property value Pass e.style['border-radius'] = "1px 2% 2% 2% / 1px 2% 3px 2%" should set the property value Pass e.style['border-top-left-radius'] = "10px" should set the property value Pass e.style['border-top-right-radius'] = "20%" should set the property value -Fail e.style['border-bottom-right-radius'] = "30px 40%" should set the property value -Fail e.style['border-bottom-left-radius'] = "50% 60px" should set the property value \ No newline at end of file +Pass e.style['border-bottom-right-radius'] = "30px 40%" should set the property value +Pass e.style['border-bottom-left-radius'] = "50% 60px" should set the property value \ No newline at end of file