tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Element.getElementsByClassName-null-undef.html (1112B)


      1 <!doctype html>
      2 <title>getElementsByClassName and null/undefined</title>
      3 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
      4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-getelementsbyclassname">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <div id="log"></div>
      8 <div id="test">
      9 <p id="p1"></p>
     10 <p class="undefined" id="p2"></p>
     11 <p class="null" id="p3"></p>
     12 <p class="undefined null" id="p4"></p>
     13 </div>
     14 <script>
     15 test(function() {
     16  var wrapper = document.getElementById("test");
     17  assert_equals(wrapper.getElementsByClassName(undefined).length, 2);
     18  assert_equals(wrapper.getElementsByClassName(undefined)[0],
     19    document.getElementById("p2"));
     20  assert_equals(wrapper.getElementsByClassName(undefined)[1],
     21    document.getElementById("p4"));
     22 /*
     23  assert_equals(wrapper.getElementsByClassName(null).length, 2);
     24  assert_equals(wrapper.getElementsByClassName(null)[0],
     25    document.getElementById("p3"));
     26  assert_equals(wrapper.getElementsByClassName(null)[1],
     27    document.getElementById("p4"));
     28 */
     29 });
     30 </script>