Bug 1264988 - Scrollbar flickers in the Awesomebar results list. r=Paolo
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 21 Jul 2017 19:01:08 +0200
changeset 419339 07052313bf75f6a1fd9f460f146b998824302d64
parent 419338 bfdd14469c9906eaa81c7d6a62ec7525aa109456
child 419340 bd140659a6b7739cb9cef76a01ceec1a749c2e4a
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersPaolo
bugs1264988
milestone56.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 1264988 - Scrollbar flickers in the Awesomebar results list. r=Paolo We never want scrollbars in the urlbar autocomplete, thus: 1. Always have maxResults == maxRows 2. force overflow: hidden on the richlistbox scrollbox MozReview-Commit-ID: ApA6TcuioUd
browser/base/content/browser.css
browser/base/content/browser.xul
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -586,16 +586,22 @@ html|input.urlbar-input[textoverflow]:no
 
 /* For non-action items, hide the action text; for action items, hide the URL
    text. */
 .ac-url[actiontype],
 .ac-action:not([actiontype]) {
   display: none;
 }
 
+/* Never show a scrollbar for the Location Bar popup.  This overrides the
+   richlistbox inline overflow: auto style.*/
+#PopupAutoCompleteRichResult > richlistbox > scrollbox {
+  overflow: hidden !important;
+}
+
 /* For action items in a noactions popup, show the URL text and hide the action
    text and type icon. */
 #PopupAutoCompleteRichResult[noactions] > richlistbox > richlistitem.overridable-action > .ac-url {
   display: -moz-box;
 }
 #PopupAutoCompleteRichResult[noactions] > richlistbox > richlistitem.overridable-action > .ac-action {
   display: none;
 }
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -803,17 +803,16 @@
                      autocompletesearchparam="enable-actions"
                      autocompletepopup="PopupAutoCompleteRichResult"
                      completeselectedindex="true"
                      shrinkdelay="250"
                      tabscrolling="true"
                      showcommentcolumn="true"
                      showimagecolumn="true"
                      enablehistory="true"
-                     maxrows="10"
                      newlines="stripsurroundingwhitespace"
                      ontextentered="this.handleCommand(param);"
                      ontextreverted="return this.handleRevert();"
                      pageproxystate="invalid">
               <!-- Use onclick instead of normal popup= syntax since the popup
                    code fires onmousedown, and hence eats our favicon drag events. -->
               <box id="identity-box" role="button"
                    align="center"
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -176,16 +176,22 @@ file, You can obtain one at http://mozil
 
       <!--
         For performance reasons we want to limit the size of the text runs we
         build and show to the user.
       -->
       <field name="textRunsMaxLen">255</field>
 
       <!--
+        Since we never want scrollbars, we always use the maxResults value.
+      -->
+      <property name="maxRows"
+                onget="return this.popup.maxResults;"/>
+
+      <!--
         onBeforeValueGet is called by the base-binding's .value getter.
         It can return an object with a "value" property, to override the
         return value of the getter.
       -->
       <method name="onBeforeValueGet">
         <body><![CDATA[
           return { value: this._value };
         ]]></body>
@@ -1086,16 +1092,18 @@ file, You can obtain one at http://mozil
                 delete this._whichSearchSuggestionsNotification;
                 break;
               case "trimURLs":
                 this._mayTrimURLs = this._prefs.getBoolPref(aData);
                 break;
               case "oneOffSearches":
                 this._enableOrDisableOneOffSearches();
                 break;
+              case "maxRichResults":
+                this.popup.maxResults = this._prefs.getIntPref(aData);
             }
           }
         ]]></body>
       </method>
 
       <method name="_enableOrDisableOneOffSearches">
         <body><![CDATA[
           let enable = this._prefs.getBoolPref("oneOffSearches");
@@ -1783,20 +1791,17 @@ file, You can obtain one at http://mozil
           ]]>
         </getter>
       </property>
 
       <property name="maxResults">
         <getter>
           <![CDATA[
             if (!this._maxResults) {
-              var prefService =
-                Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(Components.interfaces.nsIPrefBranch);
-              this._maxResults = prefService.getIntPref("browser.urlbar.maxRichResults");
+              this._maxResults = Services.prefs.getIntPref("browser.urlbar.maxRichResults");
             }
             return this._maxResults;
           ]]>
         </getter>
         <setter>
           <![CDATA[
             return this._maxResults = parseInt(val);
           ]]>