summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/test/mochitest/test_scroll_inactive_flattened_frame.html
blob: 51e16aab977ae9c84fcaeec8b60390a2f2098c9a (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
<!DOCTYPE HTML>
<html>
<head>
  <title>Test scrolling flattened inactive frames</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
  <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
  <script type="application/javascript" src="apz_test_utils.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<div id="container" style="height: 300px; width: 600px; overflow: auto; background: yellow">
 <div id="outer" style="height: 400px; width: 500px; overflow: auto; background: black">
  <div id="inner" style="mix-blend-mode: screen; height: 800px; overflow: auto; background: purple">
  </div>
 </div>
</div>
<script class="testbody" type="text/javascript;version=1.7">
function test() {
  var container = document.getElementById('container');
  var outer = document.getElementById('outer');
  var inner = document.getElementById('inner');
  var outerScrollTop = outer.scrollTop;
  var containerScrollTop = container.scrollTop;
  var event = {
    deltaMode: WheelEvent.DOM_DELTA_LINE,
    deltaX: 0,
    deltaY: 10,
    lineOrPageDeltaX: 0,
    lineOrPageDeltaY: 10,
  };
  sendWheelAndPaint(inner, 20, 30, event, function () {
    ok(container.scrollTop == containerScrollTop, "container scrollframe should not have scrolled");
    ok(outer.scrollTop > outerScrollTop, "nested scrollframe should have scrolled");
    SimpleTest.finish();
  });
}

SimpleTest.testInChaosMode();
SimpleTest.waitForExplicitFinish();

pushPrefs([['general.smoothScroll', false],
           ['mousewheel.transaction.timeout', 1000000]])
.then(waitUntilApzStable)
.then(test);

</script>
</body>
</html>