Bug 1391076 - Update GeckoSession.setActive to focus/blur as appropriate. r=snorp
authorDylan Roeh <droeh@mozilla.com>
Mon, 12 Feb 2018 12:38:11 -0600
changeset 403593 04ed54caac204afa2541277e26c381f4ac0911bd
parent 403592 0541e57dfa185b4068bbbb52587c9cd387a5dbda
child 403594 284c21b1d5e4c6ec9a2e91243e95aa50b462ca13
push id99837
push userdroeh@mozilla.com
push dateTue, 13 Feb 2018 15:04:38 +0000
treeherdermozilla-inbound@04ed54caac20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1391076
milestone60.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 1391076 - Update GeckoSession.setActive to focus/blur as appropriate. r=snorp
mobile/android/modules/geckoview/GeckoViewContent.jsm
--- a/mobile/android/modules/geckoview/GeckoViewContent.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewContent.jsm
@@ -52,17 +52,25 @@ class GeckoViewContent extends GeckoView
     switch (aEvent) {
       case "GeckoViewContent:ExitFullScreen":
         this.messageManager.sendAsyncMessage("GeckoView:DOMFullscreenExited");
         break;
       case "GeckoView:ZoomToInput":
         this.messageManager.sendAsyncMessage(aEvent);
         break;
       case "GeckoView:SetActive":
-        this.browser.docShellIsActive = aData.active;
+        if (aData.active) {
+          this.browser.setAttribute("primary", "true");
+          this.browser.focus();
+          this.browser.docShellIsActive = true;
+        } else {
+          this.browser.removeAttribute("primary");
+          this.browser.docShellIsActive = false;
+          this.browser.blur();
+        }
         break;
     }
   }
 
   unregister() {
     this.window.removeEventListener("MozDOMFullScreen:Entered", this,
                                     /* capture */ true);
     this.window.removeEventListener("MozDOMFullScreen:Exited", this,