Bug 1382588 - Hide scroll buttons and overflow indicators using display:none rather than visibility:collapse to avoid loading their image resources when they're not needed. r?johannh draft
authorDão Gottwald <dao@mozilla.com>
Fri, 11 Aug 2017 11:15:38 +0200
changeset 644697 8cb8fe7391b07b6bee96b951bcf0e63757280a5f
parent 644465 253a8560dc34456d2e8a13065e4b3eb5ecf6704f
child 725690 f80f63e40c55aa1ed31e6ec8f49ef38c4f2898a4
push id73524
push userdgottwald@mozilla.com
push dateFri, 11 Aug 2017 09:15:59 +0000
reviewersjohannh
bugs1382588
milestone57.0a1
Bug 1382588 - Hide scroll buttons and overflow indicators using display:none rather than visibility:collapse to avoid loading their image resources when they're not needed. r?johannh MozReview-Commit-ID: JKj8qPsW7my
browser/base/content/test/performance/browser_startup_images.js
toolkit/content/widgets/scrollbox.xml
--- a/browser/base/content/test/performance/browser_startup_images.js
+++ b/browser/base/content/test/performance/browser_startup_images.js
@@ -12,53 +12,47 @@
  *  - platforms: An array of the platforms where the issue is occurring.
  *               Possible values are linux, win, macosx.
  *  - intermittentNotLoaded: an array of platforms where this image is
  *                           intermittently not loaded, e.g. because it is
  *                           loaded during the time we stop recording.
  *  - intermittentShown: An array of platforms where this image is
  *                       intermittently shown, contrary to what our
  *                       whitelist says.
- *  - photon: If true, this entry only applies for builds with the Photon theme.
- *            If false, this entry only applies for builds without the Photon theme.
- *            If undefined, this entry applies for both Photon and non-Photon builds.
  *
  * Please don't add items to this list. Please remove items from this list.
  */
 const whitelist = [
-  // Photon-only entries
   {
     file: "chrome://browser/skin/stop.svg",
     platforms: ["linux", "win", "macosx"],
   },
   {
     file: "chrome://browser/skin/bookmark-hollow.svg",
     platforms: ["linux", "win", "macosx"],
   },
   {
     file: "chrome://browser/skin/page-action.svg",
     platforms: ["linux", "win", "macosx"],
   },
-
-  // Shared entries
   {
     file: "chrome://browser/skin/arrow-left.svg",
-    platforms: ["linux", "win", "macosx"],
+    platforms: ["linux", "macosx"],
   },
   {
     file: "chrome://browser/skin/arrow-dropdown-16.svg",
     platforms: ["linux", "win", "macosx"],
   },
   {
     file: "chrome://browser/skin/fxa/sync-illustration.svg",
     platforms: ["linux", "win", "macosx"],
   },
   {
     file: "chrome://browser/skin/tabbrowser/tab-overflow-indicator.png",
-    platforms: ["linux", "win", "macosx"],
+    platforms: ["linux", "macosx"],
   },
 
   {
     file: "chrome://browser/skin/places/toolbarDropMarker.png",
     platforms: ["linux", "win", "macosx"],
   },
   {
     file: "chrome://browser/skin/tracking-protection-16.svg#enabled",
--- a/toolkit/content/widgets/scrollbox.xml
+++ b/toolkit/content/widgets/scrollbox.xml
@@ -31,31 +31,31 @@
       </method>
     </implementation>
   </binding>
 
   <binding id="arrowscrollbox" extends="chrome://global/content/bindings/scrollbox.xml#scrollbox-base">
     <content>
       <xul:autorepeatbutton class="autorepeatbutton-up"
                             anonid="scrollbutton-up"
-                            xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtostart"
+                            xbl:inherits="orient,hidden=notoverflowing,disabled=scrolledtostart"
                             oncommand="_autorepeatbuttonScroll(event);"/>
       <xul:spacer class="arrowscrollbox-overflow-start-indicator"
-                  xbl:inherits="collapsed=scrolledtostart"/>
+                  xbl:inherits="hidden=scrolledtostart"/>
       <xul:scrollbox class="arrowscrollbox-scrollbox"
                      anonid="scrollbox"
                      flex="1"
                      xbl:inherits="orient,align,pack,dir,smoothscroll">
         <children/>
       </xul:scrollbox>
       <xul:spacer class="arrowscrollbox-overflow-end-indicator"
-                  xbl:inherits="collapsed=scrolledtoend"/>
+                  xbl:inherits="hidden=scrolledtoend"/>
       <xul:autorepeatbutton class="autorepeatbutton-down"
                             anonid="scrollbutton-down"
-                            xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtoend"
+                            xbl:inherits="orient,hidden=notoverflowing,disabled=scrolledtoend"
                             oncommand="_autorepeatbuttonScroll(event);"/>
     </content>
 
     <implementation>
       <constructor><![CDATA[
         if (!this.hasAttribute("smoothscroll")) {
           this.smoothScroll = this._prefBranch
                                   .getBoolPref("toolkit.scrollbox.smoothScroll", true);
@@ -599,35 +599,35 @@
     <content repeat="hover">
       <xul:image class="autorepeatbutton-icon"/>
     </content>
   </binding>
 
   <binding id="arrowscrollbox-clicktoscroll" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox">
     <content>
       <xul:toolbarbutton class="scrollbutton-up"
-                         xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtostart"
+                         xbl:inherits="orient,hidden=notoverflowing,disabled=scrolledtostart"
                          anonid="scrollbutton-up"
                          onclick="_distanceScroll(event);"
                          onmousedown="if (event.button == 0) _startScroll(-1);"
                          onmouseup="if (event.button == 0) _stopScroll();"
                          onmouseover="_continueScroll(-1);"
                          onmouseout="_pauseScroll();"/>
       <xul:spacer class="arrowscrollbox-overflow-start-indicator"
-                  xbl:inherits="collapsed=scrolledtostart"/>
+                  xbl:inherits="hidden=scrolledtostart"/>
       <xul:scrollbox class="arrowscrollbox-scrollbox"
                      anonid="scrollbox"
                      flex="1"
                      xbl:inherits="orient,align,pack,dir,smoothscroll">
         <children/>
       </xul:scrollbox>
       <xul:spacer class="arrowscrollbox-overflow-end-indicator"
-                  xbl:inherits="collapsed=scrolledtoend"/>
+                  xbl:inherits="hidden=scrolledtoend"/>
       <xul:toolbarbutton class="scrollbutton-down"
-                         xbl:inherits="orient,collapsed=notoverflowing,disabled=scrolledtoend"
+                         xbl:inherits="orient,hidden=notoverflowing,disabled=scrolledtoend"
                          anonid="scrollbutton-down"
                          onclick="_distanceScroll(event);"
                          onmousedown="if (event.button == 0) _startScroll(1);"
                          onmouseup="if (event.button == 0) _stopScroll();"
                          onmouseover="_continueScroll(1);"
                          onmouseout="_pauseScroll();"/>
     </content>
     <implementation implements="nsITimerCallback, nsIDOMEventListener">