forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverflow-scroll-touch-tiles.html
70 lines (63 loc) · 1.99 KB
/
overflow-scroll-touch-tiles.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
67
68
69
70
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
<html>
<head>
<style>
.scroll {
height: 300px;
width: 400px;
border: 2px solid black;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
.box {
width: 300px;
height: 2000px;
border: 1px solid black;
background-image: repeating-linear-gradient(180deg,rgb(26,198,204),rgb(26,198,204) 7%, rgb(100,100,100) 100%);
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function getUIScript()
{
return `
(function() {
uiController.touchDownAtPoint(50, 300, 1, () => {
uiController.dragFromPointToPoint(50, 300, 50, 50, 0.1, () => {
uiController.liftUpAtPoint(50, 50, 1, () => {
uiController.uiScriptComplete('');
});
});
});
})();`
}
function dumpTiles(outputId)
{
if (window.internals)
document.getElementById(outputId).innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
}
function doTest()
{
if (!testRunner.runUIScript)
return;
dumpTiles('before-layers');
testRunner.runUIScript(getUIScript(), function(result) {
dumpTiles('after-layers');
if (window.testRunner)
testRunner.notifyDone();
});
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div class="scroll">
<div class="box"></div>
</div>
<pre id="before-layers">Layer tree goes here</pre>
<pre id="after-layers">Layer tree goes here</pre>
</body>
</html>