summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_touch_action_zero_opacity_bug1500864.html
blob: d31483f4f6b4e7c55dce0265f10532dbfdc4fb6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width; initial-scale=1.0">
  <title>Touch-action on a zero-opacity element</title>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script type="application/javascript">
async function test() {
  var target = document.getElementById("target");

  let touchEndPromise = promiseTouchEnd(document.body);

  // drag the page up to scroll down by 50px
  ok(await synthesizeNativeTouchDrag(target, 10, 100, 0, -50),
      "Synthesized native vertical drag, waiting for touch-end event...");
  await touchEndPromise;

  await promiseOnlyApzControllerFlushed();

  is(window.scrollX, 0, "X scroll offset didn't change");
  is(window.scrollY, 0, "Y scroll offset didn't change");
}

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);

  </script>
</head>
<body style="border: solid 1px green">
  <div id="spacer" style="height: 2000px">
    Inside the black border is a zero-opacity touch-action none.
    <div id="border" style="border: solid 1px black">
        <div style="opacity: 0; height: 300px;">
            <div style="transform:translate(0px)">
                <div id="target" style="height: 300px; touch-action: none">this text shouldn't be visible</div>
            </div>
        </div>
    </div>
  </div>
</body>
</html>