Bug 1636224 - Explicitly flush layout in an acceskey test. r=Gijs
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 07 May 2020 20:51:14 +0000
changeset 528688 695d8ba293ae09c196976b40e9dd4508b4046f56
parent 528687 a2abc7629ec4385b6d770ab6c993c6770a8df6fe
child 528689 876b8f443cca7bf6a41d2570f3bfce3d5ad0447a
push id37393
push userrmaries@mozilla.com
push dateFri, 08 May 2020 03:38:07 +0000
treeherdermozilla-central@ead8f0367372 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1636224
milestone78.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 1636224 - Explicitly flush layout in an acceskey test. r=Gijs Accesskey for XUL works from frame construction, so we need to do this for the test to keep passing with LazyFC. I don't think this has a user-visible impact in practice. Differential Revision: https://phabricator.services.mozilla.com/D74280
browser/base/content/test/general/browser_accesskeys.js
--- a/browser/base/content/test/general/browser_accesskeys.js
+++ b/browser/base/content/test/general/browser_accesskeys.js
@@ -27,16 +27,18 @@ add_task(async function() {
   // Add an element with an accesskey to the chrome and press its accesskey while the chrome is focused.
   let newButton = document.createXULElement("button");
   newButton.id = "chromebutton";
   newButton.setAttribute("accesskey", "z");
   document.documentElement.appendChild(newButton);
 
   Services.focus.clearFocus(window);
 
+  newButton.getBoundingClientRect(); // Accesskey registration happens during frame construction.
+
   focusedId = await performAccessKeyForChrome("z");
   is(focusedId, "chromebutton", "chromebutton accesskey");
 
   // Add a second tab and ensure that accesskey from the first tab is not used.
   const gPageURL2 =
     "data:text/html,<body>" +
     "<button id='tab2button' accesskey='y'>Button in Tab 2</button>" +
     "</body>";