content/base/test/test_bug368972.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug368972.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,114 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=368972
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 368972</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +<style type="text/css">
    1.14 +#embed11, #object11 {
    1.15 +  width: 400px;
    1.16 +  height: 400px;
    1.17 +}
    1.18 +</style>
    1.19 +</head>
    1.20 +<body>
    1.21 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=368972">Mozilla Bug 368972</a>
    1.22 +<p id="display"></p>
    1.23 +<div id="content">
    1.24 +Embed without defined width/height:
    1.25 +<embed id="embed1" type="bogus"><br>
    1.26 +Embed width=0 height=0
    1.27 +<embed id="embed2" type="bogus" width="0" height="0"><br>
    1.28 +Embed width=100 height=100
    1.29 +<embed id="embed3" type="bogus" width="100" height="100"><br>
    1.30 +Embed height=100
    1.31 +<embed id="embed4" type="bogus" height="100"><br>
    1.32 +Embed width=100
    1.33 +<embed id="embed5" type="bogus" width="100"><br>
    1.34 +Embed width=100xxx height=100
    1.35 +<embed id="embed6" type="bogus" width="100xxx" height="100"><br>
    1.36 +Embed width=0100 height=100
    1.37 +<embed id="embed7" type="bogus" width="0100" height="100"><br>
    1.38 +Embed width= height=100
    1.39 +<embed id="embed8" type="bogus" width="" height="100"><br>
    1.40 +Embed width=100 height=100 style="width:400px"
    1.41 +<embed id="embed9" type="bogus" width="100" height="100" style="width:400px;"><br>
    1.42 +Embed height=100 style="width:400px"
    1.43 +<embed id="embed10" type="bogus" height="100" style="width:400px;"><br>
    1.44 +Embed height=100 (stylesheet width:400px height:400px)
    1.45 +<embed id="embed11" type="bogus" height="100"><br>
    1.46 +
    1.47 +Object without defined width/height:
    1.48 +<object id="object1" type="bogus">
    1.49 +</object><br>
    1.50 +Object width=0 height=0
    1.51 +<object id="object2" type="bogus" width="0" height="0">
    1.52 +</object><br>
    1.53 +Object width=100 height=100
    1.54 +<object id="object3" type="bogus" width="100" height="100">
    1.55 +</object><br>
    1.56 +Object height=100
    1.57 +<object id="object4" type="bogus" height="100">
    1.58 +</object><br>
    1.59 +Object width=100
    1.60 +<object id="object5" type="bogus" width="100">
    1.61 +</object><br>
    1.62 +Object width=100xxx height=100
    1.63 +<object id="object6" type="bogus" width="100xxx" height="100">
    1.64 +</object><br>
    1.65 +Object width=0100 height=100
    1.66 +<object id="object7" type="bogus" width="0100" height="100">
    1.67 +</object><br>
    1.68 +Object width= height=100
    1.69 +<object id="object8" type="bogus" width="" height="100">
    1.70 +</object><br>
    1.71 +Object width=100 height=100 style="width:400px"
    1.72 +<object id="object9" type="bogus" width="100" height="100" style="width:400px;">
    1.73 +</object><br>
    1.74 +Object height=100 style="width:400px"
    1.75 +<object id="object10" type="bogus" height="100" style="width:400px;">
    1.76 +</object><br>
    1.77 +Object height=100 (stylesheet width:400px height:400px)
    1.78 +<object id="object11" type="bogus" height="100">
    1.79 +</object><br>
    1.80 +</div>
    1.81 +<pre id="test">
    1.82 +<script class="testbody" type="text/javascript">
    1.83 +function check_size(id, width, height) {
    1.84 +  var element = document.getElementById(id);
    1.85 +  ok(element, "Plugin element " + id + " did not exist");
    1.86 +  var style = window.getComputedStyle(element, null);
    1.87 +  is(style.width, width + "px", "Plugin element " + id + " had an incorrect width");
    1.88 +  is(style.height, height + "px", "Plugin element " + id + " had an incorrect height");
    1.89 +}
    1.90 +
    1.91 +check_size("embed1", 240, 200);
    1.92 +check_size("embed2", 0, 0);
    1.93 +check_size("embed3", 100, 100);
    1.94 +check_size("embed4", 240, 100);
    1.95 +check_size("embed5", 100, 200);
    1.96 +check_size("embed6", 100, 100);
    1.97 +check_size("embed7", 100, 100);
    1.98 +check_size("embed8", 240, 100);
    1.99 +check_size("embed9", 400, 100);
   1.100 +check_size("embed10", 400, 100);
   1.101 +check_size("embed11", 400, 400);
   1.102 +
   1.103 +check_size("object1", 240, 200);
   1.104 +check_size("object2", 0, 0);
   1.105 +check_size("object3", 100, 100);
   1.106 +check_size("object4", 240, 100);
   1.107 +check_size("object5", 100, 200);
   1.108 +check_size("object6", 100, 100);
   1.109 +check_size("object7", 100, 100);
   1.110 +check_size("object8", 240, 100);
   1.111 +check_size("object9", 400, 100);
   1.112 +check_size("object10", 400, 100);
   1.113 +check_size("object11", 400, 400);
   1.114 +</script>
   1.115 +</pre>
   1.116 +</body>
   1.117 +</html>

mercurial