Backed out changeset 76ccb62dd14d (bug 1480349) for bc failures on browser_urlbar_search.js a=backout
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Thu, 30 Aug 2018 14:04:09 +0300
changeset 489171 815b46ed1182
parent 489170 09de350001f0
child 489172 9a9cc00a4a7d
child 489179 71a191217b28
child 489216 79c1369cb433
push id9738
push useraciure@mozilla.com
push dateMon, 03 Sep 2018 16:13:51 +0000
treeherdermozilla-beta@f5841408a66c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1480349
milestone63.0a1
backs out76ccb62dd14d
first release with
nightly linux32
815b46ed1182 / 63.0a1 / 20180830111745 / files
nightly linux64
815b46ed1182 / 63.0a1 / 20180830111745 / files
nightly mac
815b46ed1182 / 63.0a1 / 20180830111745 / files
nightly win32
815b46ed1182 / 63.0a1 / 20180830111745 / files
nightly win64
815b46ed1182 / 63.0a1 / 20180830111745 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 76ccb62dd14d (bug 1480349) for bc failures on browser_urlbar_search.js a=backout
browser/base/content/test/urlbar/browser_urlbarAddonIframe.js
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/test/urlbar/browser_urlbarAddonIframe.js
+++ b/browser/base/content/test/urlbar/browser_urlbarAddonIframe.js
@@ -1,11 +1,9 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
+/* eslint-disable mozilla/no-arbitrary-setTimeout */
 "use strict";
 
 // The purpose of this test is to test the urlbar popup's add-on iframe.  It has
 // a few parts:
 //
 // (1) This file, a normal browser mochitest.
 // (2) html/js files that are loaded in the urlbar popup's add-on iframe:
 //     urlbarAddonIframe.{html,js}
