summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html')
-rw-r--r--testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html64
1 files changed, 64 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html b/testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html
new file mode 100644
index 0000000000..bc23ad180b
--- /dev/null
+++ b/testing/web-platform/tests/css/cssom/getComputedStyle-pseudo-with-argument.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: Handling pseudo-elements with arguments</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<link rel=help href=https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle>
+<style>
+#pseudo-invalid::highlight(name) {
+ color: rgb(0, 128, 0);
+}
+#pseudo-invalid::view-transition-image-pair(name) {
+ color: rgb(0, 128, 0);
+}
+#pseudo-invalid::view-transition-group(name) {
+ color: rgb(0, 128, 0);
+}
+#pseudo-invalid::view-transition-old(name) {
+ color: rgb(0, 128, 0);
+}
+#pseudo-invalid::view-transition-new(name) {
+ color: rgb(0, 128, 0);
+}
+</style>
+<ul><li id="pseudo-invalid">Item</li></ul>
+<script>
+[
+ "::before(test)",
+ "::highlight",
+ "::highlight(",
+ "::highlight()",
+ "::highlight(1)",
+ "::highlight($)",
+ "::highlight (name)",
+ "::highlight(name)a",
+ ":highlight(name)",
+ "::view-transition-group(*)",
+ "::view-transition-image-pair(*)",
+ "::view-transition-old(*)",
+ "::view-transition-new(*)",
+ ":view-transition-group(name)",
+ ":view-transition-image-pair(name)",
+ ":view-transition-old(name)",
+ ":view-transition-new(name)",
+].forEach(nonParsablePseudoIdentifier => {
+ test(() => {
+ const li = document.querySelector('li');
+ assert_equals(getComputedStyle(li, nonParsablePseudoIdentifier).length, 0);
+ }, `This pseudo-element should not parse: ${nonParsablePseudoIdentifier}`)
+});
+
+[
+ "::highlight(name)",
+ "::highlight(\nname",
+ "::highlight(name\t",
+ "::highlight( name ",
+ "::highlight( n\\61me )"
+].forEach(parsablePseudoIdentifier => {
+ test(() => {
+ const li = document.querySelector('li');
+ assert_true(getComputedStyle(li, parsablePseudoIdentifier).length != 0);
+ assert_equals(getComputedStyle(li, parsablePseudoIdentifier).color, "rgb(0, 128, 0)");
+ }, `This pseudo-element should parse: ${parsablePseudoIdentifier}`);
+});
+</script>