Bug 1519007 - Avoid using setAsyncScrollOffset() to scroll out of bounds in tests. r=kats a=pascalc
authorBotond Ballo <botond@mozilla.com>
Mon, 01 Apr 2019 15:39:27 +0000
changeset 526071 0d43ca71665f2f956269ab5b7d6bd00175a7fb11
parent 526070 b71adadd3a3c9a7cd176c186b71d0c0d53850b16
child 526072 0c6cb165ba726b0987fbe1df7ffc65c714b4e562
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, pascalc
bugs1519007
milestone67.0
Bug 1519007 - Avoid using setAsyncScrollOffset() to scroll out of bounds in tests. r=kats a=pascalc Depends on D24826 Differential Revision: https://phabricator.services.mozilla.com/D25483
gfx/layers/apz/test/mochitest/helper_bug1464568_opacity.html
gfx/layers/apz/test/mochitest/helper_bug1464568_transform.html
layout/reftests/async-scrolling/position-fixed-async-zoom-2-ref.html
layout/reftests/async-scrolling/position-fixed-async-zoom-2.html
layout/reftests/async-scrolling/position-sticky-async-zoom-2-ref.html
layout/reftests/async-scrolling/position-sticky-async-zoom-2.html
--- a/gfx/layers/apz/test/mochitest/helper_bug1464568_opacity.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1464568_opacity.html
@@ -21,16 +21,21 @@
 <body>
  <!--
   This height should be smaller than window height, otherwise the animation
   followed by this element will be out of view, thus the animation doesn't run
   on the compositor.
   -->
  <div style="height: 500px"></div>
  <div id="anim"></div>
+ <!--
+  Give the page room to scroll, so that the setAsyncScrollOffset() call
+  doesn't take the scroll position out of bounds
+ -->
+ <div style="height: 1000px"></div>
 </body>
 <script>
 "use strict";
 
 const utils = SpecialPowers.getDOMWindowUtils(window);
 
 async function test_opacity() {
   utils.setDisplayPortForElement(0, 0, 300, 1000, document.documentElement, 1);
--- a/gfx/layers/apz/test/mochitest/helper_bug1464568_transform.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1464568_transform.html
@@ -21,16 +21,21 @@
 <body>
  <!--
   This height should be smaller than window height, otherwise the animation
   followed by this element will be out of view, thus the animation doesn't run
   on the compositor.
   -->
  <div style="height: 500px"></div>
  <div id="anim"></div>
+ <!--
+  Give the page room to scroll, so that the setAsyncScrollOffset() call
+  doesn't take the scroll position out of bounds
+ -->
+ <div style="height: 1000px"></div>
 </body>
 <script>
 "use strict";
 
 const utils = SpecialPowers.getDOMWindowUtils(window);
 
 async function test_transform() {
   utils.setDisplayPortForElement(0, 0, 300, 1000, document.documentElement, 1);
--- a/layout/reftests/async-scrolling/position-fixed-async-zoom-2-ref.html
+++ b/layout/reftests/async-scrolling/position-fixed-async-zoom-2-ref.html
@@ -1,17 +1,19 @@
 <!DOCTYPE html>
 <html>
 <head>
   <meta name="viewport" content="width=device-width, initial-scale=2.0">
   <style>
+    html {
+      scrollbar-width: none;
+    }
     body {
       height: 3000px;
       margin: 0;
-      overflow: hidden;
     }
     div {
       position: absolute;
       top: 0;
       width: 100px;
       height: 100px;
       background: green;
     }
--- a/layout/reftests/async-scrolling/position-fixed-async-zoom-2.html
+++ b/layout/reftests/async-scrolling/position-fixed-async-zoom-2.html
@@ -2,20 +2,22 @@
 <html class="reftest-wait"
       reftest-async-scroll
       reftest-displayport-x="0" reftest-displayport-y="0"
       reftest-displayport-w="800" reftest-displayport-h="1000"
       reftest-async-scroll-x="0" reftest-async-scroll-y="-50"
       reftest-async-zoom="2.0">
 <head>
   <style>
+    html {
+      scrollbar-width: none;
+    }
     body {
       height: 3000px;
       margin: 0;
-      overflow: hidden;
     }
     div {
       position: fixed;
       top: 0;
       width: 100px;
       height: 100px;
       background: green;
     }
--- a/layout/reftests/async-scrolling/position-sticky-async-zoom-2-ref.html
+++ b/layout/reftests/async-scrolling/position-sticky-async-zoom-2-ref.html
@@ -1,17 +1,19 @@
 <!DOCTYPE html>
 <html>
 <head>
   <meta name="viewport" content="width=device-width, initial-scale=2.0">
   <style>
+    html {
+      scrollbar-width: none;
+    }
     body {
       height: 3000px;
       margin: 0;
-      overflow: hidden;
     }
     div {
       position: absolute;
       top: 0;
       width: 100px;
       height: 100px;
       background: green;
     }
--- a/layout/reftests/async-scrolling/position-sticky-async-zoom-2.html
+++ b/layout/reftests/async-scrolling/position-sticky-async-zoom-2.html
@@ -2,20 +2,22 @@
 <html class="reftest-wait"
       reftest-async-scroll
       reftest-displayport-x="0" reftest-displayport-y="0"
       reftest-displayport-w="800" reftest-displayport-h="1000"
       reftest-async-scroll-x="0" reftest-async-scroll-y="-50"
       reftest-async-zoom="2.0">
 <head>
   <style>
+    html {
+      scrollbar-width: none;
+    }
     body {
       height: 3000px;
       margin: 0;
-      overflow: hidden;
     }
     div {
       position: sticky;
       top: 0;
       width: 100px;
       height: 100px;
       background: green;
     }