Merge mozilla-central to autoland. a=merge CLOSED TREE
authorTiberius Oros <toros@mozilla.com>
Thu, 09 Aug 2018 09:25:15 +0300
changeset 430594 eb9ff7de69efb6486f86656c6fe4b013b27910e4
parent 430593 3202d623ead82c71bb1790ecfc5c3d99493d2e1e (current diff)
parent 430536 056a3c3fcc42cf5e22bfa979b0390b3d88d83b65 (diff)
child 430750 f650c0df72f9f1dc616bb1510a36f894400e8b84
child 430751 18573457af6ac5b1f928bccdd7a9f01b5dccc3b8
push id34409
push usertoros@mozilla.com
push dateThu, 09 Aug 2018 10:00:05 +0000
treeherdermozilla-central@eb9ff7de69ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone63.0a1
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
Merge mozilla-central to autoland. a=merge CLOSED TREE
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
@@ -1415,35 +1413,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":
-              // Throttle resize handling for performance reasons.
-              if (aEvent.target == window && !this._resizeThrottleTimeout) {
-                this._resizeThrottleTimeout = setTimeout(() => {
-                  window.requestAnimationFrame(() => {
-                    delete this._resizeThrottleTimeout;
-
-                    // 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();
-
-                    // Ensure the host remains visible when the input field is not
-                    // focused.
-                    this.formatValue();
-                  });
-                }, 30);
-              }
-              break;
           }
         ]]></body>
       </method>
 
       <method name="updateTextOverflow">
         <body><![CDATA[
           if (this._inOverflow) {
             window.promiseDocumentFlushed(() => {