Skip to content

Commit 5bd3bc3

Browse files
AtkinsSJtcl3
authored andcommitted
LibWeb/CSS: Rename color style value types
The typed-om classes will be separate.
1 parent 6cad3f1 commit 5bd3bc3

17 files changed

+109
-115
lines changed

Libraries/LibWeb/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,6 @@ set(SOURCES
201201
CSS/StyleValues/ContentStyleValue.cpp
202202
CSS/StyleValues/CounterDefinitionsStyleValue.cpp
203203
CSS/StyleValues/CounterStyleValue.cpp
204-
CSS/StyleValues/CSSHSL.cpp
205-
CSS/StyleValues/CSSHWB.cpp
206-
CSS/StyleValues/CSSLabLike.cpp
207-
CSS/StyleValues/CSSLCHLike.cpp
208-
CSS/StyleValues/CSSLightDark.cpp
209-
CSS/StyleValues/CSSRGB.cpp
210204
CSS/StyleValues/CursorStyleValue.cpp
211205
CSS/StyleValues/DisplayStyleValue.cpp
212206
CSS/StyleValues/EasingStyleValue.cpp
@@ -218,15 +212,21 @@ set(SOURCES
218212
CSS/StyleValues/GridTemplateAreaStyleValue.cpp
219213
CSS/StyleValues/GridTrackPlacementStyleValue.cpp
220214
CSS/StyleValues/GridTrackSizeListStyleValue.cpp
215+
CSS/StyleValues/HSLColorStyleValue.cpp
216+
CSS/StyleValues/HWBColorStyleValue.cpp
221217
CSS/StyleValues/ImageStyleValue.cpp
222218
CSS/StyleValues/IntegerStyleValue.cpp
223219
CSS/StyleValues/KeywordStyleValue.cpp
220+
CSS/StyleValues/LCHLikeColorStyleValue.cpp
221+
CSS/StyleValues/LabLikeColorStyleValue.cpp
224222
CSS/StyleValues/LengthStyleValue.cpp
223+
CSS/StyleValues/LightDarkStyleValue.cpp
225224
CSS/StyleValues/LinearGradientStyleValue.cpp
226225
CSS/StyleValues/MathDepthStyleValue.cpp
227226
CSS/StyleValues/NumberStyleValue.cpp
228227
CSS/StyleValues/OpenTypeTaggedStyleValue.cpp
229228
CSS/StyleValues/PositionStyleValue.cpp
229+
CSS/StyleValues/RGBColorStyleValue.cpp
230230
CSS/StyleValues/RadialGradientStyleValue.cpp
231231
CSS/StyleValues/RectStyleValue.cpp
232232
CSS/StyleValues/RepeatStyleStyleValue.cpp

Libraries/LibWeb/CSS/Parser/ValueParsing.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
#include <LibWeb/CSS/StyleValues/AngleStyleValue.h>
2828
#include <LibWeb/CSS/StyleValues/BackgroundSizeStyleValue.h>
2929
#include <LibWeb/CSS/StyleValues/BasicShapeStyleValue.h>
30-
#include <LibWeb/CSS/StyleValues/CSSHSL.h>
31-
#include <LibWeb/CSS/StyleValues/CSSHWB.h>
32-
#include <LibWeb/CSS/StyleValues/CSSLCHLike.h>
33-
#include <LibWeb/CSS/StyleValues/CSSLabLike.h>
34-
#include <LibWeb/CSS/StyleValues/CSSLightDark.h>
35-
#include <LibWeb/CSS/StyleValues/CSSRGB.h>
3630
#include <LibWeb/CSS/StyleValues/ColorFunctionStyleValue.h>
3731
#include <LibWeb/CSS/StyleValues/ColorMixStyleValue.h>
3832
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
@@ -49,14 +43,20 @@
4943
#include <LibWeb/CSS/StyleValues/GridTrackPlacementStyleValue.h>
5044
#include <LibWeb/CSS/StyleValues/GridTrackSizeListStyleValue.h>
5145
#include <LibWeb/CSS/StyleValues/GuaranteedInvalidStyleValue.h>
46+
#include <LibWeb/CSS/StyleValues/HSLColorStyleValue.h>
47+
#include <LibWeb/CSS/StyleValues/HWBColorStyleValue.h>
5248
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
5349
#include <LibWeb/CSS/StyleValues/IntegerStyleValue.h>
5450
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
51+
#include <LibWeb/CSS/StyleValues/LCHLikeColorStyleValue.h>
52+
#include <LibWeb/CSS/StyleValues/LabLikeColorStyleValue.h>
5553
#include <LibWeb/CSS/StyleValues/LengthStyleValue.h>
54+
#include <LibWeb/CSS/StyleValues/LightDarkStyleValue.h>
5655
#include <LibWeb/CSS/StyleValues/LinearGradientStyleValue.h>
5756
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
5857
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
5958
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
59+
#include <LibWeb/CSS/StyleValues/RGBColorStyleValue.h>
6060
#include <LibWeb/CSS/StyleValues/RadialGradientStyleValue.h>
6161
#include <LibWeb/CSS/StyleValues/RatioStyleValue.h>
6262
#include <LibWeb/CSS/StyleValues/RectStyleValue.h>
@@ -1582,7 +1582,7 @@ RefPtr<StyleValue const> Parser::parse_rgb_color_value(TokenStream<ComponentValu
15821582
alpha = NumberStyleValue::create(1);
15831583

15841584
transaction.commit();
1585-
return CSSRGB::create(red.release_nonnull(), green.release_nonnull(), blue.release_nonnull(), alpha.release_nonnull(), legacy_syntax ? ColorSyntax::Legacy : ColorSyntax::Modern);
1585+
return RGBColorStyleValue::create(red.release_nonnull(), green.release_nonnull(), blue.release_nonnull(), alpha.release_nonnull(), legacy_syntax ? ColorSyntax::Legacy : ColorSyntax::Modern);
15861586
}
15871587

15881588
// https://www.w3.org/TR/css-color-4/#funcdef-hsl
@@ -1694,7 +1694,7 @@ RefPtr<StyleValue const> Parser::parse_hsl_color_value(TokenStream<ComponentValu
16941694
alpha = NumberStyleValue::create(1);
16951695

16961696
transaction.commit();
1697-
return CSSHSL::create(h.release_nonnull(), s.release_nonnull(), l.release_nonnull(), alpha.release_nonnull(), legacy_syntax ? ColorSyntax::Legacy : ColorSyntax::Modern);
1697+
return HSLColorStyleValue::create(h.release_nonnull(), s.release_nonnull(), l.release_nonnull(), alpha.release_nonnull(), legacy_syntax ? ColorSyntax::Legacy : ColorSyntax::Modern);
16981698
}
16991699

17001700
// https://www.w3.org/TR/css-color-4/#funcdef-hwb
@@ -1748,7 +1748,7 @@ RefPtr<StyleValue const> Parser::parse_hwb_color_value(TokenStream<ComponentValu
17481748
alpha = NumberStyleValue::create(1);
17491749

17501750
transaction.commit();
1751-
return CSSHWB::create(h.release_nonnull(), w.release_nonnull(), b.release_nonnull(), alpha.release_nonnull());
1751+
return HWBColorStyleValue::create(h.release_nonnull(), w.release_nonnull(), b.release_nonnull(), alpha.release_nonnull());
17521752
}
17531753

17541754
Optional<Array<RefPtr<StyleValue const>, 4>> Parser::parse_lab_like_color_value(TokenStream<ComponentValue>& outer_tokens, StringView function_name)
@@ -1817,7 +1817,7 @@ RefPtr<StyleValue const> Parser::parse_lab_color_value(TokenStream<ComponentValu
18171817

18181818
auto& color_values = *maybe_color_values;
18191819

1820-
return CSSLabLike::create<CSSLab>(color_values[0].release_nonnull(),
1820+
return LabLikeColorStyleValue::create<LabColorStyleValue>(color_values[0].release_nonnull(),
18211821
color_values[1].release_nonnull(),
18221822
color_values[2].release_nonnull(),
18231823
color_values[3].release_nonnull());
@@ -1837,7 +1837,7 @@ RefPtr<StyleValue const> Parser::parse_oklab_color_value(TokenStream<ComponentVa
18371837

18381838
auto& color_values = *maybe_color_values;
18391839

1840-
return CSSLabLike::create<CSSOKLab>(color_values[0].release_nonnull(),
1840+
return LabLikeColorStyleValue::create<OKLabColorStyleValue>(color_values[0].release_nonnull(),
18411841
color_values[1].release_nonnull(),
18421842
color_values[2].release_nonnull(),
18431843
color_values[3].release_nonnull());
@@ -1905,7 +1905,7 @@ RefPtr<StyleValue const> Parser::parse_lch_color_value(TokenStream<ComponentValu
19051905

19061906
auto& color_values = *maybe_color_values;
19071907

1908-
return CSSLCHLike::create<CSSLCH>(color_values[0].release_nonnull(),
1908+
return LCHLikeColorStyleValue::create<LCHColorStyleValue>(color_values[0].release_nonnull(),
19091909
color_values[1].release_nonnull(),
19101910
color_values[2].release_nonnull(),
19111911
color_values[3].release_nonnull());
@@ -1925,7 +1925,7 @@ RefPtr<StyleValue const> Parser::parse_oklch_color_value(TokenStream<ComponentVa
19251925

19261926
auto& color_values = *maybe_color_values;
19271927

1928-
return CSSLCHLike::create<CSSOKLCH>(color_values[0].release_nonnull(),
1928+
return LCHLikeColorStyleValue::create<OKLCHColorStyleValue>(color_values[0].release_nonnull(),
19291929
color_values[1].release_nonnull(),
19301930
color_values[2].release_nonnull(),
19311931
color_values[3].release_nonnull());
@@ -2156,7 +2156,7 @@ RefPtr<StyleValue const> Parser::parse_light_dark_color_value(TokenStream<Compon
21562156
return {};
21572157

21582158
transaction.commit();
2159-
return CSSLightDark::create(light.release_nonnull(), dark.release_nonnull());
2159+
return LightDarkStyleValue::create(light.release_nonnull(), dark.release_nonnull());
21602160
}
21612161

21622162
// https://www.w3.org/TR/css-color-4/#color-syntax

Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
#include <LibJS/Runtime/AbstractOperations.h>
1212
#include <LibWeb/CSS/Serialize.h>
1313
#include <LibWeb/CSS/StyleValues/AngleStyleValue.h>
14-
#include <LibWeb/CSS/StyleValues/CSSRGB.h>
1514
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
1615
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
1716
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
1817
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
18+
#include <LibWeb/CSS/StyleValues/RGBColorStyleValue.h>
1919

2020
namespace Web::CSS {
2121

2222
ValueComparingNonnullRefPtr<ColorStyleValue const> ColorStyleValue::create_from_color(Color color, ColorSyntax color_syntax, Optional<FlyString> name)
2323
{
24-
return CSSRGB::create(
24+
return RGBColorStyleValue::create(
2525
NumberStyleValue::create(color.red()),
2626
NumberStyleValue::create(color.green()),
2727
NumberStyleValue::create(color.blue()),

Libraries/LibWeb/CSS/StyleValues/ColorStyleValue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ColorStyleValue : public StyleValue {
2828
virtual bool has_color() const override { return true; }
2929

3030
enum class ColorType {
31-
RGB, // This is used by CSSRGB for rgb(...) and rgba(...).
31+
RGB, // This is used by RGBColorStyleValue for rgb(...) and rgba(...).
3232
A98RGB,
3333
DisplayP3,
3434
HSL,
@@ -37,13 +37,13 @@ class ColorStyleValue : public StyleValue {
3737
LCH,
3838
OKLab,
3939
OKLCH,
40-
sRGB, // This is used by CSSColor for color(srgb ...).
40+
sRGB, // This is used by ColorFunctionStyleValue for color(srgb ...).
4141
sRGBLinear,
4242
ProPhotoRGB,
4343
Rec2020,
4444
XYZD50,
4545
XYZD65,
46-
LightDark, // This is used by CSSLightDark for light-dark(..., ...).
46+
LightDark, // This is used by LightDarkStyleValue for light-dark(..., ...).
4747
ColorMix,
4848
};
4949
ColorType color_type() const { return m_color_type; }

Libraries/LibWeb/CSS/StyleValues/CSSHSL.cpp renamed to Libraries/LibWeb/CSS/StyleValues/HSLColorStyleValue.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* SPDX-License-Identifier: BSD-2-Clause
55
*/
66

7-
#include "CSSHSL.h"
7+
#include "HSLColorStyleValue.h"
88
#include <AK/TypeCasts.h>
99
#include <LibWeb/CSS/Serialize.h>
1010
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
1111
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
1212

1313
namespace Web::CSS {
1414

15-
Optional<Color> CSSHSL::to_color(ColorResolutionContext color_resolution_context) const
15+
Optional<Color> HSLColorStyleValue::to_color(ColorResolutionContext color_resolution_context) const
1616
{
1717
auto h_val = resolve_hue(m_properties.h, color_resolution_context.calculation_resolution_context);
1818
auto s_val = resolve_with_reference_value(m_properties.s, 100.0, color_resolution_context.calculation_resolution_context);
@@ -25,19 +25,19 @@ Optional<Color> CSSHSL::to_color(ColorResolutionContext color_resolution_context
2525
return Color::from_hsla(h_val.value(), s_val.value() / 100.0f, l_val.value() / 100.0f, alpha_val.value());
2626
}
2727

28-
bool CSSHSL::equals(StyleValue const& other) const
28+
bool HSLColorStyleValue::equals(StyleValue const& other) const
2929
{
3030
if (type() != other.type())
3131
return false;
3232
auto const& other_color = other.as_color();
3333
if (color_type() != other_color.color_type())
3434
return false;
35-
auto const& other_hsl = as<CSSHSL>(other_color);
35+
auto const& other_hsl = as<HSLColorStyleValue>(other_color);
3636
return m_properties == other_hsl.m_properties;
3737
}
3838

3939
// https://www.w3.org/TR/css-color-4/#serializing-sRGB-values
40-
String CSSHSL::to_string(SerializationMode mode) const
40+
String HSLColorStyleValue::to_string(SerializationMode mode) const
4141
{
4242
if (auto color = to_color({}); color.has_value())
4343
return serialize_a_srgb_value(color.value());

Libraries/LibWeb/CSS/StyleValues/CSSHSL.h renamed to Libraries/LibWeb/CSS/StyleValues/HSLColorStyleValue.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111

1212
namespace Web::CSS {
1313

14-
// https://drafts.css-houdini.org/css-typed-om-1/#csshsl
15-
class CSSHSL final : public ColorStyleValue {
14+
class HSLColorStyleValue final : public ColorStyleValue {
1615
public:
17-
static ValueComparingNonnullRefPtr<CSSHSL const> create(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> s, ValueComparingNonnullRefPtr<StyleValue const> l, ValueComparingRefPtr<StyleValue const> alpha, ColorSyntax color_syntax)
16+
static ValueComparingNonnullRefPtr<HSLColorStyleValue const> create(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> s, ValueComparingNonnullRefPtr<StyleValue const> l, ValueComparingRefPtr<StyleValue const> alpha, ColorSyntax color_syntax)
1817
{
1918
// alpha defaults to 1
2019
if (!alpha)
21-
return adopt_ref(*new (nothrow) CSSHSL(move(h), move(s), move(l), NumberStyleValue::create(1), color_syntax));
20+
return adopt_ref(*new (nothrow) HSLColorStyleValue(move(h), move(s), move(l), NumberStyleValue::create(1), color_syntax));
2221

23-
return adopt_ref(*new (nothrow) CSSHSL(move(h), move(s), move(l), alpha.release_nonnull(), color_syntax));
22+
return adopt_ref(*new (nothrow) HSLColorStyleValue(move(h), move(s), move(l), alpha.release_nonnull(), color_syntax));
2423
}
25-
virtual ~CSSHSL() override = default;
24+
virtual ~HSLColorStyleValue() override = default;
2625

2726
StyleValue const& h() const { return *m_properties.h; }
2827
StyleValue const& s() const { return *m_properties.s; }
@@ -36,7 +35,7 @@ class CSSHSL final : public ColorStyleValue {
3635
virtual bool equals(StyleValue const& other) const override;
3736

3837
private:
39-
CSSHSL(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> s, ValueComparingNonnullRefPtr<StyleValue const> l, ValueComparingNonnullRefPtr<StyleValue const> alpha, ColorSyntax color_syntax)
38+
HSLColorStyleValue(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> s, ValueComparingNonnullRefPtr<StyleValue const> l, ValueComparingNonnullRefPtr<StyleValue const> alpha, ColorSyntax color_syntax)
4039
: ColorStyleValue(ColorType::HSL, color_syntax)
4140
, m_properties { .h = move(h), .s = move(s), .l = move(l), .alpha = move(alpha) }
4241
{

Libraries/LibWeb/CSS/StyleValues/CSSHWB.cpp renamed to Libraries/LibWeb/CSS/StyleValues/HWBColorStyleValue.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* SPDX-License-Identifier: BSD-2-Clause
55
*/
66

7-
#include "CSSHWB.h"
7+
#include "HWBColorStyleValue.h"
88
#include <AK/TypeCasts.h>
99
#include <LibWeb/CSS/Serialize.h>
1010
#include <LibWeb/CSS/StyleValues/CalculatedStyleValue.h>
1111
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
1212

1313
namespace Web::CSS {
1414

15-
Optional<Color> CSSHWB::to_color(ColorResolutionContext color_resolution_context) const
15+
Optional<Color> HWBColorStyleValue::to_color(ColorResolutionContext color_resolution_context) const
1616
{
1717
auto h_val = resolve_hue(m_properties.h, color_resolution_context.calculation_resolution_context);
1818
auto raw_w_value = resolve_with_reference_value(m_properties.w, 100.0, color_resolution_context.calculation_resolution_context);
@@ -38,19 +38,19 @@ Optional<Color> CSSHWB::to_color(ColorResolutionContext color_resolution_context
3838
return Color::from_hsv(h_val.value(), saturation, value).with_opacity(alpha_val.value());
3939
}
4040

41-
bool CSSHWB::equals(StyleValue const& other) const
41+
bool HWBColorStyleValue::equals(StyleValue const& other) const
4242
{
4343
if (type() != other.type())
4444
return false;
4545
auto const& other_color = other.as_color();
4646
if (color_type() != other_color.color_type())
4747
return false;
48-
auto const& other_hwb = as<CSSHWB>(other_color);
48+
auto const& other_hwb = as<HWBColorStyleValue>(other_color);
4949
return m_properties == other_hwb.m_properties;
5050
}
5151

5252
// https://www.w3.org/TR/css-color-4/#serializing-sRGB-values
53-
String CSSHWB::to_string(SerializationMode mode) const
53+
String HWBColorStyleValue::to_string(SerializationMode mode) const
5454
{
5555
if (auto color = to_color({}); color.has_value())
5656
return serialize_a_srgb_value(color.value());

Libraries/LibWeb/CSS/StyleValues/CSSHWB.h renamed to Libraries/LibWeb/CSS/StyleValues/HWBColorStyleValue.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@
1111

1212
namespace Web::CSS {
1313

14-
// https://drafts.css-houdini.org/css-typed-om-1/#csshwb
15-
class CSSHWB final : public ColorStyleValue {
14+
class HWBColorStyleValue final : public ColorStyleValue {
1615
public:
17-
static ValueComparingNonnullRefPtr<CSSHWB const> create(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> w, ValueComparingNonnullRefPtr<StyleValue const> b, ValueComparingRefPtr<StyleValue const> alpha = {})
16+
static ValueComparingNonnullRefPtr<HWBColorStyleValue const> create(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> w, ValueComparingNonnullRefPtr<StyleValue const> b, ValueComparingRefPtr<StyleValue const> alpha = {})
1817
{
1918
// alpha defaults to 1
2019
if (!alpha)
21-
return adopt_ref(*new (nothrow) CSSHWB(move(h), move(w), move(b), NumberStyleValue::create(1)));
20+
return adopt_ref(*new (nothrow) HWBColorStyleValue(move(h), move(w), move(b), NumberStyleValue::create(1)));
2221

23-
return adopt_ref(*new (nothrow) CSSHWB(move(h), move(w), move(b), alpha.release_nonnull()));
22+
return adopt_ref(*new (nothrow) HWBColorStyleValue(move(h), move(w), move(b), alpha.release_nonnull()));
2423
}
25-
virtual ~CSSHWB() override = default;
24+
virtual ~HWBColorStyleValue() override = default;
2625

2726
StyleValue const& h() const { return *m_properties.h; }
2827
StyleValue const& w() const { return *m_properties.w; }
@@ -36,7 +35,7 @@ class CSSHWB final : public ColorStyleValue {
3635
virtual bool equals(StyleValue const& other) const override;
3736

3837
private:
39-
CSSHWB(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> w, ValueComparingNonnullRefPtr<StyleValue const> b, ValueComparingNonnullRefPtr<StyleValue const> alpha)
38+
HWBColorStyleValue(ValueComparingNonnullRefPtr<StyleValue const> h, ValueComparingNonnullRefPtr<StyleValue const> w, ValueComparingNonnullRefPtr<StyleValue const> b, ValueComparingNonnullRefPtr<StyleValue const> alpha)
4039
: ColorStyleValue(ColorType::HWB, ColorSyntax::Modern)
4140
, m_properties { .h = move(h), .w = move(w), .b = move(b), .alpha = move(alpha) }
4241
{

Libraries/LibWeb/CSS/StyleValues/CSSLCHLike.cpp renamed to Libraries/LibWeb/CSS/StyleValues/LCHLikeColorStyleValue.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* SPDX-License-Identifier: BSD-2-Clause
66
*/
77

8-
#include "CSSLCHLike.h"
8+
#include "LCHLikeColorStyleValue.h"
99
#include <AK/Math.h>
1010
#include <AK/TypeCasts.h>
1111
#include <LibWeb/CSS/Serialize.h>
@@ -16,18 +16,18 @@
1616

1717
namespace Web::CSS {
1818

19-
bool CSSLCHLike::equals(StyleValue const& other) const
19+
bool LCHLikeColorStyleValue::equals(StyleValue const& other) const
2020
{
2121
if (type() != other.type())
2222
return false;
2323
auto const& other_color = other.as_color();
2424
if (color_type() != other_color.color_type())
2525
return false;
26-
auto const& other_oklch_like = as<CSSLCHLike>(other_color);
26+
auto const& other_oklch_like = as<LCHLikeColorStyleValue>(other_color);
2727
return m_properties == other_oklch_like.m_properties;
2828
}
2929

30-
Optional<Color> CSSLCH::to_color(ColorResolutionContext color_resolution_context) const
30+
Optional<Color> LCHColorStyleValue::to_color(ColorResolutionContext color_resolution_context) const
3131
{
3232
auto raw_l_val = resolve_with_reference_value(m_properties.l, 100, color_resolution_context.calculation_resolution_context);
3333
auto c_val = resolve_with_reference_value(m_properties.c, 150, color_resolution_context.calculation_resolution_context);
@@ -44,7 +44,7 @@ Optional<Color> CSSLCH::to_color(ColorResolutionContext color_resolution_context
4444
}
4545

4646
// https://www.w3.org/TR/css-color-4/#serializing-lab-lch
47-
String CSSLCH::to_string(SerializationMode mode) const
47+
String LCHColorStyleValue::to_string(SerializationMode mode) const
4848
{
4949
StringBuilder builder;
5050
builder.append("lch("sv);
@@ -63,7 +63,7 @@ String CSSLCH::to_string(SerializationMode mode) const
6363
return MUST(builder.to_string());
6464
}
6565

66-
Optional<Color> CSSOKLCH::to_color(ColorResolutionContext color_resolution_context) const
66+
Optional<Color> OKLCHColorStyleValue::to_color(ColorResolutionContext color_resolution_context) const
6767
{
6868
auto raw_l_val = resolve_with_reference_value(m_properties.l, 1.0, color_resolution_context.calculation_resolution_context);
6969
auto raw_c_val = resolve_with_reference_value(m_properties.c, 0.4, color_resolution_context.calculation_resolution_context);
@@ -81,7 +81,7 @@ Optional<Color> CSSOKLCH::to_color(ColorResolutionContext color_resolution_conte
8181
}
8282

8383
// https://www.w3.org/TR/css-color-4/#serializing-oklab-oklch
84-
String CSSOKLCH::to_string(SerializationMode mode) const
84+
String OKLCHColorStyleValue::to_string(SerializationMode mode) const
8585
{
8686
StringBuilder builder;
8787
builder.append("oklch("sv);

0 commit comments

Comments
 (0)