summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null-undef.html
blob: dc132e5ec73001f7a162f6ffe918aed7c9a9f7f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!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(document.getElementsByClassName(undefined).length, 2);
  assert_equals(document.getElementsByClassName(undefined)[0],
    document.getElementById("p2"));
  assert_equals(document.getElementsByClassName(undefined)[1],
    document.getElementById("p4"));
/*
  assert_equals(document.getElementsByClassName(null).length, 2);
  assert_equals(document.getElementsByClassName(null)[0],
    document.getElementById("p3"));
  assert_equals(document.getElementsByClassName(null)[1],
    document.getElementById("p4"));
*/
});
</script>