1
0
Fork 0
firefox/testing/web-platform/tests/dom/nodes/getElementsByClassName-empty-set.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

29 lines
981 B
HTML

<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>Node.prototype.getElementsByClassName with no real class names</title>
<link rel=help href="https://dom.spec.whatwg.org/#dom-document-getelementsbyclassname">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<span class=" ">test</span>
<script>
"use strict";
test(() => {
const elements = document.getElementsByClassName("");
assert_array_equals(elements, []);
}, "Passing an empty string to getElementsByClassName should return an empty HTMLCollection");
test(() => {
const elements = document.getElementsByClassName(" ");
assert_array_equals(elements, []);
}, "Passing a space to getElementsByClassName should return an empty HTMLCollection");
test(() => {
const elements = document.getElementsByClassName(" ");
assert_array_equals(elements, []);
}, "Passing three spaces to getElementsByClassName should return an empty HTMLCollection");
</script>