tor-browser

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

test_bug870787.html (2637B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=870787
      5 -->
      6 <head>
      7  <title>Test for Bug 870787</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script type="application/javascript" src="reflect.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=870787">Mozilla Bug 870787</a>
     14 
     15 <p id="msg"></p>
     16 
     17 <form id="form0"></form>
     18 <img name="img0" id="img0id">
     19 
     20 <img name="img1" id="img1id" />
     21 <form id="form1">
     22  <img name="img2" id="img2id" />
     23 </form>
     24 <img name="img3" id="img3id" />
     25 
     26 <table>
     27  <form id="form2">
     28  <tr><td>
     29    <button name="input1" id="input1id" />
     30    <input name="input2" id="input2id" />
     31  </form>
     32 </table>
     33 
     34 <table>
     35  <form id="form3">
     36  <tr><td>
     37    <img name="img4" id="img4id" />
     38    <img name="img5" id="img5id" />
     39  </form>
     40 </table>
     41 
     42 <form id="form4"><img id="img6"></form>
     43 
     44 <pre id="test">
     45 <script type="application/javascript">
     46 
     47 /** Test for Bug 870787 */
     48 
     49 var form0 = document.getElementById("form0");
     50 ok(form0, "Form0 exists");
     51 ok(!form0.img0, "Form0.img0 doesn't exist");
     52 ok(!form0.img0id, "Form0.img0id doesn't exist");
     53 
     54 var form1 = document.getElementById("form1");
     55 ok(form1, "Form1 exists");
     56 ok(!form1.img1, "Form1.img1 doesn't exist");
     57 ok(!form1.img1id, "Form1.img1id doesn't exist");
     58 is(form1.img2, document.getElementById("img2id"), "Form1.img2 exists");
     59 is(form1.img2id, document.getElementById("img2id"), "Form1.img2id exists");
     60 ok(!form1.img3, "Form1.img3 doesn't exist");
     61 ok(!form1.img3id, "Form1.img3id doesn't exist");
     62 
     63 var form2 = document.getElementById("form2");
     64 ok(form2, "Form2 exists");
     65 is(form2.input1, document.getElementById("input1id"), "Form2.input1 exists");
     66 is(form2.input1id, document.getElementById("input1id"), "Form2.input1id exists");
     67 is(form2.input2, document.getElementById("input2id"), "Form2.input2 exists");
     68 is(form2.input2id, document.getElementById("input2id"), "Form2.input2id exists");
     69 
     70 var form3 = document.getElementById("form3");
     71 ok(form3, "Form3 exists");
     72 is(form3.img4, document.getElementById("img4id"), "Form3.img4 doesn't exists");
     73 is(form3.img4id, document.getElementById("img4id"), "Form3.img4id doesn't exists");
     74 is(form3.img5, document.getElementById("img5id"), "Form3.img5 doesn't exists");
     75 is(form3.img5id, document.getElementById("img5id"), "Form3.img5id doesn't exists");
     76 
     77 var form4 = document.getElementById("form4");
     78 ok(form4, "Form4 exists");
     79 is(Object.getOwnPropertyNames(form4.elements).indexOf("img6"), -1, "Form4.elements should not contain img6");
     80 
     81 </script>
     82 </pre>
     83 </body>
     84 </html>