summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/helper_hittest_float_bug1443518.html
blob: 0e2e75437590919d9b91de2f4cabd467eead0075 (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
<!DOCTYPE HTML>
<html>
<head>
  <title>APZ hit-testing with floated subframe</title>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <meta name="viewport" content="width=device-width"/>
  <style>
    #div1 {
      position: relative;
    }
    #div2 {
      width: 300px;
      float: left;
    }
    #subframe {
      overflow: auto;
    }
    #make-root-scrollable {
      height: 5000px;
    }
  </style>
</head>
<body>
  <div id="div1">
    <div id="div2">
      <div id="subframe">
        <pre>A line of text that overflows because it's sufficiently long</pre>
      </div>
    </div>
  </div>
  <div id="make-root-scrollable"></div>
</body>
<script type="application/javascript">

async function test() {
  var utils = getHitTestConfig().utils;

  hitTestScrollbar({
    element: document.getElementById("subframe"),
    directions: { horizontal: true },
    expectedScrollId: utils.getViewId(document.scrollingElement),
    expectedLayersId: utils.getLayersId(),
    trackLocation: ScrollbarTrackLocation.START,
    expectThumb: true,
    layerState: LayerState.INACTIVE,
  });
}

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

</script>
</html>