summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_doubletap_zoom_tablecell.html
blob: f578ccc5929ae7cc7c4cf63d3e2b2878d3747785 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=2100"/>
  <title>Check that double tapping small table cells does not zoom</title>
  <script src="apz_test_native_event_utils.js"></script>
  <script src="apz_test_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <script>

async function test() {
  let useTouchpad = (location.search == "?touchpad");

  let resolution = await getResolution();
  ok(resolution > 0,
     "The initial_resolution is " + resolution + ", which is some sane value");

  // Check that double-tapping does not zoom in
  info("sending first double tap");
  await doubleTapOn(document.getElementById("target1"), 10, 10, useTouchpad);
  let prev_resolution = resolution;
  resolution = await getResolution();
  ok(resolution == prev_resolution, "The first double-tap did not change the resolution: " + resolution);

  // Check that double-tapping does not zoom in
  info("sending second double tap");
  await doubleTapOn(document.getElementById("target2"), 10, 10, useTouchpad);
  prev_resolution = resolution;
  resolution = await getResolution();
  ok(resolution == prev_resolution, "The second double-tap did not change the resolution: " + resolution);

  // Check that double-tapping does zoom in
  info("sending third double tap");
  await doubleTapOn(document.getElementById("target3"), 10, 10, useTouchpad);
  prev_resolution = resolution;
  resolution = await getResolution();
  ok(resolution > prev_resolution, "The third double-tap has increased the resolution to " + resolution);
}

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

  </script>
  <style>
    table {
      width: 100%;
    }
    table,
    td {
        border: 1px solid #333;
    }
    td {
      height: 25px;
    }
    .small {
      width: 15vw;
    }
    .big {
      width: 50vw;
    }
  </style>
</head>
<body>
<table>
    <thead>
        <tr>
            <th colspan="2">The table header</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="small"><div id="target1" class="small">The table body</div></td>
            <td>with two columns</td>
        </tr>
    </tbody>
</table>

<table>
    <thead>
        <tr>
            <th colspan="2">The table header</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="small"><div class="small"><div id="target2" class="small">The table body</div></div></td>
            <td>with two columns</td>
        </tr>
    </tbody>
</table>

<table>
    <thead>
        <tr>
            <th colspan="2">The table header</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td id="target3" class="big">The table body</td>
            <td>with two columns</td>
        </tr>
    </tbody>
</table>


</body>
</html>