diff --git a/extensions/chromium/contentscript.js b/extensions/chromium/contentscript.js index c2e899114..18675091c 100644 --- a/extensions/chromium/contentscript.js +++ b/extensions/chromium/contentscript.js @@ -160,6 +160,22 @@ function updateObjectElement(elem) { elem.type = 'application/not-a-pee-dee-eff-type'; // Force the to reload and render its fallback content. elem.data += ''; + + // Usually the browser renders plugin content in this tag, which is completely + // oblivious of styles such as padding, but we insert and render child nodes, + // so force padding to be zero to avoid undesired dimension changes. + elem.style.padding = '0'; + + // and elements have a "display:inline" style by default. + // Despite this property, when a plugin is loaded in the tag, the tag is + // treated like "display:inline-block". However, when the browser does not + // render plugin content, the tag does not behave like that, and as + // a result the width and height is ignored. + // Force "display:inline-block" to make sure that the width/height as set by + // web pages is respected. + // ( behaves as expected with the default display value, but setting it + // to display:inline-block doesn't hurt). + elem.style.display = 'inline-block'; } // Create an