Bug 623624 - Content elements don't get focus when the focus method is set on them [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Fri, 25 Mar 2011 18:39:22 +0100
changeset 67542 74618876a5acd12443c6f45de0f542d60768d63f
parent 67541 663cfb4654d088e6907d8f012bf3999bdded2150
child 67543 1f80214e3055a59740e68da2cffddcb8419da7e1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs623624
Bug 623624 - Content elements don't get focus when the focus method is set on them [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -2741,18 +2741,23 @@ Tab.prototype = {
     let notification = this._notification;
     let browser = this._browser;
 
     if (aActive) {
       browser.setAttribute("type", "content-primary");
       Elements.browsers.selectedPanel = notification;
       browser.active = true;
       document.getElementById("tabs").selectedTab = this._chromeTab;
-    }
-    else {
+
+      // Ensure that the content process has gets an activate event
+      try {
+        let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
+        fl.activateRemoteFrame();
+      } catch (e) {}
+    } else {
       browser.messageManager.sendAsyncMessage("Browser:Blur", { });
       browser.setAttribute("type", "content");
       browser.active = false;
     }
   },
 
   get active() {
     if (!this._browser)