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

Side by Side Diff: LayoutTests/fast/events/touch/gesture/touch-gesture-fully-scrolled-iframe-propagates.html

Issue 732483003: Remove GestureScrollUpdateWithoutPropagation event (blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years 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 | « no previous file | LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../../resources/js-test.js"></script> 4 <script src="../../../../resources/js-test.js"></script>
5 <script src="resources/gesture-helpers.js"></script> 5 <script src="resources/gesture-helpers.js"></script>
6 <style type="text/css"> 6 <style type="text/css">
7 7
8 ::-webkit-scrollbar { 8 ::-webkit-scrollbar {
9 width: 0px; 9 width: 0px;
10 height: 0px; 10 height: 0px;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 var iframe; 53 var iframe;
54 var iframeBody; 54 var iframeBody;
55 var iframeDocumentElement; 55 var iframeDocumentElement;
56 var expectedGesturesTotal = 1; 56 var expectedGesturesTotal = 1;
57 var gesturesOccurred = 0; 57 var gesturesOccurred = 0;
58 var scrollAmountX = ['0']; 58 var scrollAmountX = ['0'];
59 var scrollAmountY = ['50']; 59 var scrollAmountY = ['50'];
60 var wheelEventsOccurred = 0; 60 var wheelEventsOccurred = 0;
61 var expectedWheelEventsOccurred = ['0']; 61 var expectedWheelEventsOccurred = ['0'];
62 var scrollEventsOccurred = 0; 62 var scrollEventsOccurred = 0;
63 var scrolledElement = 'movedbox' 63 var scrolledElement = 'movedbox';
64 var scrollEventsOccurred = 0; 64 var scrollEventsOccurred = 0;
65 var expectedScrollEventsOccurred = '1'; 65 var expectedScrollEventsOccurred = '1';
66 66
67 function firstGestureScroll() 67 function firstGestureScroll()
68 { 68 {
69 iframe = touchtarget; 69 iframe = touchtarget;
70 iframeBody = iframe.contentDocument.body; 70 iframeBody = iframe.contentDocument.body;
71 iframeDocumentElement = touchtarget.contentDocument.documentElement; 71 iframeDocumentElement = touchtarget.contentDocument.documentElement;
72 72
73 var amountToScroll = iframeBody.scrollHeight - iframe.clientHeight; 73 var amountToScroll = iframeBody.scrollHeight - iframe.clientHeight;
74 74
75 iframeDocumentElement.scrollTop = amountToScroll; 75 iframeDocumentElement.scrollTop = amountToScroll;
76 76
77 // Sanity - make sure the iframe is actually fully scrolled scrolled 77 // Sanity - make sure the iframe is actually fully scrolled
78 shouldBe('iframeBody.scrollHeight - iframeDocumentElement.scrollTop', 'ifram e.clientHeight'); 78 shouldBe('iframeBody.scrollHeight - iframeDocumentElement.scrollTop', 'ifram e.clientHeight');
79 79
80 eventSender.gestureScrollBegin(10, 72); 80 eventSender.gestureScrollBegin(10, 72);
81 eventSender.gestureScrollUpdateWithoutPropagation(0, -20); 81 // Prevent scroll to propagate by passing true for third parameter
82 eventSender.gestureScrollUpdateWithoutPropagation(0, -18); 82 eventSender.gestureScrollUpdate(0, -20, true);
83 eventSender.gestureScrollUpdateWithoutPropagation(0, -15); 83 eventSender.gestureScrollUpdate(0, -18, true);
84 eventSender.gestureScrollUpdateWithoutPropagation(0, -10); 84 eventSender.gestureScrollUpdate(0, -15, true);
85 eventSender.gestureScrollUpdate(0, -10, true);
85 eventSender.gestureScrollEnd(0, 0); 86 eventSender.gestureScrollEnd(0, 0);
86 87
87 amountToScroll = movedbox.scrollHeight - movedbox.clientHeight; 88 amountToScroll = movedbox.scrollHeight - movedbox.clientHeight;
88 scrollAmountY[0] = amountToScroll.toString(); 89 scrollAmountY[0] = amountToScroll.toString();
89 90
90 // Wait for layout. 91 // Wait for layout.
91 checkScrollOffset(); 92 checkScrollOffset();
92 } 93 }
93 94
94 if (window.testRunner) 95 if (window.testRunner)
95 testRunner.waitUntilDone(); 96 testRunner.waitUntilDone();
96 97
97 function runTest() 98 function runTest()
98 { 99 {
99 movedbox = document.getElementById("outerdiv"); 100 movedbox = document.getElementById("outerdiv");
100 touchtarget = document.getElementById("touchtargetiframe"); 101 touchtarget = document.getElementById("touchtargetiframe");
101 102
102 touchtarget.contentDocument.addEventListener("scroll", recordScroll); 103 touchtarget.contentDocument.addEventListener("scroll", recordScroll);
103 touchtarget.contentDocument.documentElement.addEventListener("mousewheel", r ecordWheel); 104 touchtarget.contentDocument.documentElement.addEventListener("mousewheel", r ecordWheel);
104 105
105 if (window.eventSender) { 106 if (window.eventSender) {
106 description('This tests that a fling gesture sent to an iframe with no r emaining scroll offset ' + 107 description('This tests that a fling gesture sent to an iframe with no r emaining scroll offset ' +
107 'is correctly targeting the parent container.'); 108 'is correctly targeting the parent container.');
108 109
109 if (checkTestDependencies() && window.eventSender.gestureScrollUpdateWit houtPropagation) 110 if (checkTestDependencies() && window.eventSender.gestureScrollUpdate)
110 firstGestureScroll(); 111 firstGestureScroll();
111 else 112 else
112 exitIfNecessary(); 113 exitIfNecessary();
113 } else { 114 } else {
114 debug("This test requires DumpRenderTree. Gesture-scroll the page to va lidate the implementation."); 115 debug("This test requires DumpRenderTree. Gesture-scroll the page to va lidate the implementation.");
115 } 116 }
116 } 117 }
117 </script> 118 </script>
118 119
119 120
120 121
121 </body> 122 </body>
122 </html> 123 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-div-not-propagated.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698