mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Preserve unit when serializing angle values
Previously, when serializing an angle value, we would always convert it to degrees. We now canonicalize the angle value only when serializing its computed value.
This commit is contained in:
parent
d0be5a0cdf
commit
5bfbb7abe6
Notes:
github-actions[bot]
2025-03-20 17:00:27 +00:00
Author: https://github.com/tcl3
Commit: 5bfbb7abe6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4004
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 20 additions and 19 deletions
|
@ -19,8 +19,10 @@ AngleStyleValue::AngleStyleValue(Angle angle)
|
|||
|
||||
AngleStyleValue::~AngleStyleValue() = default;
|
||||
|
||||
String AngleStyleValue::to_string(SerializationMode) const
|
||||
String AngleStyleValue::to_string(SerializationMode serialization_mode) const
|
||||
{
|
||||
if (serialization_mode == SerializationMode::ResolvedValue)
|
||||
return MUST(String::formatted("{}deg", m_angle.to_degrees()));
|
||||
return m_angle.to_string();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue