Bug 790483 - click-to-play plugins fail to show placeholder after resizing. r=jaws

This commit is contained in:
Georg Fritzsche
2013-09-17 23:23:05 +02:00
parent 18f16731af
commit 1c305db1b5
6 changed files with 203 additions and 2 deletions

View File

@@ -316,8 +316,21 @@ var gPluginHandler = {
// Hide the in-content UI if it's too big. The crashed plugin handler already did this.
if (eventType != "PluginCrashed" && eventType != "PluginRemoved") {
let overlay = this.getPluginUI(plugin, "main");
if (overlay != null && this.isTooSmall(plugin, overlay))
overlay.style.visibility = "hidden";
if (overlay != null) {
if (!this.isTooSmall(plugin, overlay))
overlay.style.visibility = "visible";
plugin.addEventListener("overflow", function(event) {
overlay.style.visibility = "hidden";
});
plugin.addEventListener("underflow", function(event) {
// this is triggered if only one dimension underflows,
// the other dimension might still overflow
if (!gPluginHandler.isTooSmall(plugin, overlay)) {
overlay.style.visibility = "visible";
}
});
}
}
// Only show the notification after we've done the isTooSmall check, so