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 95221 aec492e095b856a2d180470fad83c355a8e6a95c
parent 95220 81c31a6906b6307f1dd6ccf000e550c9160f30cf
child 95222 8f6fdee0a7128026af59db5b363b0befeaa8eb2c
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs745016
milestone14.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 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;