1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:47:46 +00:00

LibWeb+WebContent: Use new String class in CSS::StyleValue

Converts uses of DeprecatedString to String in StyleValue, and patches
surrounding files that depend on these functions.
This commit is contained in:
martinfalisse 2023-01-06 19:02:26 +01:00 committed by Andreas Kling
parent 1c2e7b1e47
commit ce0f41b9fb
37 changed files with 335 additions and 330 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/String.h>
#include <AK/Types.h>
#include <math.h>
@ -69,11 +69,11 @@ public:
return { Type::Number, m_value / other.m_value };
}
DeprecatedString to_deprecated_string() const
ErrorOr<String> to_string() const
{
if (m_type == Type::IntegerWithExplicitSign)
return DeprecatedString::formatted("{:+}", m_value);
return DeprecatedString::number(m_value);
return String::formatted("{:+}", m_value);
return String::number(m_value);
}
bool operator==(Number const& other) const
@ -91,6 +91,6 @@ template<>
struct AK::Formatter<Web::CSS::Number> : Formatter<StringView> {
ErrorOr<void> format(FormatBuilder& builder, Web::CSS::Number const& number)
{
return Formatter<StringView>::format(builder, number.to_deprecated_string());
return Formatter<StringView>::format(builder, TRY(number.to_string()));
}
};