blob: 6dd0de13cbe15d73e4dc5f40016b6f2ba50d5daf (
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
|
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<title>Dragging the mouse on a scrollframe inside an SVGEffects</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="text/javascript">
async function test() {
var scrollableDiv = document.getElementById("scrollable");
let scrollPromise = new Promise(resolve => {
scrollableDiv.addEventListener("scroll", resolve, {once: true});
});
var dragFinisher = await promiseVerticalScrollbarDrag(scrollableDiv);
if (!dragFinisher) {
ok(true, "No scrollbar, can't do this test");
return;
}
// the events above might be stuck in APZ input queue for a bit until the
// layer is activated, so we wait here until the scroll event listener is
// triggered.
await scrollPromise;
await dragFinisher();
// Flush everything just to be safe
await promiseOnlyApzControllerFlushed();
// After dragging the scrollbar 20px on a 200px-high scrollable div, we should
// have scrolled approx 10% of the 2000px high content. There might have been
// scroll arrows and such so let's just have a minimum bound of 50px to be safe.
ok(scrollableDiv.scrollTop > 50, "Scrollbar drag resulted in a scroll position of " + scrollableDiv.scrollTop);
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
<style>
#svgeffects {
background-color: lightgreen;
width: 300px;
height: 300px;
clip-path: circle(200px at 100% 0); /* ensure scrollthumb is in the clip */
}
#scrollable {
overflow: scroll;
height: 200px;
width: 200px;
}
#content {
width: 1000px;
height: 2000px;
background-image: linear-gradient(red,blue);
}
</style>
</head>
<body>
<div id="svgeffects">A div that generate an svg effects display item
<div id="scrollable">
<div id="content">Some content inside the scrollframe</div>
</div>
</div>
</body>
</html>
|