From d5e5f47666a2b5b332e6dc30824529eef9abadb9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 3 Jun 2024 18:02:52 -0400 Subject: [PATCH] css: Add tests for relative colors --- testsuite/css/parser/relative-color.css | 24 +++++++++++++++++++++ testsuite/css/parser/relative-color.errors | 1 + testsuite/css/parser/relative-color.ref.css | 20 +++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 testsuite/css/parser/relative-color.css create mode 100644 testsuite/css/parser/relative-color.errors create mode 100644 testsuite/css/parser/relative-color.ref.css diff --git a/testsuite/css/parser/relative-color.css b/testsuite/css/parser/relative-color.css new file mode 100644 index 0000000000..339724b5fe --- /dev/null +++ b/testsuite/css/parser/relative-color.css @@ -0,0 +1,24 @@ +a { + color: color(from rgb(100, 200, 10) srgb g g calc(b * 2)); +} + +b { + color: oklab(from white l 0.1 0.2); +} + +c { + color: red; + background-color: hsl(from currentcolor calc(h + 60) s l); +} + +d { + color: oklab(from white r g b); +} + +e { + color: rgb(from darkgoldenrod r g 100 / 50%); +} + +e { + color: rgb(from rgba(30,40,50,60) r g 100 / alpha); +} diff --git a/testsuite/css/parser/relative-color.errors b/testsuite/css/parser/relative-color.errors new file mode 100644 index 0000000000..0bb604e386 --- /dev/null +++ b/testsuite/css/parser/relative-color.errors @@ -0,0 +1 @@ +relative-color.css:15:27-28: error: GTK_CSS_PARSER_ERROR_SYNTAX diff --git a/testsuite/css/parser/relative-color.ref.css b/testsuite/css/parser/relative-color.ref.css new file mode 100644 index 0000000000..195550d493 --- /dev/null +++ b/testsuite/css/parser/relative-color.ref.css @@ -0,0 +1,20 @@ +a { + color: color(srgb 0.784314 0.784314 0.0784314); +} + +b { + color: oklab(1 0.1 0.2); +} + +c { + background-color: hsl(from currentcolor calc(h + 60) s l / alpha); + color: rgb(255,0,0); +} + +e { + color: color(from rgb(184,134,11) srgb 184 134 100 / 50%); +} + +e { + color: rgb(30,40,100); +}