mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Serialize CSS::Number to spec
We were previously serializing with 5 instead of 6 digits of precision
This commit is contained in:
parent
76108b1979
commit
8944130fde
Notes:
github-actions[bot]
2025-12-01 11:02:13 +00:00
Author: https://github.com/Calme1709
Commit: 8944130fde
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6707
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <AK/Math.h>
|
||||
#include <LibWeb/CSS/Number.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ String Number::to_string(SerializationMode) const
|
|||
return "-infinity"_string;
|
||||
if (isnan(m_value))
|
||||
return "NaN"_string;
|
||||
return MUST(String::formatted("{:.5}", m_value));
|
||||
return serialize_a_number(m_value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue