Bug 1204513 DOM Full Screen should be really full screen r=Ratty
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sun, 27 Sep 2015 23:55:57 +0100
changeset 18453 884d1267eff34a5a21c02e207d08b1e7f573cf2c
parent 18452 bda92538bc44c1c22d08e656eb2195dc0e03ee19
child 18454 9f73d5ae67e1a18a5abe26f3debda5ac676cef5f
push id11299
push userneil@parkwaycc.co.uk
push dateSun, 27 Sep 2015 22:56:02 +0000
treeherdercomm-central@884d1267eff3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty
bugs1204513
Bug 1204513 DOM Full Screen should be really full screen r=Ratty a=Ratty for checkin to a CLOSED TREE
suite/browser/fullScreen.js
suite/browser/navigator.xul
--- a/suite/browser/fullScreen.js
+++ b/suite/browser/fullScreen.js
@@ -16,27 +16,40 @@ var FullScreen =
     if (show)
       toolbox.removeAttribute("inFullscreen");
     else
       toolbox.setAttribute("inFullscreen", true);
 
     var controls = document.getElementsByAttribute("fullscreencontrol", "true");
     for (let i = 0; i < controls.length; ++i)
       controls[i].hidden = show;
+
+    controls = document.getElementsByAttribute("domfullscreenhidden", "true");
+    if (document.mozFullScreen) {
+      for (let i = 0; i < controls.length; ++i)
+        controls[i].setAttribute("moz-collapsed", "true");
+      getBrowser().mStrip.setAttribute("moz-collapsed", "true");
+    } else {
+      for (let i = 0; i < controls.length; ++i)
+        controls[i].removeAttribute("moz-collapsed");
+      getBrowser().mStrip.removeAttribute("moz-collapsed");
+    }
+    getBrowser().getNotificationBox().notificationsHidden = document.mozFullScreen;
   },
 
   showXULChrome: function(aTag, aShow)
   {
     var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     var els = document.getElementsByTagNameNS(XULNS, aTag);
 
     var i;
     for (i = 0; i < els.length; ++i) {
       // XXX don't interfere with previously collapsed toolbars
-      if (els[i].getAttribute("fullscreentoolbar") == "true") {
+      if (els[i].getAttribute("fullscreentoolbar") == "true" &&
+          !document.mozFullScreen) {
         if (!aShow) {
           var toolbarMode = els[i].getAttribute("mode");
           if (toolbarMode != "text") {
             els[i].setAttribute("saved-mode", toolbarMode);
             els[i].setAttribute("saved-iconsize",
                                 els[i].getAttribute("iconsize"));
             els[i].setAttribute("mode", "icons");
             els[i].setAttribute("iconsize", "small");
@@ -54,16 +67,17 @@ var FullScreen =
           els[i].setAttribute("inFullscreen", true);
         }
         else {
           this.restoreAttribute(els[i], "mode");
           this.restoreAttribute(els[i], "iconsize");
           this.restoreAttribute(els[i], "context"); // XXX see above
 
           els[i].removeAttribute("inFullscreen");
+          els[i].removeAttribute("moz-collapsed");
         }
       } else if (els[i].getAttribute("type") == "menubar") {
         if (aShow) {
           this.restoreAttribute(els[i], "autohide");
         }
         else {
           els[i].setAttribute("saved-autohide",
                               els[i].getAttribute("autohide"));
--- a/suite/browser/navigator.xul
+++ b/suite/browser/navigator.xul
@@ -472,21 +472,21 @@
       </toolbaritem>
 
       <!-- see utilityOverlay.xul -->
       <toolbarbutton id="sync-button"/>
     </toolbarpalette>
   </toolbox>
 
   <hbox flex="1">
-    <vbox id="sidebar-box" class="chromeclass-extrachrome"/>
-    <splitter id="sidebar-splitter" class="chromeclass-extrachrome" />
+    <vbox id="sidebar-box" class="chromeclass-extrachrome" domfullscreenhidden="true"/>
+    <splitter id="sidebar-splitter" class="chromeclass-extrachrome" domfullscreenhidden="true"/>
 
     <vbox id="appcontent" flex="1">
-      <findbar id="FindToolbar" browserid="content"/>
+      <findbar id="FindToolbar" browserid="content" domfullscreenhidden="true"/>
 
       <!-- this box is temporary, pending XBLified <browser> -->
       <hbox id="browser" flex="1">
         <tabbrowser id="content"
                     flex="1" contenttooltip="aHTMLTooltip"
                     contentcontextmenu="contentAreaContextMenu"
                     onnewtab="BrowserOpenTab();"
                     onnewtabclick="checkForMiddleClick(this, event);"