Bug 920927 - Fix plugin overlay handling. r=neil
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Tue, 15 Oct 2013 10:35:49 +0200
changeset 150766 7759d30a7ae58c2606f26c8e4b44a17cd6a312e2
parent 150765 38bf0e99cd7b4fc6b883a3682f1c85e62f7d8c61
child 150767 99c71671485687b5b5a04e2560333c8d3f83586f
push id34967
push usergeorg.fritzsche@googlemail.com
push dateTue, 15 Oct 2013 08:36:21 +0000
treeherdermozilla-inbound@f585d3d5d879 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs920927
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920927 - Fix plugin overlay handling. r=neil
browser/base/content/browser-plugins.js
toolkit/mozapps/plugins/content/pluginProblemBinding.css
toolkit/mozapps/plugins/content/pluginProblemContent.css
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -308,17 +308,17 @@ var gPluginHandler = {
         break;
 
       case "PluginInstantiated":
       case "PluginRemoved":
         shouldShowNotification = true;
         break;
     }
 
-    // Hide the in-content UI if it's too big. The crashed plugin handler already did this.
+    // Show the in-content UI if it's not too big. The crashed plugin handler already did this.
     if (eventType != "PluginCrashed" && eventType != "PluginRemoved") {
       let overlay = this.getPluginUI(plugin, "main");
       if (overlay != null) {
         if (!this.isTooSmall(plugin, overlay))
           overlay.style.visibility = "visible";
 
         plugin.addEventListener("overflow", function(event) {
           overlay.style.visibility = "hidden";
@@ -984,22 +984,22 @@ var gPluginHandler = {
     // Is the <object>'s size too small to hold what we want to show?
     if (this.isTooSmall(plugin, overlay)) {
       // First try hiding the crash report submission UI.
       statusDiv.removeAttribute("status");
 
       if (this.isTooSmall(plugin, overlay)) {
         // Hide the overlay's contents. Use visibility style, so that it doesn't
         // collapse down to 0x0.
-        overlay.style.visibility = "hidden";
         isShowing = false;
       }
     }
 
     if (isShowing) {
+      overlay.style.visibility = "visible";
       // If a previous plugin on the page was too small and resulted in adding a
       // notification bar, then remove it because this plugin instance it big
       // enough to serve as in-content notification.
       hideNotificationBar();
       doc.mozNoPluginCrashedNotification = true;
     } else {
       // If another plugin on the page was large enough to show our UI, we don't
       // want to show a notification bar.
--- a/toolkit/mozapps/plugins/content/pluginProblemBinding.css
+++ b/toolkit/mozapps/plugins/content/pluginProblemBinding.css
@@ -21,15 +21,12 @@ applet:-moz-handler-vulnerable-no-update
 object:-moz-handler-disabled,
 object:-moz-handler-blocked,
 object:-moz-handler-crashed,
 object:-moz-handler-clicktoplay,
 object:-moz-handler-playpreview,
 object:-moz-handler-vulnerable-updatable,
 object:-moz-handler-vulnerable-no-update {
     display: inline-block;
-    /* Initialize the overlay with visibility:hidden to prevent flickering if
-     * the plugin is too small to show the overlay */
-    visibility: hidden;
     overflow: hidden;
     opacity: 1 !important;
     -moz-binding: url('chrome://mozapps/content/plugins/pluginProblem.xml#pluginProblem') !important;
 }
--- a/toolkit/mozapps/plugins/content/pluginProblemContent.css
+++ b/toolkit/mozapps/plugins/content/pluginProblemContent.css
@@ -37,16 +37,19 @@ html|applet:not([height]), html|applet[h
 :-moz-handler-disabled .mainBox:focus,
 :-moz-handler-blocked .mainBox:focus {
   outline: 1px dotted;
 }
 
 .mainBox {
   width: inherit;
   height: inherit;
+  /* Initialize the overlay with visibility:hidden to prevent flickering if
+   * the plugin is too small to show the overlay */
+  visibility: hidden;
   overflow: hidden;
   direction: ltr;
   unicode-bidi: embed;
   /* used to block inherited properties */
   text-transform: none;
   text-indent: 0;
   cursor: initial;
   white-space: initial;