Bug 1266375 - Don't remove max-width on awesomebar popup items when the popup is open. r=mak a=ritu
authorDrew Willcoxon <adw@mozilla.com>
Tue, 26 Apr 2016 12:46:42 -0700
changeset 332680 71cb9d0e996865864f0b92e09abbbd5283d5982d
parent 332679 1a4d0996f35f80b225ed6368ec21f389991e93d5
child 332681 0b8f7132ed6dd7bcdadcc7a951393664ea95791a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, ritu
bugs1266375
milestone48.0a2
Bug 1266375 - Don't remove max-width on awesomebar popup items when the popup is open. r=mak a=ritu MozReview-Commit-ID: GttGOvRU6vf
browser/base/content/browser.css
browser/base/content/urlbarBindings.xml
toolkit/content/widgets/autocomplete.xml
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -460,26 +460,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,17 @@ 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;
+          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");