Bug 1266375 - Don't remove max-width on awesomebar popup items when the popup is open. r?mak
MozReview-Commit-ID: GttGOvRU6vf
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -451,26 +451,26 @@ toolbar:not(#TabsToolbar) > #personal-bo
.ac-url-text:-moz-locale-dir(rtl) {
direction: ltr !important;
}
/* For non-action items, hide the action text; for action items, hide the URL
text. */
.ac-url[actiontype],
.ac-action:not([actiontype]) {
- visibility: collapse;
+ display: none;
}
/* 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 {
- visibility: visible;
+ display: -moz-box;
}
#PopupAutoCompleteRichResult[noactions] > richlistbox > richlistitem.overridable-action > .ac-action {
- visibility: collapse;
+ display: none;
}
#PopupAutoCompleteRichResult[noactions] > richlistbox > richlistitem.overridable-action > .ac-type-icon {
list-style-image: none;
}
#urlbar:not([actiontype="switchtab"]) > #urlbar-display-box {
display: none;
}
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1343,17 +1343,20 @@ file, You can obtain one at http://mozil
<parameter name="aInput"/>
<parameter name="aElement"/>
<body><![CDATA[
if (this.mPopupOpen) {
return;
}
this.mInput = aInput;
- this.selectedIndex = -1;
+
+ // Initialize the selected index.
+ this.selectedIndex = this._isFirstResultHeuristic ? 0 : -1;
+
this.view = aInput.controller.QueryInterface(Components.interfaces.nsITreeView);
this.invalidate();
var rect = window.document.documentElement.getBoundingClientRect();
var width = rect.right - rect.left;
this.setAttribute("width", width);
// Adjust the direction of the autocomplete popup list based on the textbox direction, bug 649840
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -1829,17 +1829,22 @@ extends="chrome://global/content/binding
return this._textToSubURI.unEscapeURIForUI("UTF-8", url);
]]>
</body>
</method>
<method name="_adjustAcItem">
<body>
<![CDATA[
- this._removeMaxWidths();
+ if (!this.parentNode.parentNode.popupOpen) {
+ // Removing the max-width and resetting it later when overflow is
+ // handled is jarring when the item is visible, so skip this when
+ // the popup is open.
+ this._removeMaxWidths();
+ }
let title = this.getAttribute("title");
let displayUrl;
let originalUrl = this.getAttribute("url");
let emphasiseUrl = true;
let type = this.getAttribute("type");