summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/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-view-transitions/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-view-transitions/parsing')
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid-with-classes.html32
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid.html69
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid-with-classes.html33
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html32
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-computed.html29
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-invalid.html24
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-valid.html23
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-computed.html27
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html29
-rw-r--r--testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-valid.html21
10 files changed, 319 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid-with-classes.html b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid-with-classes.html
new file mode 100644
index 0000000000..66443c5cd7
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid-with-classes.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test pseudo elements parsing of invalid selectors with classes</title>
+<link rel="author" href="https://github.com/noamr">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+<script>
+const functionPseudoElements = [
+ "::view-transition-group",
+ "::view-transition-image-pair",
+ "::view-transition-old",
+ "::view-transition-new",
+];
+
+function test_invalid_selector_combinations(pseudo) {
+ test_invalid_selector(`${pseudo}.a`);
+ test_invalid_selector(`${pseudo} div`);
+ test_invalid_selector(`${pseudo}:hover`);
+ test_invalid_selector(`:not(${pseudo})`);
+ test_invalid_selector(`:has(${pseudo})`);
+}
+
+for (const fn of functionPseudoElements) {
+ test_invalid_selector(`${fn}(*.*)`);
+ test_invalid_selector(`${fn}(*. cls)`);
+ test_invalid_selector(`${fn}(*.cls. c)`);
+ test_invalid_selector(`${fn}(*.cls>cls)`);
+ test_invalid_selector(`${fn}(*.cls.foo.*)`);
+}
+</script>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid.html
new file mode 100644
index 0000000000..5a2624d09d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-invalid.html
@@ -0,0 +1,69 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test pseudo elements parsing of invalid selectors</title>
+<link rel="author" href="https://github.com/nt1m">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+<script>
+const functionPseudoElements = [
+ "::view-transition-group",
+ "::view-transition-image-pair",
+ "::view-transition-old",
+ "::view-transition-new",
+];
+
+function test_invalid_selector_combinations(pseudo) {
+ test_invalid_selector(`${pseudo}.a`);
+ test_invalid_selector(`${pseudo} div`);
+ test_invalid_selector(`${pseudo}:hover`);
+ test_invalid_selector(`:not(${pseudo})`);
+ test_invalid_selector(`:has(${pseudo})`);
+}
+
+test_invalid_selector_combinations("::view-transition");
+test_invalid_selector("::view-transition(*)");
+test_invalid_selector("::view-transition(valid)");
+test_invalid_selector("::view-transition(root)");
+
+for (const fn of functionPseudoElements) {
+ for (const validArgument of ["*", "valid", "root"]) {
+ test_invalid_selector_combinations(`${fn}(${validArgument})`);
+ }
+
+ // Test function without argument.
+ test_invalid_selector(fn);
+ test_invalid_selector_combinations(fn);
+
+ // Test function with empty argument.
+ test_invalid_selector(`${fn}()`);
+ test_invalid_selector_combinations(`${fn}()`);
+
+ // Test function with keywords excluded from <custom-ident>.
+ test_invalid_selector(`${fn}(default)`);
+ test_invalid_selector_combinations(`${fn}(default)`);
+ test_invalid_selector(`${fn}(unset)`);
+ test_invalid_selector_combinations(`${fn}(unset)`);
+ test_invalid_selector(`${fn}(initial)`);
+ test_invalid_selector_combinations(`${fn}(initial)`);
+ test_invalid_selector(`${fn}(inherit)`);
+ test_invalid_selector_combinations(`${fn}(inherit)`);
+ test_invalid_selector(`${fn}(revert)`);
+ test_invalid_selector_combinations(`${fn}(revert)`);
+ test_invalid_selector(`${fn}(revert-layer)`);
+ test_invalid_selector_combinations(`${fn}(revert-layer)`);
+
+ // Test function with multiple arguments.
+ test_invalid_selector(`${fn}(foo, bar)`);
+ test_invalid_selector_combinations(`${fn}(foo, bar)`);
+ test_invalid_selector(`${fn}(foo bar)`);
+ test_invalid_selector_combinations(`${fn}(foo bar)`);
+
+ // Test function with selector arguments.
+ test_invalid_selector(`${fn}(.foo)`);
+ test_invalid_selector_combinations(`${fn}(.foo)`);
+ test_invalid_selector(`${fn}(#bar)`);
+ test_invalid_selector_combinations(`${fn}(#bar)`);
+}
+</script>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid-with-classes.html b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid-with-classes.html
new file mode 100644
index 0000000000..8ddf2e28d6
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid-with-classes.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test pseudo elements parsing of valid selectors including classes</title>
+<link rel="author" href="https://github.com/nrosenthal">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+<script>
+const functionPseudoElements = [
+ "::view-transition-group",
+ "::view-transition-image-pair",
+ "::view-transition-old",
+ "::view-transition-new",
+];
+
+function test_valid_selector_combinations(pseudo) {
+ test_valid_selector(pseudo);
+ test_valid_selector(`:root${pseudo}`);
+ test_valid_selector(`.a${pseudo}`);
+ test_valid_selector(`div ${pseudo}`);
+}
+
+test_valid_selector_combinations("::view-transition");
+
+for (const functionName of functionPseudoElements) {
+ for (const validArgument of
+ ["*.class", "*.class.class", "dashed-ident.someclass", "dash-id.dash-id", "foo.bar.baz"]) {
+ test_valid_selector_combinations(`${functionName}(${validArgument})`);
+ test_valid_selector_combinations(`${functionName}(${validArgument}):only-child`);
+ }
+}
+</script>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html
new file mode 100644
index 0000000000..1a0e5b82d3
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/pseudo-elements-valid.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test pseudo elements parsing of valid selectors</title>
+<link rel="author" href="https://github.com/nt1m">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/css/support/parsing-testcommon.js"></script>
+<script>
+const functionPseudoElements = [
+ "::view-transition-group",
+ "::view-transition-image-pair",
+ "::view-transition-old",
+ "::view-transition-new",
+];
+
+function test_valid_selector_combinations(pseudo) {
+ test_valid_selector(pseudo);
+ test_valid_selector(`:root${pseudo}`);
+ test_valid_selector(`.a${pseudo}`);
+ test_valid_selector(`div ${pseudo}`);
+}
+
+test_valid_selector_combinations("::view-transition");
+
+for (const functionName of functionPseudoElements) {
+ for (const validArgument of ["*", "root", "dashed-ident"]) {
+ test_valid_selector_combinations(`${functionName}(${validArgument})`);
+ test_valid_selector_combinations(`${functionName}(${validArgument}):only-child`);
+ }
+}
+</script>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-computed.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-computed.html
new file mode 100644
index 0000000000..74151c46da
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-computed.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions: view-transition-class with computed values</title>
+<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-class supports custom keywords.">
+<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("view-transition-class", "none");
+test_computed_value("view-transition-class", "foo");
+test_computed_value("view-transition-class", "bar");
+test_computed_value("view-transition-class", "baz");
+test_computed_value("view-transition-class", "foo bar");
+test_computed_value("view-transition-class", "foo bar baz");
+test_computed_value("view-transition-class", "unset", "none");
+test_computed_value("view-transition-class", "initial", "none");
+test_computed_value("view-transition-class", "inherit", "none");
+test_computed_value("view-transition-class", "revert", "none");
+test_computed_value("view-transition-class", "revert-layer", "none");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-invalid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-invalid.html
new file mode 100644
index 0000000000..9d41589bf2
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-invalid.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions Test: view-transition-class with invalid values</title>
+<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-class does not support invalid values">
+<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("view-transition-class", "default"); // `default` isn't allowed by the `<custom-ident>` syntax.
+test_invalid_value("view-transition-class", "foo none");
+test_invalid_value("view-transition-class", "#fff");
+test_invalid_value("view-transition-class", "12px");
+test_invalid_value("view-transition-class", "foo 12px");
+test_invalid_value("view-transition-class", "12em");
+test_invalid_value("view-transition-class", "12%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-valid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-valid.html
new file mode 100644
index 0000000000..480f40ca16
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-class-valid.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions Test: view-transition-class with valid values</title>
+<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-class supports custom tags">
+<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("view-transition-class", "none");
+test_valid_value("view-transition-class", "foo");
+test_valid_value("view-transition-class", "bar");
+test_valid_value("view-transition-class", "baz");
+test_valid_value("view-transition-class", "foo bar");
+test_valid_value("view-transition-class", "foo bar baz");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-computed.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-computed.html
new file mode 100644
index 0000000000..5b05667f74
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-computed.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions: view-transition-name with computed values</title>
+<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-name supports custom keywords.">
+<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("view-transition-name", "none");
+test_computed_value("view-transition-name", "foo");
+test_computed_value("view-transition-name", "bar");
+test_computed_value("view-transition-name", "baz");
+test_computed_value("view-transition-name", "unset", "none");
+test_computed_value("view-transition-name", "initial", "none");
+test_computed_value("view-transition-name", "inherit", "none");
+test_computed_value("view-transition-name", "revert", "none");
+test_computed_value("view-transition-name", "revert-layer", "none");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html
new file mode 100644
index 0000000000..00cd411d6a
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-invalid.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions Test: view-transition-name with invalid values</title>
+<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-name does not support invalid values">
+<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("view-transition-name", "auto"); // `auto` is excluded.
+test_invalid_value("view-transition-name", "default"); // `default` isn't allowed by the `<custom-ident>` syntax.
+test_invalid_value("view-transition-name", "none none");
+test_invalid_value("view-transition-name", `"none"`);
+test_invalid_value("view-transition-name", `"foo"`);
+test_invalid_value("view-transition-name", "foo foo");
+test_invalid_value("view-transition-name", "bar bar");
+test_invalid_value("view-transition-name", "baz baz");
+test_invalid_value("view-transition-name", "#fff");
+test_invalid_value("view-transition-name", "12px");
+test_invalid_value("view-transition-name", "12em");
+test_invalid_value("view-transition-name", "12%");
+</script>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-valid.html b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-valid.html
new file mode 100644
index 0000000000..2fd384449f
--- /dev/null
+++ b/testing/web-platform/tests/css/css-view-transitions/parsing/view-transition-name-valid.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CSS View Transitions Test: view-transition-name with valid values</title>
+<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
+<meta name="assert" content="view-transition-name supports custom tags">
+<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("view-transition-name", "none");
+test_valid_value("view-transition-name", "foo");
+test_valid_value("view-transition-name", "bar");
+test_valid_value("view-transition-name", "baz");
+</script>
+</body>
+</html>