content/base/test/test_bug368972.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial