testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Element.getElementsByClassName-null-undef.html
author Sandor Molnar <smolnar@mozilla.com>
Thu, 29 Sep 2022 04:48:26 +0300
changeset 636564 59ab3186dfd4016b98a1dc97ea9ba146cb9f7abc
parent 292674 0cd33f35bcb4feea6fcdfbc0f6f09912e2ad106c
permissions -rw-r--r--
Backed out 2 changesets (bug 1774317) for causing top-crash (bug 1792767) CLOSED TREE Backed out changeset 418dec4ac3f9 (bug 1774317) Backed out changeset 329666086b40 (bug 1774317)

<!doctype html>
<title>getElementsByClassName and null/undefined</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-getelementsbyclassname">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<div id="test">
<p id="p1"></p>
<p class="undefined" id="p2"></p>
<p class="null" id="p3"></p>
<p class="undefined null" id="p4"></p>
</div>
<script>
test(function() {
  var wrapper = document.getElementById("test");
  assert_equals(wrapper.getElementsByClassName(undefined).length, 2);
  assert_equals(wrapper.getElementsByClassName(undefined)[0],
    document.getElementById("p2"));
  assert_equals(wrapper.getElementsByClassName(undefined)[1],
    document.getElementById("p4"));
/*
  assert_equals(wrapper.getElementsByClassName(null).length, 2);
  assert_equals(wrapper.getElementsByClassName(null)[0],
    document.getElementById("p3"));
  assert_equals(wrapper.getElementsByClassName(null)[1],
    document.getElementById("p4"));
*/
});
</script>