diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/selectors/query | |
parent | Initial commit. (diff) | |
download | firefox-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/selectors/query')
-rw-r--r-- | testing/web-platform/tests/css/selectors/query/query-is.html | 57 | ||||
-rw-r--r-- | testing/web-platform/tests/css/selectors/query/query-where.html | 57 |
2 files changed, 114 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/selectors/query/query-is.html b/testing/web-platform/tests/css/selectors/query/query-is.html new file mode 100644 index 0000000000..918eaee701 --- /dev/null +++ b/testing/web-platform/tests/css/selectors/query/query-is.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>Selectors Level 4: query using :is()</title> + <link rel="help" href="https://drafts.csswg.org/selectors/#matches"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/query-testcommon.js"></script> +</head> +<body> + <div id="a1" class="a"> + <div class="b" id="b1"></div> + <div class="c" id="c1"></div> + <div class="c" id="d"></div> + <div class="e" id="e1"></div> + <div class="f" id="f1"></div> + <div class="g"> + <div class="b" id="b2"> + <div class="b" id="b3"></div> + </div> + </div> + <div class="h" id="h1"></div> + </div> + <div class="c" id="c2"> + <div id="a2" class="a"></div> + <div class="e" id="e2"></div> + </div> + <script> + 'use strict'; + + // Simple selector arguments are supported by :is + test_query_selector(document, '.a :is(.b, .c)', + ['b1', 'c1', 'd', 'b2', 'b3']); + + // Compound selector arguments are supported by :is + test_query_selector(document, '.a :is(.c#d, .e)', + ['d', 'e1']); + + // Complex selector arguments are supported by :is + test_query_selector(document, '.a :is(.e+.f, .g>.b, .h)', + ['f1', 'b2', 'h1']); + + // Nested selector arguments are supported by :is + test_query_selector(document, '.a+:is(.b+.f, :is(.c>.e, .g))', + 'e2'); + + // Nested :where selector arguments are supported by :is + test_query_selector(document, '.a :is(:where(:where(.b ~ .c)))', + ['c1', 'd']); + + // Nested :not selector arguments are supported by :is + test_query_selector(document, '.b + :is(.c + .c + .c, .b + .c:not(span), .b + .c + .e) ~ .h', + ['h1']); + </script> +</body> +</html> diff --git a/testing/web-platform/tests/css/selectors/query/query-where.html b/testing/web-platform/tests/css/selectors/query/query-where.html new file mode 100644 index 0000000000..b7cf5e1b20 --- /dev/null +++ b/testing/web-platform/tests/css/selectors/query/query-where.html @@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>Selectors Level 4: query using :where()</title> + <link rel="help" href="https://drafts.csswg.org/selectors/#zero-matches"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/css/support/query-testcommon.js"></script> +</head> +<body> + <div id="a1" class="a"> + <div class="b" id="b1"></div> + <div class="c" id="c1"></div> + <div class="c" id="d"></div> + <div class="e" id="e1"></div> + <div class="f" id="f1"></div> + <div class="g"> + <div class="b" id="b2"> + <div class="b" id="b3"></div> + </div> + </div> + <div class="h" id="h1"></div> + </div> + <div class="c" id="c2"> + <div id="a2" class="a"></div> + <div class="e" id="e2"></div> + </div> + <script> + 'use strict'; + + // Simple selector arguments are supported by :where + test_query_selector(document, '.a :where(.b, .c)', + ['b1', 'c1', 'd', 'b2', 'b3']); + + // Compound selector arguments are supported by :where + test_query_selector(document, '.a :where(.c#d, .e)', + ['d', 'e1']); + + // Complex selector arguments are supported by :where + test_query_selector(document, '.a :where(.e+.f, .g>.b, .h)', + ['f1', 'b2', 'h1']); + + // Nested selector arguments are supported by :where + test_query_selector(document, '.a+:where(.b+.f, :where(.c>.e, .g))', + ['e2']); + + // Nested :is selector arguments are supported by :where + test_query_selector(document, '.a :where(:is(:is(.b ~ .c)))', + ['c1', 'd']); + + // Nested :not selector arguments are supported by :where + test_query_selector(document, '.b + :where(.c + .c + .c, .b + .c:not(span), .b + .c + .e) ~ .h', + ['h1']); + </script> +</body> +</html> |