зеркало из https://github.com/mozilla/gecko-dev.git
Bug 368972: Default width/height for plugin placeholders should be 240px/200px (pinstripe fix and mochitest). r+sr=dbaron
This commit is contained in:
Родитель
4f84c41d8f
Коммит
e6ebcc6766
|
@ -209,6 +209,7 @@ _TEST_FILES = test_bug5141.html \
|
|||
test_bug391728.html \
|
||||
file_bug391728.html \
|
||||
file_bug391728_2.html \
|
||||
test_bug368972.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=368972
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 368972</title>
|
||||
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<style type="text/css">
|
||||
#embed11, #object11 {
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=368972">Mozilla Bug 368972</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
Embed without defined width/height:
|
||||
<embed id="embed1" type="bogus"><br>
|
||||
Embed width=0 height=0
|
||||
<embed id="embed2" type="bogus" width="0" height="0"><br>
|
||||
Embed width=100 height=100
|
||||
<embed id="embed3" type="bogus" width="100" height="100"><br>
|
||||
Embed height=100
|
||||
<embed id="embed4" type="bogus" height="100"><br>
|
||||
Embed width=100
|
||||
<embed id="embed5" type="bogus" width="100"><br>
|
||||
Embed width=100xxx height=100
|
||||
<embed id="embed6" type="bogus" width="100xxx" height="100"><br>
|
||||
Embed width=0100 height=100
|
||||
<embed id="embed7" type="bogus" width="0100" height="100"><br>
|
||||
Embed width= height=100
|
||||
<embed id="embed8" type="bogus" width="" height="100"><br>
|
||||
Embed width=100 height=100 style="width:400px"
|
||||
<embed id="embed9" type="bogus" width="100" height="100" style="width:400px;"><br>
|
||||
Embed height=100 style="width:400px"
|
||||
<embed id="embed10" type="bogus" height="100" style="width:400px;"><br>
|
||||
Embed height=100 (stylesheet width:400px height:400px)
|
||||
<embed id="embed11" type="bogus" height="100"><br>
|
||||
|
||||
Object without defined width/height:
|
||||
<object id="object1" type="bogus">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=0 height=0
|
||||
<object id="object2" type="bogus" width="0" height="0">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=100 height=100
|
||||
<object id="object3" type="bogus" width="100" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object height=100
|
||||
<object id="object4" type="bogus" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=100
|
||||
<object id="object5" type="bogus" width="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=100xxx height=100
|
||||
<object id="object6" type="bogus" width="100xxx" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=0100 height=100
|
||||
<object id="object7" type="bogus" width="0100" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width= height=100
|
||||
<object id="object8" type="bogus" width="" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object width=100 height=100 style="width:400px"
|
||||
<object id="object9" type="bogus" width="100" height="100" style="width:400px;">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object height=100 style="width:400px"
|
||||
<object id="object10" type="bogus" height="100" style="width:400px;">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
Object height=100 (stylesheet width:400px height:400px)
|
||||
<object id="object11" type="bogus" height="100">
|
||||
<param name="pluginurl" value="http://foo">
|
||||
</object><br>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
function check_size(id, width, height) {
|
||||
var element = document.getElementById(id);
|
||||
ok(element, "Plugin element " + id + " did not exist");
|
||||
var style = window.getComputedStyle(element, null);
|
||||
is(style.width, width + "px", "Plugin element " + id + " had an incorrect width");
|
||||
is(style.height, height + "px", "Plugin element " + id + " had an incorrect height");
|
||||
}
|
||||
|
||||
check_size("embed1", 240, 200);
|
||||
check_size("embed2", 0, 0);
|
||||
check_size("embed3", 100, 100);
|
||||
check_size("embed4", 240, 100);
|
||||
check_size("embed5", 100, 200);
|
||||
check_size("embed6", 100, 100);
|
||||
check_size("embed7", 100, 100);
|
||||
check_size("embed8", 240, 100);
|
||||
check_size("embed9", 400, 100);
|
||||
check_size("embed10", 400, 100);
|
||||
check_size("embed11", 400, 400);
|
||||
|
||||
check_size("object1", 240, 200);
|
||||
check_size("object2", 0, 0);
|
||||
check_size("object3", 100, 100);
|
||||
check_size("object4", 240, 100);
|
||||
check_size("object5", 100, 200);
|
||||
check_size("object6", 100, 100);
|
||||
check_size("object7", 100, 100);
|
||||
check_size("object8", 240, 100);
|
||||
check_size("object9", 400, 100);
|
||||
check_size("object10", 400, 100);
|
||||
check_size("object11", 400, 400);
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -5,6 +5,18 @@
|
|||
|
||||
@namespace html url(http://www.w3.org/1999/xhtml);
|
||||
|
||||
html|object:not([width]), html|object[width=""],
|
||||
html|embed:not([width]), html|embed[width=""],
|
||||
html|applet:not([width]), html|applet[width=""] {
|
||||
width: 240px;
|
||||
}
|
||||
|
||||
html|object:not([height]), html|object[height=""],
|
||||
html|embed:not([height]), html|embed[height=""],
|
||||
html|applet:not([height]), html|applet[height=""] {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
html|object > *|*,
|
||||
html|embed > *|*,
|
||||
html|applet > *|* {
|
||||
|
|
Загрузка…
Ссылка в новой задаче