mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
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:
parent
35cb6badc2
commit
76daba3069
Notes:
github-actions[bot]
2024-09-18 19:39:35 +00:00
Author: https://github.com/AtkinsSJ
Commit: 76daba3069
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1433
32 changed files with 340 additions and 340 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue