Move /platform/ios-simulator/accessibility tests to accessibility/ios-simulator/
[WebKit-https.git] / LayoutTests / tiled-drawing / scrolling / overflow-scroll-reduced-content.html
1 <html>
2 <head>
3 <style>
4 .outer {
5     position: relative;
6     margin: 100px;
7     height: 400px;
8     width: 200px;
9     border: 1px solid blue;
10 }
11
12 #inner {
13     position: absolute;
14     top: 0;
15     left: 0;
16     right: 0;
17     bottom: 0;
18
19     overflow-x: hidden;
20     overflow-y: auto;    
21 }
22
23 .big {
24     height: 2000px;
25 }
26 </style>
27
28 <script src="../../resources/js-test-pre.js"></script>
29 <script>
30
31 function decreaseContentSize()
32 {
33     var content = document.getElementById('content');
34     content.classList.remove("big");
35     internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
36
37     var divTarget = document.getElementById('inner');
38     var divScrollPos = divTarget.scrollTop;
39     if (divScrollPos == 0)
40         testPassed("Re-sizing the content of the scrolled div correctly set a new scroll position.");
41     else
42         testFailed("Re-sizing the content of the scrolled div failed to correctly set a new scroll position. ");
43
44     testRunner.notifyDone();
45 }
46
47 function scrollTest()
48 {
49     var startPosX = 150;
50     var startPosY = 150;
51     eventSender.mouseMoveTo(startPosX, startPosY);
52     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
53     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
54     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
55     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
56     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
57     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
58     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
59     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
60     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
61     eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
62
63     setTimeout(decreaseContentSize, 100);
64 }
65
66 function setUp() {
67     if (window.eventSender) {
68         testRunner.dumpAsText();
69         testRunner.waitUntilDone();
70
71         setTimeout(scrollTest, 0);
72     }
73 }
74 </script>
75 </head>
76
77 <body onload="setUp();">
78
79 <div class="outer">
80     <div id="inner">
81         <div id="content" class="big">This test should be run in the test harness.</div>
82     </div>
83 </div>
84 </body>
85 </html>
86