From b03e829a498be9a8f6059194522867cdcff488a7 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 6 Aug 2025 11:02:11 +0100 Subject: [PATCH] Tests: Import WPT tests for CSS env() --- .../css/css-env/at-supports.tentative.txt | 6 ++ .../env-in-custom-properties.tentative.txt | 7 +++ .../wpt-import/css/css-env/env-parsing.txt | 14 +++++ .../css-env/fallback-nested-var.tentative.txt | 6 ++ .../css/css-env/indexed-env.tentative.txt | 14 +++++ .../seralization-round-tripping.tentative.txt | 6 ++ .../css/css-env/supports-script.tentative.txt | 6 ++ .../css/css-env/syntax.tentative.txt | 24 ++++++++ ...-env-names-override-previous.tentative.txt | 6 ++ .../css/css-env/at-supports.tentative.html | 22 +++++++ .../env-in-custom-properties.tentative.html | 35 ++++++++++++ .../wpt-import/css/css-env/env-parsing.html | 21 +++++++ .../fallback-nested-var.tentative.html | 23 ++++++++ .../css/css-env/indexed-env.tentative.html | 40 +++++++++++++ ...seralization-round-tripping.tentative.html | 19 +++++++ .../css-env/supports-script.tentative.html | 22 +++++++ .../css/css-env/syntax.tentative.html | 57 +++++++++++++++++++ ...env-names-override-previous.tentative.html | 17 ++++++ 18 files changed, 345 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/at-supports.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-in-custom-properties.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-parsing.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/fallback-nested-var.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/indexed-env.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/seralization-round-tripping.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/supports-script.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/syntax.tentative.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/at-supports.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/env-in-custom-properties.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/env-parsing.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/fallback-nested-var.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/indexed-env.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/seralization-round-tripping.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/supports-script.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/syntax.tentative.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.html diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/at-supports.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/at-supports.tentative.txt new file mode 100644 index 00000000000..7326aca0e8f --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/at-supports.tentative.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail Test that CSS env vars work with @support \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-in-custom-properties.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-in-custom-properties.tentative.txt new file mode 100644 index 00000000000..ad0ff933ede --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-in-custom-properties.tentative.txt @@ -0,0 +1,7 @@ +Harness status: OK + +Found 2 tests + +2 Fail +Fail env() is substituted into a custom property +Fail Substitution of unrecognized env() causes guaranteed-invalid \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-parsing.txt new file mode 100644 index 00000000000..f09b6907f3a --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/env-parsing.txt @@ -0,0 +1,14 @@ +Harness status: OK + +Found 8 tests + +5 Pass +3 Fail +Fail e.style['width'] = "env(safe-area-inset-top)" should set the property value +Fail e.style['width'] = "env(safe-area-inset-top,)" should set the property value +Fail e.style['width'] = "env(safe-area-inset-top, )" should set the property value +Pass e.style['width'] = "env(safe-area-inset-top ())" should not set the property value +Pass e.style['width'] = "env(safe-area-inset-top () )" should not set the property value +Pass e.style['width'] = "env(safe-area-inset-top() )" should not set the property value +Pass e.style['width'] = "env(safe-area-inset-top (),)" should not set the property value +Pass e.style['width'] = "env(safe-area-inset-top(),)" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/fallback-nested-var.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/fallback-nested-var.tentative.txt new file mode 100644 index 00000000000..f5245cafaa5 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/fallback-nested-var.tentative.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail Test that nested var() fallback values work with CSS env vars \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/indexed-env.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/indexed-env.tentative.txt new file mode 100644 index 00000000000..f1021850174 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/indexed-env.tentative.txt @@ -0,0 +1,14 @@ +Harness status: OK + +Found 8 tests + +4 Pass +4 Fail +Pass CSS Environment variable value "env(test1 test2, green)" must not successfully parse +Pass CSS Environment variable value "env(test1 10 20 test2, green)" must not successfully parse +Pass CSS Environment variable value "env(test 0.1, green)" must not successfully parse +Pass CSS Environment variable value "env(test -1, green)" must not successfully parse +Fail CSS Environment variable value "env(test 0, green)" must successfully parse and roundtrip +Fail CSS Environment variable value "env(test 0,)" must successfully parse and roundtrip +Fail CSS Environment variable value "env(test 0)" must successfully parse and roundtrip +Fail CSS Environment variable value "env(test 0 1 2 3 4, green)" must successfully parse and roundtrip \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/seralization-round-tripping.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/seralization-round-tripping.tentative.txt new file mode 100644 index 00000000000..8a0ba8836e6 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/seralization-round-tripping.tentative.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail Test style seralization round tripping with CSS env vars \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/supports-script.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/supports-script.tentative.txt new file mode 100644 index 00000000000..eefb89274bf --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/supports-script.tentative.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail Test that CSS env vars work with CSS.supports \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/syntax.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/syntax.tentative.txt new file mode 100644 index 00000000000..e5ddc1794c4 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/syntax.tentative.txt @@ -0,0 +1,24 @@ +Harness status: OK + +Found 18 tests + +4 Pass +14 Fail +Pass rgb(0, 128, 0) +Fail background-color: env(test) rgba(0, 0, 0, 0) +Fail background-color: ENV(test) rgba(0, 0, 0, 0) +Fail background-color: env(test) !important rgba(0, 0, 0, 0) +Fail background-color: env(test, 10px) rgba(0, 0, 0, 0) +Fail background-color: env(test, blue) rgb(0, 0, 255) +Fail background-color: env(test, env(another)) rgba(0, 0, 0, 0) +Fail background-color: env(test, env(another, blue)) rgb(0, 0, 255) +Fail background-color: env(-test) rgba(0, 0, 0, 0) +Fail background-color: env(--test) rgba(0, 0, 0, 0) +Pass background-color: env(10px) rgb(0, 128, 0) +Pass background-color: env(env(test)) rgb(0, 128, 0) +Fail background-color: env( test) rgba(0, 0, 0, 0) +Fail background-color: env(test ) rgba(0, 0, 0, 0) +Fail background-color: env( test ) rgba(0, 0, 0, 0) +Fail background-color: env(test /**/, blue) rgb(0, 0, 255) +Fail background-color: env(test, {}) rgba(0, 0, 0, 0) +Pass background-color: env(test, {) rgb(0, 128, 0) \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.txt new file mode 100644 index 00000000000..ed8db5b5baf --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.txt @@ -0,0 +1,6 @@ +Harness status: OK + +Found 1 tests + +1 Fail +Fail Test unknown env() names will override previous values \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/at-supports.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/at-supports.tentative.html new file mode 100644 index 00000000000..db881e13f2e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/at-supports.tentative.html @@ -0,0 +1,22 @@ + + + + + Test that CSS env vars work with @support + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-in-custom-properties.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-in-custom-properties.tentative.html new file mode 100644 index 00000000000..5ad93b6aae1 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-in-custom-properties.tentative.html @@ -0,0 +1,35 @@ + + + + + Test env() will work in custom properties + + + + + +
+
+
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-parsing.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-parsing.html new file mode 100644 index 00000000000..4694467ccf3 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/env-parsing.html @@ -0,0 +1,21 @@ + +CSS Environment Variables: env() parsing + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/fallback-nested-var.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/fallback-nested-var.tentative.html new file mode 100644 index 00000000000..6f610428c3b --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/fallback-nested-var.tentative.html @@ -0,0 +1,23 @@ + + + + + Test that nested var() fallback values work with CSS env vars + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/indexed-env.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/indexed-env.tentative.html new file mode 100644 index 00000000000..19db7303cbe --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/indexed-env.tentative.html @@ -0,0 +1,40 @@ + + + + + Test CSS env vars index parsing support + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/seralization-round-tripping.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/seralization-round-tripping.tentative.html new file mode 100644 index 00000000000..5ac874ecc49 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/seralization-round-tripping.tentative.html @@ -0,0 +1,19 @@ + + + + + Test style seralization round tripping with CSS env vars + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/supports-script.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/supports-script.tentative.html new file mode 100644 index 00000000000..70a525d6855 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/supports-script.tentative.html @@ -0,0 +1,22 @@ + + + + + Test that CSS env vars work with CSS.supports + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/syntax.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/syntax.tentative.html new file mode 100644 index 00000000000..61a4fd7cca2 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/syntax.tentative.html @@ -0,0 +1,57 @@ + + + + + Test env() syntax + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.html b/Tests/LibWeb/Text/input/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.html new file mode 100644 index 00000000000..394d8dd1684 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-env/unknown-env-names-override-previous.tentative.html @@ -0,0 +1,17 @@ + + + + + Test unknown env() names will override previous values + + + + + + +