tor-browser

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

historical.html (1218B)


      1 <!doctype html>
      2 <title>Historical HTML*Collection features should not be supported</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id=log></div>
      6 <form id=form><input name=foo></form>
      7 <select id=select><option name=bar></select>
      8 <div id=dupe>
      9 <div id=dupe>
     10 <script>
     11 test(function() {
     12  var collection = document.getElementById('form').elements;
     13  assert_equals(typeof collection, 'object', 'typeof');
     14  assert_throws_js(TypeError, function() {
     15    collection('foo');
     16  });
     17 }, 'HTMLFormControlsCollection legacycaller should not be supported');
     18 
     19 test(function() {
     20  var collection = document.getElementById('select').options;
     21  assert_equals(typeof collection, 'object', 'typeof');
     22  assert_throws_js(TypeError, function() {
     23    collection('bar');
     24  });
     25 }, 'HTMLOptionsCollection legacycaller should not be supported');
     26 
     27 test(function() {
     28  var collection = document.all('dupe', 0);
     29  // If the second argument were used, it would return the first item of the
     30  // collection instead of the whole collection.
     31  assert_equals(collection.length, 2, 'length');
     32 }, 'HTMLAllCollection legacycaller with two arguments should not be supported');
     33 </script>