Bug 1547851 - Ensure we have a pres shell to send events to by the time load ends. r=mconley
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 02 May 2019 13:54:03 +0000
changeset 531123 a0cad7a2f14350c12ad6dba4ea1c50b2958dc442
parent 531122 8d9deb012066d4613e502c33a3a5d4678aadf528
child 531124 4294abed890fec277a09c1f66e1b4a3a2798bbd5
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1547851
milestone68.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
Bug 1547851 - Ensure we have a pres shell to send events to by the time load ends. r=mconley See the regressing bug for similar fixes that were needed in other tests. Differential Revision: https://phabricator.services.mozilla.com/D29648
dom/browser-element/mochitest/browserElement_SendEvent.js
--- a/dom/browser-element/mochitest/browserElement_SendEvent.js
+++ b/dom/browser-element/mochitest/browserElement_SendEvent.js
@@ -20,16 +20,18 @@ function runTest() {
   // iframe.getBoundingClientRect();
   // to refresh offsets and then calling
   // var remoteTab = SpecialPowers.wrap(iframe)
   //                .frameLoader.remoteTab;
   // and calling remoteTab.getChildProcessOffset(offsetX, offsetY) if
   // remoteTab was not null, but remoteTab was always null.
 
   iframe.addEventListener("mozbrowserloadend", function onloadend(e) {
+    // Ensure we lay out the iframe before sending mouse events.
+    iframe.getBoundingClientRect();
     iframe.sendMouseEvent("mousedown", x, y, 0, 1, 0);
   });
 
   iframe.addEventListener("mozbrowserlocationchange", function onlocchange(e) {
     var a = document.createElement("a");
     a.href = e.detail.url;
 
     switch (a.hash) {