diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/css/selectors/last-child.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/selectors/last-child.html')
-rw-r--r-- | testing/web-platform/tests/css/selectors/last-child.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/selectors/last-child.html b/testing/web-platform/tests/css/selectors/last-child.html new file mode 100644 index 0000000000..423ccf84f4 --- /dev/null +++ b/testing/web-platform/tests/css/selectors/last-child.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Selectors :last-child</title> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#the-last-child-pseudo"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<!-- + See also: + * child-indexed-pseudo-class.html + * child-indexed-no-parent.html + * invalidation/first-child-last-child.html +--> +<body> + +<div> + <div id="target1">Whitespace nodes should be ignored.</div> +</div> + +<div> + <blockquote></blockquote> + <div id="target2">There is a prior child element.</div> +</div> + +<div> + <div id="target3">A comment node should be ignored.</div> + <!-- --> +</div> + +<div> + <div id="target4">Non-whitespace text node should be ignored.</div> + . +</div> + +<div> + <div id="target5" data-expected="false">The first child should not be matched.</div> + <blockquote></blockquote> +</div> + +<script> +for (let i = 1; i <= 5; ++i) { + let target = document.querySelector(`#target${i}`); + test(() => { + if (target.dataset.expected == 'false') + assert_false(target.matches(':last-child')); + else + assert_true(target.matches(':last-child')); + }, target.textContent); +} +</script> + |