Bug 1264988 - Scrollbar flickers in the Awesomebar results list. r=paolo draft
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 21 Jul 2017 19:01:08 +0200
changeset 614492 a7e8bec161d1ba2b2642ee2425337fa64b253b59
parent 614015 5928d905c0bc0b28f5488b236444c7d7991cf8d4
child 638874 b359ea8c38fbf0747dd3e0973b2231ea5a193b26
push id70022
push usermak77@bonardo.net
push dateMon, 24 Jul 2017 16:31:03 +0000
reviewerspaolo
bugs1264988
milestone56.0a1
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);
           ]]>