Bug 1519950, change test_bug199692.xul to use getBoundingClientRect instead of box object properties. This test is one where the box object coordinates do not return the same values as getBoundingClientRect, due to a 'position: relative' parent. The test likely worked coincidentally, but the correct coordinates returned by getBoundingClientRect work as well, r=paolo
authorNeil Deakin <neil@mozilla.com>
Fri, 15 Feb 2019 15:25:21 -0500
changeset 459650 d576a84575c4763024514aa479a40fa5e7ce6114
parent 459649 b23892c07b8591cb99262bac3d97719c537036b0
child 459651 75b0a937397c76253bd72bfe1d548d842b81066d
push id35564
push userccoroiu@mozilla.com
push dateSat, 16 Feb 2019 09:37:16 +0000
treeherdermozilla-central@7ab4a0c9980f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo
bugs1519950, 199692
milestone67.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 1519950, change test_bug199692.xul to use getBoundingClientRect instead of box object properties. This test is one where the box object coordinates do not return the same values as getBoundingClientRect, due to a 'position: relative' parent. The test likely worked coincidentally, but the correct coordinates returned by getBoundingClientRect work as well, r=paolo
dom/xul/test/test_bug199692.xul
--- a/dom/xul/test/test_bug199692.xul
+++ b/dom/xul/test/test_bug199692.xul
@@ -42,30 +42,30 @@ xmlns="http://www.mozilla.org/keymaster/
   SimpleTest.waitForExplicitFinish();
 
   // Before onload, XUL docs have no root frame.
   is(document.elementFromPoint(10,10), null,
      "Calls to elementFromPoint before onload should return null");
 
   var d = 10;
   function middle(e) {
-    return { "x": e.boxObject.x + e.boxObject.width/2,
-             "y": e.boxObject.y + e.boxObject.height/2 };
+    return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width/2,
+             "y": e.getBoundingClientRect().y + e.getBoundingClientRect().height/2 };
   }
   function lower_right(e) {
-    return { "x": e.boxObject.x + e.boxObject.width - d,
-             "y": e.boxObject.y + e.boxObject.height - d };
+    return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width - d,
+             "y": e.getBoundingClientRect().y + e.getBoundingClientRect().height - d };
   }
   function upper_left(e) {
-    return { "x": e.boxObject.x + d,
-             "y": e.boxObject.y + d };
+    return { "x": e.getBoundingClientRect().x + d,
+             "y": e.getBoundingClientRect().y + d };
   }
   function scrollbar_button(e) { // a bit down from upper right
-    return { "x": e.boxObject.x + e.boxObject.width - d,
-             "y": e.boxObject.y + d + 15 };
+    return { "x": e.getBoundingClientRect().x + e.getBoundingClientRect().width - d,
+             "y": e.getBoundingClientRect().y + d + 15 };
   }
   
   function test(ptFunc, id, message) {
     var pt = ptFunc($(id));
     var e = document.elementFromPoint(pt.x, pt.y);
     ok(e != null, message + " (returned null)");
     is(e.id, id, message);
   }