From 6b69b00a05c8256790ae75ae43acf91c7d3ef9aa Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 18 Aug 2025 14:10:11 +0100 Subject: [PATCH] LibWeb/CSS: Use serialize_a_number() for Time serialization As noted, the spec tells us to do something different than what is expected by WPT, so we slightly ignore it. --- Libraries/LibWeb/CSS/Time.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Libraries/LibWeb/CSS/Time.cpp b/Libraries/LibWeb/CSS/Time.cpp index e362aeb108f..6eb360555ff 100644 --- a/Libraries/LibWeb/CSS/Time.cpp +++ b/Libraries/LibWeb/CSS/Time.cpp @@ -28,9 +28,21 @@ Time Time::percentage_of(Percentage const& percentage) const String Time::to_string(SerializationMode serialization_mode) const { - if (serialization_mode == SerializationMode::ResolvedValue) - return MUST(String::formatted("{}s", to_seconds())); - return MUST(String::formatted("{}{}", raw_value(), unit_name())); + // https://drafts.csswg.org/cssom/#serialize-a-css-value + // ->