Bug 1218456 - Remove now-unneeded workarounds in cross-origin navigation tests. r=smaug
☠☠ backed out by 8fda1a51f2c9 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 09 Jul 2019 16:18:54 +0000
changeset 481942 60e865d21df584c61d07fa7119196bfd2932b1c7
parent 481941 8bd57ebc4528289fe16c76e0869762c40a36b446
child 481943 c52f1a86dc468a34a267ec41bf182c853bea1245
push id113647
push useraciure@mozilla.com
push dateWed, 10 Jul 2019 09:46:39 +0000
treeherdermozilla-inbound@f3a387c13e2c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1218456
milestone70.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 1218456 - Remove now-unneeded workarounds in cross-origin navigation tests. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D37425
dom/html/test/file_iframe_sandbox_d_if11.html
dom/html/test/file_iframe_sandbox_e_if5.html
--- a/dom/html/test/file_iframe_sandbox_d_if11.html
+++ b/dom/html/test/file_iframe_sandbox_d_if11.html
@@ -4,28 +4,17 @@
   <meta charset="utf-8">
   <title>Test for Bug 341604</title>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script src="/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <script type="application/javascript">
 
 function navigateAway() {
-  // Anchor clicks are only handled if we have a pres-context, and we may not
-  // have one yet by the time this runs, and getBoundingClientRect() won't
-  // construct it after bug 1440537.
-  //
-  // So we may need to wait a few frames to make this reliable.
-  //
-  // FIXME(emilio, bug 1218456): This dance shouldn't be needed.
-  let anchor = document.getElementById("anchor");
-  if (anchor.getBoundingClientRect().width > 0)
-    anchor.click();
-  else
-    requestAnimationFrame(navigateAway);
+  document.getElementById("anchor").click();
 }
 
 function doTest() {
   try {
     // this should fail the first time, but work the second
     window.parent.ok_wrapper(true, "a document that was loaded, navigated to another document, had 'allow-same-origin' added and then was" +
       " navigated back should be same-origin with its parent");
   } catch (e) {
--- a/dom/html/test/file_iframe_sandbox_e_if5.html
+++ b/dom/html/test/file_iframe_sandbox_e_if5.html
@@ -3,28 +3,17 @@
 <head>
   <meta charset="utf-8">
   <title>Test for Bug 341604</title>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <script src="/tests/SimpleTest/EventUtils.js"></script>
 </head>
 <script type="application/javascript">
 function navigateAway() {
-  // Anchor clicks are only handled if we have a pres-context, and we may not
-  // have one yet by the time this runs, and getBoundingClientRect() /
-  // sendMouseEvent won't construct it after bug 1440537.
-  //
-  // So we may need to wait a few frames to make this reliable.
-  //
-  // FIXME(emilio, bug 1218456): This dance shouldn't be needed.
-  let anchor = document.getElementById("anchor");
-  if (anchor.getBoundingClientRect().width > 0)
-    anchor.click();
-  else
-    requestAnimationFrame(navigateAway);
+  document.getElementById("anchor").click();
 }
 </script>
 <body onload="navigateAway()">
   I am sandboxed with 'allow-scripts and allow-top-navigation'
 
   <a href="file_iframe_sandbox_top_navigation_pass.html" target='_top' id='anchor'>Click me</a>
 </body>
 </html>