@@ -130,24 +128,23 @@ add_task(async function() {
   // urlbar.getPanelHeight
   let height = iframe.getBoundingClientRect().height;
   let readHeight = await promiseUrlbarFunctionCall("getPanelHeight");
   Assert.equal(readHeight, height, "getPanelHeight");
 
   // urlbar.setPanelHeight
   let newHeight = height + 100;
   await promiseUrlbarFunctionCall("setPanelHeight", newHeight);
-  // The height change is animated, so give it time to complete.
-  await TestUtils.waitForCondition(
-    () => Math.round(iframe.getBoundingClientRect().height) == newHeight,
-    "Wait for panel height change after setPanelHeight"
-  ).catch(ex => {
-    info("Last detected height: " + Math.round(iframe.getBoundingClientRect().height));
-    throw ex;
+  await new Promise(resolve => {
+    // The height change is animated, so give it time to complete.  Again, wait
+    // a sec to be safe.
+    setTimeout(resolve, 1000);
   });
+  Assert.equal(iframe.getBoundingClientRect().height, newHeight,
+               "setPanelHeight");
 });
 
 function promiseIframeLoad() {
   let msgName = "TestIframeLoadAck";
   return new Promise(resolve => {
     info("Waiting for iframe load ack");
     gMsgMan.addMessageListener(msgName, function onMsg(msg) {
       info("Received iframe load ack");
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -88,17 +88,16 @@ file, You can obtain one at http://mozil
         this.inputField.controllers.insertControllerAt(0, this._copyCutController);
         this.inputField.addEventListener("paste", this);
         this.inputField.addEventListener("mousedown", this);
         this.inputField.addEventListener("mousemove", this);
         this.inputField.addEventListener("mouseout", this);
         this.inputField.addEventListener("overflow", this);
         this.inputField.addEventListener("underflow", this);
         this.inputField.addEventListener("scrollend", this);
-        window.addEventListener("resize", this);
 
         var textBox = document.getAnonymousElementByAttribute(this,
                                                 "anonid", "moz-input-box");
         // Force the Custom Element to upgrade until Bug 1470242 handles this:
         customElements.upgrade(textBox);
         var cxmenu = textBox.menupopup;
         var pasteAndGo;
         cxmenu.addEventListener("popupshowing", function() {
@@ -154,17 +153,16 @@ file, You can obtain one at http://mozil
         this.inputField.controllers.removeController(this._copyCutController);
         this.inputField.removeEventListener("paste", this);
         this.inputField.removeEventListener("mousedown", this);
         this.inputField.removeEventListener("mousemove", this);
         this.inputField.removeEventListener("mouseout", this);
         this.inputField.removeEventListener("overflow", this);
         this.inputField.removeEventListener("underflow", this);
         this.inputField.removeEventListener("scrollend", this);
-        window.removeEventListener("resize", this);
 
         if (this._deferredKeyEventTimeout) {
           clearTimeout(this._deferredKeyEventTimeout);
           this._deferredKeyEventTimeout = null;
         }
 
         // Null out the one-offs' popup and textbox so that it cleans up its
         // internal state for both.  Most importantly, it removes the event
@@ -508,51 +506,36 @@ file, You can obtain one at http://mozil
         <body><![CDATA[
           // This method must not modify the given URL such that calling
           // nsIURIFixup::createFixupURI with the result will produce a different URI.
           return this._mayTrimURLs ? trimURL(aURL) : aURL;
         ]]></body>
       </method>
 
       <field name="_formattingEnabled">true</field>
-
-      <!--
-        If the input value is a URL, the input is not focused, and formatting is
-        enabled, this method highlights the domain, and if mixed content is
-        present, it crosses out the https scheme.  It also ensures that the host
-        is visible (not scrolled out of sight).  Otherwise it removes formatting.
-
-        @param  onlyEnsureFormattedHostVisible
-                Pass true to skip formatting and instead only ensure that the
-                host is visible.
-      -->
       <method name="formatValue">
-        <parameter name="onlyEnsureFormattedHostVisible"/>
         <body><![CDATA[
           // Used to avoid re-entrance in async callbacks.
           let instance = this._formattingInstance = {};
 
           if (!this.editor)
             return;
 
+          // Cleanup previously set styles.
+          this.scheme.value = "";
           let controller, strikeOut, selection;
-
-          if (!onlyEnsureFormattedHostVisible) {
-            // Cleanup previously set styles.
-            this.scheme.value = "";
-            if (this._formattingEnabled) {
-              controller = this.editor.selectionController;
-              strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT);
-              strikeOut.removeAllRanges();
-              selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
-              selection.removeAllRanges();
-              this.formatScheme(controller.SELECTION_URLSTRIKEOUT, true);
-              this.formatScheme(controller.SELECTION_URLSECONDARY, true);
-              this.inputField.style.setProperty("--urlbar-scheme-size", "0px");
-            }
+          if (this._formattingEnabled) {
+            controller = this.editor.selectionController;
+            strikeOut = controller.getSelection(controller.SELECTION_URLSTRIKEOUT);
+            strikeOut.removeAllRanges();
+            selection = controller.getSelection(controller.SELECTION_URLSECONDARY);
+            selection.removeAllRanges();
+            this.formatScheme(controller.SELECTION_URLSTRIKEOUT, true);
+            this.formatScheme(controller.SELECTION_URLSECONDARY, true);
+            this.inputField.style.setProperty("--urlbar-scheme-size", "0px");
           }
 
           let textNode = this.editor.rootElement.firstChild;
           let value = textNode.textContent;
           if (!value)
             return;
 
           if (this.focused)
@@ -611,17 +594,17 @@ file, You can obtain one at http://mozil
             // char just after the domain, and in such a case we should not
             // scroll to the left.
             if (directionality == window.windowUtils.DIRECTION_RTL &&
                 value[preDomain.length + domain.length] != "\u200E") {
               this.inputField.scrollLeft = this.inputField.scrollLeftMax;
             }
           });
 
-          if (onlyEnsureFormattedHostVisible || !this._formattingEnabled)
+          if (!this._formattingEnabled)
             return;
 
           this.formatScheme(controller.SELECTION_URLSECONDARY);
 
           // Strike out the "https" part if mixed active content is loaded.
           if (this.getAttribute("pageproxystate") == "valid" &&
               value.startsWith("https:") &&
               gBrowser.securityUI.state &
@@ -1446,39 +1429,16 @@ file, You can obtain one at http://mozil
               this.updateTextOverflow();
               break;
             case "TabSelect":
               // The autocomplete controller uses heuristic on some internal caches
               // to handle cases like backspace, autofill or repeated searches.
               // Ensure to clear those internal caches when switching tabs.
               this.controller.resetInternalState();
               break;
-            case "resize":
-              // Make sure the host remains visible in the input field when the
-              // window is resized.  We don't want to hurt resize performance,
-              // though, so do this only after resize events have stopped and a
-              // small timeout has elapsed.
-              if (aEvent.target == window) {
-                if (this._resizeThrottleTimeout) {
-                  clearTimeout(this._resizeThrottleTimeout);
-                }
-                this._resizeThrottleTimeout = setTimeout(() => {
-                  this._resizeThrottleTimeout = null;
-
-                  // Close the popup since it would be wrongly sized, we'll
-                  // recalculate a proper size on reopening. For example, this
-                  // may happen when using special OS resize functions like
-                  // Win+Arrow.
-                  this.closePopup();
-
-                  // Make the host visible via formatValue.
-                  this.formatValue(true);
-                }, 100);
-              }
-              break;
           }
         ]]></body>
       </method>
 
       <method name="updateTextOverflow">
         <body><![CDATA[
           if (this._inOverflow) {
             window.promiseDocumentFlushed(() => {