From 59f2c8df7a5d3b13d829b637d74d935aa615f10c Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 1 Jul 2025 11:43:24 +0100 Subject: [PATCH] Tests: Import some custom-property tests To make it easier to track progress and regressions in subsequent changes. --- .../css/css-variables/var-parsing.txt | 14 + .../variable-css-wide-keywords.txt | 36 ++ .../css/css-variables/variable-cycles.txt | 17 + .../css/css-variables/var-parsing.html | 21 + .../variable-css-wide-keywords.html | 331 ++++++++++++++ .../css/css-variables/variable-cycles.html | 425 ++++++++++++++++++ 6 files changed, 844 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-variables/var-parsing.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-css-wide-keywords.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-cycles.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-variables/var-parsing.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-css-wide-keywords.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-cycles.html diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/var-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/var-parsing.txt new file mode 100644 index 00000000000..6fd105204c9 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/var-parsing.txt @@ -0,0 +1,14 @@ +Harness status: OK + +Found 8 tests + +3 Pass +5 Fail +Pass e.style['width'] = "var(--x)" should set the property value +Pass e.style['width'] = "var(--x,)" should set the property value +Pass e.style['width'] = "var(--x, )" should set the property value +Fail e.style['width'] = "var(--x ())" should not set the property value +Fail e.style['width'] = "var(--x () )" should not set the property value +Fail e.style['width'] = "var(--x() )" should not set the property value +Fail e.style['width'] = "var(--x (),)" should not set the property value +Fail e.style['width'] = "var(--x(),)" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-css-wide-keywords.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-css-wide-keywords.txt new file mode 100644 index 00000000000..53621a77b91 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-css-wide-keywords.txt @@ -0,0 +1,36 @@ +Harness status: OK + +Found 30 tests + +2 Pass +28 Fail +Pass `initial` as a value for an unregistered custom property +Fail `inherit` as a value for an unregistered custom property +Fail `unset` as a value for an unregistered custom property +Fail `revert` as a value for an unregistered custom property +Fail `revert-layer` as a value for an unregistered custom property +Fail `initial` as a value for a non-inheriting registered custom property +Fail `initial` as a value for an inheriting registered custom property +Fail `inherit` as a value for a non-inheriting registered custom property +Fail `inherit` as a value for an inheriting registered custom property +Fail `unset` as a value for a non-inheriting registered custom property +Fail `unset` as a value for an inheriting registered custom property +Fail `revert` as a value for a non-inheriting registered custom property +Fail `revert` as a value for an inheriting registered custom property +Fail `revert-layer` as a value for a non-inheriting registered custom property +Fail `revert-layer` as a value for an inheriting registered custom property +Pass `initial` as a `var()` fallback for an unregistered custom property +Fail `inherit` as a `var()` fallback for an unregistered custom property +Fail `unset` as a `var()` fallback for an unregistered custom property +Fail `revert` as a `var()` fallback for an unregistered custom property +Fail `revert-layer` as a `var()` fallback for an unregistered custom property +Fail `initial` as a `var()` fallback for a non-inheriting registered custom property +Fail `initial` as a `var()` fallback for an inheriting registered custom property +Fail `inherit` as a `var()` fallback for a non-inheriting registered custom property +Fail `inherit` as a `var()` fallback for an inheriting registered custom property +Fail `unset` as a `var()` fallback for a non-inheriting registered custom property +Fail `unset` as a `var()` fallback for an inheriting registered custom property +Fail `revert` as a `var()` fallback for a non-inheriting registered custom property +Fail `revert` as a `var()` fallback for an inheriting registered custom property +Fail `revert-layer` as a `var()` fallback for a non-inheriting registered custom property +Fail `revert-layer` as a `var()` fallback for an inheriting registered custom property \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-cycles.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-cycles.txt new file mode 100644 index 00000000000..d79c6ee188b --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-variables/variable-cycles.txt @@ -0,0 +1,17 @@ +Harness status: OK + +Found 11 tests + +1 Pass +10 Fail +Fail Self-cycle +Fail Simple a/b cycle +Fail Three-var cycle +Fail Cycle that starts in the middle of a chain +Fail Cycle with extra edge +Fail Cycle with extra edge (2) +Fail Cycle with extra edge (3) +Fail Cycle with secondary cycle +Fail Cycle with overlapping secondary cycle +Fail Cycle with deeper secondary cycle +Pass Cycle in unused fallback \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-variables/var-parsing.html b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/var-parsing.html new file mode 100644 index 00000000000..d069219fa3f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/var-parsing.html @@ -0,0 +1,21 @@ + +CSS Custom Properties: var() parsing + + + + +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-css-wide-keywords.html b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-css-wide-keywords.html new file mode 100644 index 00000000000..9d560bd3056 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-css-wide-keywords.html @@ -0,0 +1,331 @@ + + +CSS Custom Properties: Using CSS-wide keywords + + + + + + + +
+ `initial` as a value for an unregistered custom property +
+ +
+ `inherit` as a value for an unregistered custom property +
+ +
+ `unset` as a value for an unregistered custom property +
+ +
+ `revert` as a value for an unregistered custom property +
+ + +
+ `revert-layer` as a value for an unregistered custom property +
+ + + + +
+ `initial` as a value for a non-inheriting registered custom property +
+ +
+ `initial` as a value for an inheriting registered custom property +
+ +
+ `inherit` as a value for a non-inheriting registered custom property +
+ +
+ `inherit` as a value for an inheriting registered custom property +
+ +
+ `unset` as a value for a non-inheriting registered custom property +
+ +
+ `unset` as a value for an inheriting registered custom property +
+ +
+ `revert` as a value for a non-inheriting registered custom property +
+ +
+ `revert` as a value for an inheriting registered custom property +
+ + +
+ `revert-layer` as a value for a non-inheriting registered custom property +
+ + +
+ `revert-layer` as a value for an inheriting registered custom property +
+ + + + +
+ `initial` as a `var()` fallback for an unregistered custom property +
+ +
+ `inherit` as a `var()` fallback for an unregistered custom property +
+ +
+ `unset` as a `var()` fallback for an unregistered custom property +
+ +
+ `revert` as a `var()` fallback for an unregistered custom property +
+ + +
+ `revert-layer` as a `var()` fallback for an unregistered custom property +
+ + + + +
+ `initial` as a `var()` fallback for a non-inheriting registered custom property +
+ +
+ `initial` as a `var()` fallback for an inheriting registered custom property +
+ +
+ `inherit` as a `var()` fallback for a non-inheriting registered custom property +
+ +
+ `inherit` as a `var()` fallback for an inheriting registered custom property +
+ +
+ `unset` as a `var()` fallback for a non-inheriting registered custom property +
+ +
+ `unset` as a `var()` fallback for an inheriting registered custom property +
+ +
+ `revert` as a `var()` fallback for a non-inheriting registered custom property +
+ +
+ `revert` as a `var()` fallback for an inheriting registered custom property +
+ + +
+ `revert-layer` as a `var()` fallback for a non-inheriting registered custom property +
+ + +
+ `revert-layer` as a `var()` fallback for an inheriting registered custom property +
+ +

+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-cycles.html b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-cycles.html
new file mode 100644
index 00000000000..f636fa0b427
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/css-variables/variable-cycles.html
@@ -0,0 +1,425 @@
+
+
+Test that custom property cycles behave correctly
+
+
+
+
+