mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
LibWeb: Make serializing basic CSS types infallible
This commit is contained in:
parent
b5893ee115
commit
6bee81cfb6
38 changed files with 128 additions and 121 deletions
|
@ -186,11 +186,11 @@ CSSPixels Length::to_px(Layout::Node const& layout_node) const
|
|||
return viewport_relative_length_to_px(viewport_rect);
|
||||
}
|
||||
|
||||
ErrorOr<String> Length::to_string() const
|
||||
String Length::to_string() const
|
||||
{
|
||||
if (is_auto())
|
||||
return "auto"_string;
|
||||
return String::formatted("{}{}", m_value, unit_name());
|
||||
return MUST(String::formatted("{}{}", m_value, unit_name()));
|
||||
}
|
||||
|
||||
char const* Length::unit_name() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue