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
--- 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);
]]>