Backed out changeset 332b088b3141 (bug 1774315) for causing scroll related failures...
[gecko.git] / gfx / layers / apz / test / mochitest / test_bug1151667.html
blob12a46b9094aa3f34bb2682f4769bb83f0f320093
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=1151667
5 -->
6 <head>
7 <title>Test for Bug 1151667</title>
8 <script src="/tests/SimpleTest/SimpleTest.js"></script>
9 <script src="/tests/SimpleTest/EventUtils.js"></script>
10 <script src="/tests/SimpleTest/paint_listener.js"></script>
11 <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
12 <script type="application/javascript" src="apz_test_utils.js"></script>
13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
14 <style>
15 #subframe {
16 margin-top: 100px;
17 height: 500px;
18 width: 500px;
19 overflow: scroll;
21 #subframe-content {
22 height: 1000px;
23 width: 500px;
24 /* the background is so that we can see it scroll*/
25 background: repeating-linear-gradient(#EEE, #EEE 100px, #DDD 100px, #DDD 200px);
27 #page-content {
28 height: 5000px;
29 width: 500px;
31 </style>
32 </head>
33 <body>
34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151667">Mozilla Bug 1151667</a>
35 <p id="display"></p>
36 <div id="subframe">
37 <!-- This makes sure the subframe is scrollable -->
38 <div id="subframe-content"></div>
39 </div>
40 <!-- This makes sure the page is also scrollable, so it (rather than the subframe)
41 is considered the primary async-scrollable frame, and so the subframe isn't
42 layerized upon page load. -->
43 <div id="page-content"></div>
44 <pre id="test">
45 <script type="application/javascript">
47 async function test() {
48 var subframe = document.getElementById("subframe");
49 await promiseNativeWheelAndWaitForScrollEvent(subframe, 100, 150, 0, -10);
51 is(subframe.scrollTop > 0, true, "We should have scrolled the subframe down");
52 is(document.documentElement.scrollTop, 0, "We should not have scrolled the page");
55 SimpleTest.waitForExplicitFinish();
56 waitUntilApzStable()
57 .then(test)
58 .then(SimpleTest.finish, SimpleTest.finishWithFailure);
60 </script>
61 </pre>
62 </body>
63 </html>