tor-browser

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

test_bug368972.html (3946B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=368972
      5 -->
      6 <head>
      7  <title>Test for Bug 368972</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     10 <style type="text/css">
     11 #embed11, #object11 {
     12  width: 400px;
     13  height: 400px;
     14 }
     15 </style>
     16 </head>
     17 <body>
     18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=368972">Mozilla Bug 368972</a>
     19 <p id="display"></p>
     20 <div id="content">
     21 Embed without defined width/height:
     22 <embed id="embed1" type="bogus"><br>
     23 Embed width=0 height=0
     24 <embed id="embed2" type="bogus" width="0" height="0"><br>
     25 Embed width=100 height=100
     26 <embed id="embed3" type="bogus" width="100" height="100"><br>
     27 Embed height=100
     28 <embed id="embed4" type="bogus" height="100"><br>
     29 Embed width=100
     30 <embed id="embed5" type="bogus" width="100"><br>
     31 Embed width=100xxx height=100
     32 <embed id="embed6" type="bogus" width="100xxx" height="100"><br>
     33 Embed width=0100 height=100
     34 <embed id="embed7" type="bogus" width="0100" height="100"><br>
     35 Embed width= height=100
     36 <embed id="embed8" type="bogus" width="" height="100"><br>
     37 Embed width=100 height=100 style="width:400px"
     38 <embed id="embed9" type="bogus" width="100" height="100" style="width:400px;"><br>
     39 Embed height=100 style="width:400px"
     40 <embed id="embed10" type="bogus" height="100" style="width:400px;"><br>
     41 Embed height=100 (stylesheet width:400px height:400px)
     42 <embed id="embed11" type="bogus" height="100"><br>
     43 
     44 Object without defined width/height:
     45 <object id="object1" type="bogus">
     46 </object><br>
     47 Object width=0 height=0
     48 <object id="object2" type="bogus" width="0" height="0">
     49 </object><br>
     50 Object width=100 height=100
     51 <object id="object3" type="bogus" width="100" height="100">
     52 </object><br>
     53 Object height=100
     54 <object id="object4" type="bogus" height="100">
     55 </object><br>
     56 Object width=100
     57 <object id="object5" type="bogus" width="100">
     58 </object><br>
     59 Object width=100xxx height=100
     60 <object id="object6" type="bogus" width="100xxx" height="100">
     61 </object><br>
     62 Object width=0100 height=100
     63 <object id="object7" type="bogus" width="0100" height="100">
     64 </object><br>
     65 Object width= height=100
     66 <object id="object8" type="bogus" width="" height="100">
     67 </object><br>
     68 Object width=100 height=100 style="width:400px"
     69 <object id="object9" type="bogus" width="100" height="100" style="width:400px;">
     70 </object><br>
     71 Object height=100 style="width:400px"
     72 <object id="object10" type="bogus" height="100" style="width:400px;">
     73 </object><br>
     74 Object height=100 (stylesheet width:400px height:400px)
     75 <object id="object11" type="bogus" height="100">
     76 </object><br>
     77 </div>
     78 <pre id="test">
     79 <script class="testbody" type="text/javascript">
     80 function check_size(id, width, height) {
     81  var element = document.getElementById(id);
     82  ok(element, "Plugin element " + id + " did not exist");
     83  if (width != "auto") {
     84    width = width + "px";
     85  }
     86  if (height != "auto") {
     87    height = height + "px";
     88  }
     89  var style = window.getComputedStyle(element);
     90  is(style.width, width, "Plugin element " + id + " had an incorrect width");
     91  is(style.height, height, "Plugin element " + id + " had an incorrect height");
     92 }
     93 
     94 check_size("embed1", "auto", "auto");
     95 check_size("embed2", 0, 0);
     96 check_size("embed3", 100, 100);
     97 check_size("embed4", "auto", 100);
     98 check_size("embed5", 100, "auto");
     99 check_size("embed6", 100, 100);
    100 check_size("embed7", 100, 100);
    101 check_size("embed8", "auto", 100);
    102 check_size("embed9", 400, 100);
    103 check_size("embed10", 400, 100);
    104 check_size("embed11", 400, 400);
    105 
    106 check_size("object1", "auto", "auto");
    107 check_size("object2", 0, 0);
    108 check_size("object3", 100, 100);
    109 check_size("object4", "auto", 100);
    110 check_size("object5", 100, "auto");
    111 check_size("object6", 100, 100);
    112 check_size("object7", 100, 100);
    113 check_size("object8", "auto", 100);
    114 check_size("object9", 400, 100);
    115 check_size("object10", 400, 100);
    116 check_size("object11", 400, 400);
    117 </script>
    118 </pre>
    119 </body>
    120 </html>