Bug 368972: Default width/height for plugin placeholders should be 240px/200px (pinstripe fix and mochitest). r+sr=dbaron
authorDave Townsend <dtownsend@oxymoronical.com>
Sun, 14 Sep 2008 12:03:56 -0400
changeset 19239 0d7bbeb6caa34f55d67b08ffde684c6737af5705
parent 19238 f2ec117927f9a2a204ae54b4ec645a04bcac360f
child 19240 bceda53ebeb741ab91db54ffd457257f66e3c8b2
push id2049
push userdtownsend@mozilla.com
push dateSun, 14 Sep 2008 16:04:08 +0000
treeherderautoland@0d7bbeb6caa3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs368972
milestone1.9.1b1pre
Bug 368972: Default width/height for plugin placeholders should be 240px/200px (pinstripe fix and mochitest). r+sr=dbaron
content/base/test/Makefile.in
content/base/test/test_bug368972.html
toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css
--- a/content/base/test/Makefile.in
+++ b/content/base/test/Makefile.in
@@ -204,16 +204,17 @@ include $(topsrcdir)/config/rules.mk
 		test_bug445225.html \
 		file_bug445225_multipart.txt \
 		file_bug445225_multipart.txt^headers^ \
 		test_title.html \
 		test_bug453521.html \
 		test_bug391728.html \
 		file_bug391728.html \
 		file_bug391728_2.html \
+		test_bug368972.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
 check::
 	@$(EXIT_ON_ERROR) \
 	for f in $(subst .cpp,,$(CPP_UNIT_TESTS)); do \
new file mode 100644
--- /dev/null
+++ b/content/base/test/test_bug368972.html
@@ -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>
--- a/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css
+++ b/toolkit/themes/pinstripe/mozapps/plugins/missingPlugin.css
@@ -1,15 +1,27 @@
 /*
  * This file's style only applies to broken objects, not the rest
  * of the page.
  */
 
 @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 > *|* {
   width: inherit;
   height: inherit;
 }
 
 html|a {