Bug 1364387 - Ignore spurious overflow event from the anonymous div containing the placeholder text. r?jaws draft
authorDão Gottwald <dao@mozilla.com>
Fri, 19 May 2017 07:40:08 +0200
changeset 580954 a55cddd8ac8c6c156551108d7181a1e6421abc9e
parent 580912 8e98dab5054dd093a37ba20c62cf0523e484cfbd
child 629440 24d6ba25ce4a66c6a5a44328a3842acc697a8548
push id59722
push userdgottwald@mozilla.com
push dateFri, 19 May 2017 05:40:49 +0000
reviewersjaws
bugs1364387
milestone55.0a1
Bug 1364387 - Ignore spurious overflow event from the anonymous div containing the placeholder text. r?jaws This event made us initially fade out the URL bar text in new windows despite the text not overflowing the textbox. This is more visible in RTL builds as we right-align the URL bar value there. MozReview-Commit-ID: IfLzQBhDXDt
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1012,16 +1012,21 @@ file, You can obtain one at http://mozil
               break;
             case "mousemove":
               this._initURLTooltip();
               break;
             case "mouseout":
               this._hideURLTooltip();
               break;
             case "overflow":
+              if (!this.value) {
+                // We initially get a spurious overflow event from the
+                // anonymous div containing the placeholder text; bail out.
+                break;
+              }
               this.setAttribute("textoverflow", "true");
               break;
             case "underflow":
               this.removeAttribute("textoverflow");
               this._hideURLTooltip();
               break;
           }
         ]]></body>