forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixed-with-main-thread-scrolling.html
66 lines (61 loc) · 2.18 KB
/
fixed-with-main-thread-scrolling.html
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
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 6000px;
}
.box {
position: fixed;
top: 10px;
left: 10px;
width: 200px;
height: 200px;
background-color: green;
}
.fixed-background {
margin-top: 300px;
height: 200px;
background-image: linear-gradient(white, silver);
background-attachment: fixed;
}
</style>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
}
function scrollTest()
{
eventSender.mouseMoveTo(20, 20);
eventSender.monitorWheelEvents();
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "began", "none");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "changed", "none");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, "changed", "none");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "begin");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -100, "none", "continue");
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "none", "end");
eventSender.callAfterScrollingCompletes(() => {
setTimeout(() => {
testRunner.notifyDone()
}, 0);
});
}
window.addEventListener('load', () => {
setTimeout(() => {
scrollTest();
}, 0)
}, false);
</script>
</head>
<body>
<div class="box"></div>
<div class="fixed-background">
I have a fixed background.
</div>
</body>
</html>