LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue

This matches the name in the CSS Typed OM spec. There's quite a lot
still to do to make it match the spec behavior, but this is the first
step.
This commit is contained in:
Sam Atkins 2024-09-18 17:27:47 +01:00 committed by Sam Atkins
commit 76daba3069
Notes: github-actions[bot] 2024-09-18 19:39:35 +00:00
32 changed files with 340 additions and 340 deletions

View file

@ -18,7 +18,7 @@
#include <LibWeb/CSS/StyleValues/BorderRadiusStyleValue.h>
#include <LibWeb/CSS/StyleValues/CSSColorValue.h>
#include <LibWeb/CSS/StyleValues/CSSKeywordValue.h>
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
#include <LibWeb/CSS/StyleValues/CSSMathValue.h>
#include <LibWeb/CSS/StyleValues/ConicGradientStyleValue.h>
#include <LibWeb/CSS/StyleValues/ContentStyleValue.h>
#include <LibWeb/CSS/StyleValues/CounterDefinitionsStyleValue.h>
@ -100,10 +100,10 @@ BorderRadiusStyleValue const& CSSStyleValue::as_border_radius() const
return static_cast<BorderRadiusStyleValue const&>(*this);
}
CalculatedStyleValue const& CSSStyleValue::as_calculated() const
CSSMathValue const& CSSStyleValue::as_math() const
{
VERIFY(is_calculated());
return static_cast<CalculatedStyleValue const&>(*this);
VERIFY(is_math());
return static_cast<CSSMathValue const&>(*this);
}
CSSColorValue const& CSSStyleValue::as_color() const
@ -378,8 +378,8 @@ int CSSStyleValue::to_font_weight() const
if (is_number()) {
return round_to<int>(as_number().number());
}
if (is_calculated()) {
auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();
if (is_math()) {
auto maybe_weight = const_cast<CSSMathValue&>(as_math()).resolve_integer();
if (maybe_weight.has_value())
return maybe_weight.value();
}