From e1c61d654f543f30a35b74b5d2cf2be3e6a79ed9 Mon Sep 17 00:00:00 2001 From: Gingeh <39150378+Gingeh@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:37:56 +1000 Subject: [PATCH] LibWeb/CSS: Add tests for color functions --- Tests/LibWeb/Ref/css-color-functions.html | 89 ++++++++++++++++++ .../reference/css-color-functions-ref.html | 91 +++++++++++++++++++ 2 files changed, 180 insertions(+) create mode 100644 Tests/LibWeb/Ref/css-color-functions.html create mode 100644 Tests/LibWeb/Ref/reference/css-color-functions-ref.html diff --git a/Tests/LibWeb/Ref/css-color-functions.html b/Tests/LibWeb/Ref/css-color-functions.html new file mode 100644 index 00000000000..bb42acaf997 --- /dev/null +++ b/Tests/LibWeb/Ref/css-color-functions.html @@ -0,0 +1,89 @@ + + +
+

legacy rgb with numbers

+
+
+

legacy rgb with percentages

+
+
+

legacy rgba with numbers and number alpha

+
+
+

legacy rgba with numbers and percentage alpha

+
+
+

legacy rgba with percentages and number alpha

+
+
+

legacy rgba with percentages and percentage alpha

+
+
+

legacy hsl with number hue

+
+
+

legacy hsl with degree hue

+
+
+

legacy hsla with number alpha

+
+
+

legacy hsla with percentage alpha

+
+
+

legacy rgba with out-of-range numbers (should be clamped)

+
+
+

legacy rgba with out-of-range percentages (should be clamped)

+
+
+

modern rgb with mixed types

+
+
+

modern rgb with alpha

+
+
+

modern rgba without alpha

+
+
+

modern hsl

+
+
+

modern hsl with alpha

+
+
+

modern hsla without alpha

+
+
+

modern hsl with numbers

+
+
+

modern hsl with out-of-range values (should be clamped/wrapped)

+
+
+

hwb with percentages

+
+
+

hwb with percentages and alpha

+
+
+

hwb with numbers/angle

+
+
+

hwb with mixed-type values and percentage alpha

+
+
+

oklab with numbers and alpha

+
+
+

oklab with out-of-range lightness (should be clamped)

+
+
+

oklab with percentages and alpha

+
+
+

oklch with numbers

+
+
+

oklch with percentages and angle hue

+
diff --git a/Tests/LibWeb/Ref/reference/css-color-functions-ref.html b/Tests/LibWeb/Ref/reference/css-color-functions-ref.html new file mode 100644 index 00000000000..2ef10df9bf6 --- /dev/null +++ b/Tests/LibWeb/Ref/reference/css-color-functions-ref.html @@ -0,0 +1,91 @@ + + + + +
+

legacy rgb with numbers

+
+
+

legacy rgb with percentages

+
+
+

legacy rgba with numbers and number alpha

+
+
+

legacy rgba with numbers and percentage alpha

+
+
+

legacy rgba with percentages and number alpha

+
+
+

legacy rgba with percentages and percentage alpha

+
+
+

legacy hsl with number hue

+
+
+

legacy hsl with degree hue

+
+
+

legacy hsla with number alpha

+
+
+

legacy hsla with percentage alpha

+
+
+

legacy rgba with out-of-range numbers (should be clamped)

+
+
+

legacy rgba with out-of-range percentages (should be clamped)

+
+
+

modern rgb with mixed types

+
+
+

modern rgb with alpha

+
+
+

modern rgba without alpha

+
+
+

modern hsl

+
+
+

modern hsl with alpha

+
+
+

modern hsla without alpha

+
+
+

modern hsl with numbers

+
+
+

modern hsl with out-of-range values (should be clamped/wrapped)

+
+
+

hwb with percentages

+
+
+

hwb with percentages and alpha

+
+
+

hwb with numbers/angle

+
+
+

hwb with mixed-type values and percentage alpha

+
+
+

oklab with numbers and alpha

+
+
+

oklab with out-of-range lightness (should be clamped)

+
+
+

oklab with percentages and alpha

+
+
+

oklch with numbers

+
+
+

oklch with percentages and angle hue

+