Backed out changeset a6b130810bc4 (bug 1491252) for xpcshall failures in browser/components/urlbar/tests/unit/test_UrlbarInput_unit.js
authorNoemi Erli <nerli@mozilla.com>
Fri, 21 Sep 2018 19:47:17 +0300
changeset 437671 ec103090a314db31d320c37eaffc5dfa4532cb02
parent 437670 bbc04fd32d8e7d35c9310201cffa1cf1f43d1040
child 437672 a3f256bb12a265a3faaec636e2860ccb5cc286b4
push id108129
push usernerli@mozilla.com
push dateFri, 21 Sep 2018 16:47:31 +0000
treeherdermozilla-inbound@ec103090a314 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1491252
milestone64.0a1
backs outa6b130810bc42f125709fe40c2e26fe9f5f985f6
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset a6b130810bc4 (bug 1491252) for xpcshall failures in browser/components/urlbar/tests/unit/test_UrlbarInput_unit.js
browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -29,22 +29,21 @@ class UrlbarInput {
    *   The <panel> element.
    * @param {UrlbarController} [options.controller]
    *   Optional fake controller to override the built-in UrlbarController.
    *   Intended for use in unit tests only.
    */
   constructor(options = {}) {
     this.textbox = options.textbox;
     this.panel = options.panel;
-    this.window = this.textbox.ownerGlobal;
     this.controller = options.controller || new UrlbarController();
     this.view = new UrlbarView(this);
     this.valueIsTyped = false;
     this.userInitiatedFocus = false;
-    this.isPrivate = PrivateBrowsingUtils.isWindowPrivate(this.window);
+    this.isPrivate = PrivateBrowsingUtils.isWindowPrivate(this.panel.ownerGlobal);
 
     const METHODS = ["addEventListener", "removeEventListener",
       "setAttribute", "hasAttribute", "removeAttribute", "getAttribute",
       "focus", "blur", "select"];
     const READ_ONLY_PROPERTIES = ["focused", "inputField", "editor"];
     const READ_WRITE_PROPERTIES = ["value", "placeholder", "readOnly",
       "selectionStart", "selectionEnd"];
 
@@ -71,19 +70,16 @@ class UrlbarInput {
         },
         set(val) {
           return this.textbox[property] = val;
         },
       });
     }
 
     this.addEventListener("input", this);
-    this.inputField.addEventListener("overflow", this);
-    this.inputField.addEventListener("underflow", this);
-    this.inputField.addEventListener("scrollend", this);
   }
 
   formatValue() {
   }
 
   closePopup() {
     this.view.close();
   }
@@ -103,65 +99,18 @@ class UrlbarInput {
       this[methodName](event);
     } else {
       throw "Unrecognized urlbar event: " + event.type;
     }
   }
 
   // Private methods below.
 
-  _updateTextOverflow() {
-    if (!this._inOverflow) {
-      this.removeAttribute("textoverflow");
-      return;
-    }
-
-    this.window.promiseDocumentFlushed(() => {
-      // Check overflow again to ensure it didn't change in the meantime.
-      let input = this.inputField;
-      if (input && this._inOverflow) {
-        let side = input.scrollLeft &&
-                   input.scrollLeft == input.scrollLeftMax ? "start" : "end";
-        this.setAttribute("textoverflow", side);
-      }
-    });
-  }
-
-  // Event handlers below.
-
   _oninput(event) {
     // XXX Fill in lastKey & maxResults, and add anything else we need.
     this.controller.handleQuery(new QueryContext({
       searchString: event.target.value,
       lastKey: "",
       maxResults: 12,
       isPrivate: this.isPrivate,
     }));
   }
-
-  _onoverflow(event) {
-    const targetIsPlaceholder =
-      !event.originalTarget.classList.contains("anonymous-div");
-    // We only care about the non-placeholder text.
-    // This shouldn't be needed, see bug 1487036.
-    if (targetIsPlaceholder) {
-      return;
-    }
-    this._inOverflow = true;
-    this._updateTextOverflow();
-  }
-
-  _onunderflow(event) {
-    const targetIsPlaceholder =
-      !event.originalTarget.classList.contains("anonymous-div");
-    // We only care about the non-placeholder text.
-    // This shouldn't be needed, see bug 1487036.
-    if (targetIsPlaceholder) {
-      return;
-    }
-    this._inOverflow = false;
-    this._updateTextOverflow();
-  }
-
-  _onscrollend(event) {
-    this._updateTextOverflow();
-  }
 }