summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-will-change/parsing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-will-change/parsing
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-will-change/parsing')
-rw-r--r--testing/web-platform/tests/css/css-will-change/parsing/will-change-computed.html29
-rw-r--r--testing/web-platform/tests/css/css-will-change/parsing/will-change-invalid.html49
-rw-r--r--testing/web-platform/tests/css/css-will-change/parsing/will-change-valid.html29
3 files changed, 107 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-will-change/parsing/will-change-computed.html b/testing/web-platform/tests/css/css-will-change/parsing/will-change-computed.html
new file mode 100644
index 0000000000..667f084eab
--- /dev/null
+++ b/testing/web-platform/tests/css/css-will-change/parsing/will-change-computed.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Will Change Test: getComputedStyle().willChange</title>
+<link rel="help" href="https://drafts.csswg.org/css-will-change/#propdef-will-change">
+<meta name="assert" content="will-change computed value is as specified.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/computed-testcommon.js"></script>
+</head>
+<body>
+<div id="target"></div>
+<script>
+test_computed_value("will-change", "auto");
+
+// <animateable-feature> = scroll-position | contents | <custom-ident>
+test_computed_value("will-change", "scroll-position");
+test_computed_value("will-change", "contents");
+test_computed_value("will-change", "transform");
+test_computed_value("will-change", "background-color");
+
+test_computed_value("will-change", "scroll-position, contents");
+test_computed_value("will-change", "scroll-position, transform");
+test_computed_value("will-change", "contents, transform");
+test_computed_value("will-change", "transform, background-color");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-will-change/parsing/will-change-invalid.html b/testing/web-platform/tests/css/css-will-change/parsing/will-change-invalid.html
new file mode 100644
index 0000000000..e8b0b01973
--- /dev/null
+++ b/testing/web-platform/tests/css/css-will-change/parsing/will-change-invalid.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Will Change Test: parsing will-change with invalid values</title>
+<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-will-change/#propdef-will-change">
+<meta name="assert" content="will-change only supports the grammar 'auto | <animateable-feature>#'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_invalid_value("will-change", "auto transform");
+test_invalid_value("will-change", "auto, transform");
+test_invalid_value("will-change", "contents auto");
+test_invalid_value("will-change", "contents, auto");
+
+let excludedKeywords = [
+ // CSS-wide keywords are excluded from <custom-ident>
+ // https://drafts.csswg.org/css-values-4/#identifier-value
+ "initial",
+ "inherit",
+ "unset",
+ "revert",
+ "revert-layer",
+ "default",
+
+ // will-change additionally excludes the following from <custom-ident>
+ "will-change",
+ "none",
+ "all",
+];
+
+for (let keyword of excludedKeywords) {
+ test_invalid_value("will-change", `transform, ${keyword}`);
+ test_invalid_value("will-change", `${keyword}, transform`);
+ for (let k of excludedKeywords) {
+ test_invalid_value("will-change", `${keyword}, ${k}`);
+ }
+}
+
+test_invalid_value("will-change", "will-change");
+test_invalid_value("will-change", "none");
+test_invalid_value("will-change", "all");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-will-change/parsing/will-change-valid.html b/testing/web-platform/tests/css/css-will-change/parsing/will-change-valid.html
new file mode 100644
index 0000000000..b8a086b3e3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-will-change/parsing/will-change-valid.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS Will Change Test: parsing will-change with valid values</title>
+<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-will-change/#propdef-will-change">
+<meta name="assert" content="will-change supports the full grammar 'auto | <animateable-feature>#'.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+</head>
+<body>
+<script>
+test_valid_value("will-change", "auto");
+
+// <animateable-feature> = scroll-position | contents | <custom-ident>
+test_valid_value("will-change", "scroll-position");
+test_valid_value("will-change", "contents");
+test_valid_value("will-change", "transform");
+test_valid_value("will-change", "background-color");
+
+test_valid_value("will-change", "scroll-position, contents");
+test_valid_value("will-change", "scroll-position, transform");
+test_valid_value("will-change", "contents, transform");
+test_valid_value("will-change", "transform, background-color");
+</script>
+</body>
+</html>