Bug 1467260 - Ensure scrollframe activation is processed by APZ before doing hit-test checks. r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 12 Jun 2018 11:32:27 -0400
changeset 806885 6cc18b9e52ef7ea41dfdefad4711716594164b20
parent 806884 75a32b57132f8cba42779555662a057a0416a313
push id112978
push userkgupta@mozilla.com
push dateTue, 12 Jun 2018 15:33:01 +0000
reviewersbotond
bugs1467260
milestone62.0a1
Bug 1467260 - Ensure scrollframe activation is processed by APZ before doing hit-test checks. r?botond MozReview-Commit-ID: LBn9a9zb6fE
gfx/layers/apz/test/mochitest/helper_hittest_backface_hidden.html
gfx/layers/apz/test/mochitest/helper_hittest_basic.html
gfx/layers/apz/test/mochitest/helper_hittest_checkerboard.html
gfx/layers/apz/test/mochitest/helper_hittest_fixed_in_scrolled_transform.html
--- a/gfx/layers/apz/test/mochitest/helper_hittest_backface_hidden.html
+++ b/gfx/layers/apz/test/mochitest/helper_hittest_backface_hidden.html
@@ -44,17 +44,17 @@ function* test(testDriver) {
   var config = getHitTestConfig();
 
   var subframe = document.getElementById('front');
 
   // Set a displayport to ensure the subframe is layerized.
   // This is not required for exercising the behavior we want to test,
   // but it's needed to be able to assert the results reliably.
   config.utils.setDisplayPortForElement(0, 0, 1000, 1000, subframe, 1);
-  yield waitForAllPaints(testDriver);
+  yield waitForApzFlushedRepaints(testDriver);
 
   var subframeViewId = config.utils.getViewId(subframe);
 
   var {hitInfo, scrollId} = hitTest(centerOf(subframe));
 
   is(scrollId, subframeViewId,
      "hit the scroll frame behind the backface-visibility:hidden element");
 
--- a/gfx/layers/apz/test/mochitest/helper_hittest_basic.html
+++ b/gfx/layers/apz/test/mochitest/helper_hittest_basic.html
@@ -46,17 +46,17 @@ function* test(testDriver) {
     expectThumb: true,
     layerState: LayerState.INACTIVE
   });
 
   // activate the scrollframe but keep the main-thread scroll position at 0.
   // also apply a async scroll offset in the y-direction such that the
   // scrollframe scrolls to the bottom of its range.
   utils.setDisplayPortForElement(0, 0, 500, 500, scroller, 1);
-  yield waitForAllPaints(testDriver);
+  yield waitForApzFlushedRepaints(testDriver);
   var scrollY = scroller.scrollTopMax;
   utils.setAsyncScrollOffset(scroller, 0, scrollY);
   if (config.isWebRender) {
     // Tick the refresh driver once to make sure the compositor has applied the
     // async scroll offset (for APZ hit-testing this doesn't matter, but for
     // WebRender hit-testing we need to make sure WR has the latest info).
     utils.advanceTimeAndRefresh(16);
     utils.restoreNormalRefresh();
--- a/gfx/layers/apz/test/mochitest/helper_hittest_checkerboard.html
+++ b/gfx/layers/apz/test/mochitest/helper_hittest_checkerboard.html
@@ -23,17 +23,17 @@ function* test(testDriver) {
 
   var scroller = document.getElementById('scroller');
 
   // Activate the scrollframe but keep the main-thread scroll position at 0.
   // Also apply an async scroll offset in the y-direction such that the
   // scrollframe scrolls all the way to the bottom of its range, where it's
   // sure to checkerboard.
   utils.setDisplayPortForElement(0, 0, 300, 1000, scroller, 1);
-  yield waitForAllPaints(testDriver);
+  yield waitForApzFlushedRepaints(testDriver);
   var scrollY = scroller.scrollTopMax;
   utils.setAsyncScrollOffset(scroller, 0, scrollY);
   if (config.isWebRender) {
     // Tick the refresh driver once to make sure the compositor has applied the
     // async scroll offset (for APZ hit-testing this doesn't matter, but for
     // WebRender hit-testing we need to make sure WR has the latest info).
     utils.advanceTimeAndRefresh(16);
     utils.restoreNormalRefresh();
--- a/gfx/layers/apz/test/mochitest/helper_hittest_fixed_in_scrolled_transform.html
+++ b/gfx/layers/apz/test/mochitest/helper_hittest_fixed_in_scrolled_transform.html
@@ -65,17 +65,17 @@ body {
 
 function* test(testDriver) {
   var config = getHitTestConfig();
   var utils = config.utils;
 
   // layerize the scrollable frame
   var subframe = document.querySelector('.subframe');
   utils.setDisplayPortForElement(0, 0, 800, 2000, subframe, 1);
-  yield waitForAllPaints(testDriver);
+  yield waitForApzFlushedRepaints(testDriver);
 
   var target = document.querySelector('.absoluteClip');
   checkHitResult(hitTest(centerOf(target)),
                  APZHitResultFlags.VISIBLE,
                  utils.getViewId(subframe),
                  "fixed item inside a scrolling transform");
 
   subtestDone();