4 https://bugzilla.mozilla.org/show_bug.cgi?id=368972
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">
18 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=368972">Mozilla Bug
368972</a>
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>
28 <embed id=
"embed4" type=
"bogus" height=
"100"><br>
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>
44 Object without defined width/height:
45 <object id=
"object1" type=
"bogus">
47 Object width=
0 height=
0
48 <object id=
"object2" type=
"bogus" width=
"0" height=
"0">
50 Object width=
100 height=
100
51 <object id=
"object3" type=
"bogus" width=
"100" height=
"100">
54 <object id=
"object4" type=
"bogus" height=
"100">
57 <object id=
"object5" type=
"bogus" width=
"100">
59 Object width=
100xxx height=
100
60 <object id=
"object6" type=
"bogus" width=
"100xxx" height=
"100">
62 Object width=
0100 height=
100
63 <object id=
"object7" type=
"bogus" width=
"0100" height=
"100">
65 Object width= height=
100
66 <object id=
"object8" type=
"bogus" width=
"" height=
"100">
68 Object width=
100 height=
100 style=
"width:400px"
69 <object id=
"object9" type=
"bogus" width=
"100" height=
"100" style=
"width:400px;">
71 Object height=
100 style=
"width:400px"
72 <object id=
"object10" type=
"bogus" height=
"100" style=
"width:400px;">
74 Object height=
100 (stylesheet width:
400px height:
400px)
75 <object id=
"object11" type=
"bogus" height=
"100">
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") {
86 if (height !=
"auto") {
87 height = height +
"px";
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");
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);
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);