Bug 1168397 - Skip hiding toolbars for fullscreen mode on OS X Lion. r=dao, a=sledru
authorXidorn Quan <quanxunzhen@gmail.com>
Sat, 06 Jun 2015 19:08:00 +1200
changeset 274987 77aebefaa4de1f71d9085cd5c7fcee0ccfc546c4
parent 274986 2b9ab3af292d66591e5d77c8ef9ba3b8f089b5b5
child 274988 1ce864d841dbb211c74f7a95fb9b332d708a8d61
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, sledru
bugs1168397
milestone40.0a2
Bug 1168397 - Skip hiding toolbars for fullscreen mode on OS X Lion. r=dao, a=sledru
browser/base/content/browser-fullScreen.js
--- a/browser/base/content/browser-fullScreen.js
+++ b/browser/base/content/browser-fullScreen.js
@@ -45,18 +45,30 @@ var FullScreen = {
 #endif
 
     if (!this._fullScrToggler) {
       this._fullScrToggler = document.getElementById("fullscr-toggler");
       this._fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
       this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
     }
 
+    if (enterFS) {
+      gNavToolbox.setAttribute("inFullscreen", true);
+      document.documentElement.setAttribute("inFullscreen", true);
+    } else {
+      gNavToolbox.removeAttribute("inFullscreen");
+      document.documentElement.removeAttribute("inFullscreen");
+    }
+
     // show/hide menubars, toolbars (except the full screen toolbar)
-    this.showXULChrome("toolbar", !enterFS);
+    // On OS X Lion, we don't want to hide toolbars when entering
+    // fullscreen, unless we're entering DOM fullscreen.
+    if (document.mozFullScreen || !this.useLionFullScreen) {
+      this.showXULChrome("toolbar", !enterFS);
+    }
 
     if (enterFS) {
       document.addEventListener("keypress", this._keyToggleCallback, false);
       document.addEventListener("popupshown", this._setPopupOpen, false);
       document.addEventListener("popuphidden", this._setPopupOpen, false);
       this._shouldAnimate = true;
       // We don't animate the toolbar collapse if in DOM full-screen mode,
       // as the size of the content area would still be changing after the
@@ -524,24 +536,16 @@ var FullScreen = {
         // so that new windows don't have missing toolbars
         if (aShow)
           el.removeAttribute("moz-collapsed");
         else
           el.setAttribute("moz-collapsed", "true");
       }
     }
 
-    if (aShow) {
-      gNavToolbox.removeAttribute("inFullscreen");
-      document.documentElement.removeAttribute("inFullscreen");
-    } else {
-      gNavToolbox.setAttribute("inFullscreen", true);
-      document.documentElement.setAttribute("inFullscreen", true);
-    }
-
     ToolbarIconColor.inferFromText();
 
     // For Lion fullscreen, all fullscreen controls are hidden, don't
     // bother to touch them. If we don't stop here, the following code
     // could cause the native fullscreen button be shown unexpectedly.
     // See bug 1165570.
     if (this.useLionFullScreen) {
       return;