Bug 745016 - Tap-to-play plugin click listener sometimes doesn't get triggered. r+a=mfinkle
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 18 Apr 2012 07:59:21 -0700
changeset 91908 aec492e095b856a2d180470fad83c355a8e6a95c
parent 91907 81c31a6906b6307f1dd6ccf000e550c9160f30cf
child 91909 8f6fdee0a7128026af59db5b363b0befeaa8eb2c
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs745016
milestone14.0a1
Bug 745016 - Tap-to-play plugin click listener sometimes doesn't get triggered. r+a=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1979,16 +1979,19 @@ Tab.prototype = {
         // Check if plugins have already been activated for this page, or if the user
         // has set a permission to always play plugins on the site
         if (this.clickToPlayPluginsActivated ||
             Services.perms.testPermission(this.browser.currentURI, "plugins") == Services.perms.ALLOW_ACTION) {
           PluginHelper.playPlugin(plugin);
           return;
         }
 
+        // Force a style flush, so that we ensure our binding is attached.
+        plugin.clientTop;
+
         // If the plugin is hidden, or if the overlay is too small, show a doorhanger notification
         let overlay = plugin.ownerDocument.getAnonymousElementByAttribute(plugin, "class", "mainBox");
         if (!overlay || PluginHelper.isTooSmall(plugin, overlay)) {
           if (!this.clickToPlayPluginDoorhangerShown)
             PluginHelper.showDoorHanger(this);
 
           if (!overlay)
             return;