Backed out changeset a09ad974b522 (bug 1276107)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 02 Jun 2016 22:54:31 +0200
changeset 339269 7093be1d222f3270c94482cc8d7d23ee113dd390
parent 339268 2529d7543c234bc34693e41621edb9bff7b80d37
child 339270 cce3db98c4f4524a169ab4ac0e1d9153174206f1
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1276107
milestone49.0a1
backs outa09ad974b522416a6ef787463511797a69272033
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
Backed out changeset a09ad974b522 (bug 1276107)
gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html
--- a/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
@@ -236,28 +236,8 @@ function synthesizeNativeMouseEvent(aEle
 function synthesizeNativeClick(aElement, aX, aY, aObserver = null) {
   var pt = coordinatesRelativeToScreen(aX, aY, aElement);
   var utils = SpecialPowers.getDOMWindowUtils(aElement.ownerDocument.defaultView);
   utils.sendNativeMouseEvent(pt.x, pt.y, nativeMouseDownEventMsg(), 0, aElement, function() {
     utils.sendNativeMouseEvent(pt.x, pt.y, nativeMouseUpEventMsg(), 0, aElement, aObserver);
   });
   return true;
 }
-
-// Move the mouse to (dx, dy) relative to |element|, and scroll the wheel
-// at that location.
-// Moving the mouse is necessary to avoid wheel events from two consecutive
-// scrollWheelOver() calls on different elements being incorreclty considered
-// as part of t he same wheel transaction.
-// We also wait for the mouse move event to be processed before sending the
-// wheel event, otherwise there is a chance they might get reordered, and
-// we have the transaction problem again.
-// XXX FOOTGUN: On Windows, if the mouse cursor is already at the target
-//              position, the mouse-move event doesn't get dispatched, and
-//              we end up hanging waiting for it. As a result, care must
-//              be taken that the mouse isn't already at the target position
-//              when using this function.
-function moveMouseAndScrollWheelOver(element, dx, dy, testDriver) {
-  return synthesizeNativeMouseMoveAndWaitForMoveEvent(element, dx, dy, function() {
-    synthesizeNativeWheelAndWaitForScrollEvent(element, dx, dy, 0, -10, testDriver);
-  });
-}
-
--- a/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html
+++ b/gfx/layers/apz/test/mochitest/helper_scroll_on_position_fixed.html
@@ -1,54 +1,68 @@
 <head>
   <meta name="viewport" content="width=device-width; initial-scale=1.0">
   <title>Wheel-scrolling over position:fixed and position:sticky elements, in the top-level document as well as iframes</title>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
   <script type="application/javascript">
 
+// Scroll the mouse wheel at (dx, dy) relative to |element|.
+function scrollWheelOver(element, dx, dy, testDriver) {
+  // Move the mouse to the desired wheel location.
+  // Not doing so can result in the wheel events from two consecutive
+  // scrollWheelOver() calls on different elements being incorrectly considered
+  // as part of the same wheel transaction.
+  // We also wait for the mouse move event to be processed before sending the
+  // wheel event, otherwise there is a chance they might get reordered, and
+  // we have the transaction problem again.
+  return synthesizeNativeMouseMoveAndWaitForMoveEvent(element, dx, dy, function() {
+    synthesizeNativeWheelAndWaitForScrollEvent(element, dx, dy, 0, -10, testDriver);
+  });
+}
+
 function* test(testDriver) {
   var iframeWin = document.getElementById('iframe').contentWindow;
 
   // scroll over the middle of the iframe's position:sticky element, check
   // that it scrolls the iframe
   var scrollPos = iframeWin.scrollY;
-  yield moveMouseAndScrollWheelOver(iframeWin.document.body, 50, 150, testDriver);
+  yield scrollWheelOver(iframeWin.document.body, 50, 150, testDriver);
   ok(iframeWin.scrollY > scrollPos, "iframe scrolled after wheeling over the position:sticky element");
 
   // same, but using the iframe's position:fixed element
   scrollPos = iframeWin.scrollY;
-  yield moveMouseAndScrollWheelOver(iframeWin.document.body, 250, 150, testDriver);
+  yield scrollWheelOver(iframeWin.document.body, 250, 150, testDriver);
   ok(iframeWin.scrollY > scrollPos, "iframe scrolled after wheeling over the position:fixed element");
 
   // same, but scrolling the scrollable frame *inside* the position:fixed item
   var fpos = document.getElementById('fpos_scrollable');
   scrollPos = fpos.scrollTop;
-  yield moveMouseAndScrollWheelOver(fpos, 50, 150, testDriver);
+  yield scrollWheelOver(fpos, 50, 150, testDriver);
   ok(fpos.scrollTop > scrollPos, "scrollable item inside fixed-pos element scrolled");
   // wait for it to layerize fully and then try again
   yield waitForAllPaints(function() {
     flushApzRepaints(testDriver);
   });
   scrollPos = fpos.scrollTop;
-  // The mouse is already at the right position. If we call moveMouseAndScrollWheelOver it
+  // The mouse is already at the right position. If we call scrollWheelOver it
   // hangs on windows waiting for the mouse-move, so instead we just synthesize
   // the wheel directly.
   yield synthesizeNativeWheelAndWaitForScrollEvent(fpos, 50, 150, 0, -10, testDriver);
   ok(fpos.scrollTop > scrollPos, "scrollable item inside fixed-pos element scrolled after layerization");
 
   // same, but using the top-level window's position:sticky element
   scrollPos = window.scrollY;
-  yield moveMouseAndScrollWheelOver(document.body, 50, 150, testDriver);
+  yield scrollWheelOver(document.body, 50, 150, testDriver);
   ok(window.scrollY > scrollPos, "top-level document scrolled after wheeling over the position:sticky element");
 
   // same, but using the top-level window's position:fixed element
   scrollPos = window.scrollY;
-  yield moveMouseAndScrollWheelOver(document.body, 250, 150, testDriver);
+  yield scrollWheelOver(document.body, 250, 150, testDriver);
   ok(window.scrollY > scrollPos, "top-level document scrolled after wheeling over the position:fixed element");
 }
 
 waitUntilApzStable()
 .then(runContinuation(test))
 .then(subtestDone);
 
   </script>