Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: LayoutTests/rubberbanding/scroll-bounce-fix.html

Issue 977663002: Mac: Delete now-dead elastic overscroll code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/rubberbanding/overhang-w-expected.txt ('k') | Source/config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head><title>Tests that a momentum scroll (i.e. a fling) doesn't jump vertically </title></head>
4 <body>
5 <div id="box" style="height:800px; background: red; border:2px solid black; widt h:100%"></div>
6 <div id="info">This test requires DRT.</div>
7 <script>
8 if (window.internals) {
9 document.getElementById('info').style.visibility = 'hidden';
10 internals.settings.setMockScrollbarsEnabled(false);
11
12 // These trackpad scroll events first go up, then left, then down & left . All events except the last 2 were obtained by recording real gesture data. The goal is to get rubber-banding to occur while maintaining high velocity in the X and Y directions.
13 var trackpadScrollEvents = [
14 ["scrollBegin"],
15 ["scroll", -1, 4],
16 ["scroll", -5, 14],
17 ["scroll", -5, 23],
18 ["scroll", -12, 57],
19 ["scroll", -11, 68],
20 ["scroll", -9, 85],
21 ["scroll", -3, 77],
22 ["scroll", -1, 109],
23 ["scroll", 4, 105],
24 ["scroll", 22, 106],
25 ["scroll", 47, 60],
26 ["scroll", 102, 32],
27 ["scroll", 210, -1],
28 ["scroll", 281, -23],
29 ["scroll", 453, -103],
30 ["scroll", 600, -223],
31 ["scroll", 800, -303],
32 ["scrollEnd"],
33 ["momentumBegin", 555, -120],
34 ["momentumEnd"]
35 ];
36
37 function queueTimeout(index)
38 {
39 setTimeout(function() { runTimeout(index); }, 5);
40 }
41
42 // Replays the event at position |index|.
43 function runTimeout(index)
44 {
45 var name = trackpadScrollEvents[index][0];
46 if (name == "scrollBegin") {
47 eventSender.trackpadScrollBegin();
48 } else if (name == "scroll") {
49 var deltaX = trackpadScrollEvents[index][1];
50 var deltaY = trackpadScrollEvents[index][2];
51 eventSender.trackpadScroll(deltaX, deltaY, false, true);
52 } else if (name == "scrollEnd") {
53 eventSender.trackpadScrollEnd();
54 } else if (name == "momentumBegin") {
55 var deltaX = trackpadScrollEvents[index][1];
56 var deltaY = trackpadScrollEvents[index][2];
57 eventSender.mouseMomentumBegin2(deltaX, deltaY, false, true);
58 } else if (name == "momentumEnd") {
59 eventSender.mouseMomentumEnd();
60 }
61
62 // Queues another event, if one is available.
63 if (index + 1 < trackpadScrollEvents.length) {
64 queueTimeout(index + 1);
65 }
66 }
67
68 // Queue the first event for replay.
69 queueTimeout(0);
70
71 // The ScrollElasticityController receives callbacks every 16ms, and ani mates the release effect of the rubber-band. Wait for 2 seconds to give the anim ation time to settle.
72 testRunner.waitUntilDone();
73 setTimeout(function() {
74 document.getElementById('box').style.background = 'green';
75 // The left margin should have rebounded back to 0.
76 if (document.body.scrollLeft != 0) {
77 document.getElementById('box').style.background = 'yellow';
78 }
79 // The content should be scrolled to the bottom.
80 var expectedScrollTop = document.documentElement.scrollHeight - docu ment.documentElement.clientHeight;
81 if (document.body.scrollTop != expectedScrollTop) {
82 document.getElementById('box').style.background = 'yellow';
83 }
84 testRunner.notifyDone();
85 }, 2000);
86 }
87 </script>
88 </body>
89 </html>
OLDNEW
« no previous file with comments | « LayoutTests/rubberbanding/overhang-w-expected.txt ('k') | Source/config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698