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

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

Issue 25039006: document.documentElement.scrollTop/Left is zero (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: document.documentElement.scrollTop/Left is zero Created 7 years, 2 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="stylesheet" href="../../../js/resources/js-test-style.css"> 4 <link rel="stylesheet" href="../../../js/resources/js-test-style.css">
5 <script src="../../../js/resources/js-test-pre.js"></script> 5 <script src="../../../js/resources/js-test-pre.js"></script>
6 <script src="resources/gesture-helpers.js"></script> 6 <script src="resources/gesture-helpers.js"></script>
7 <style type="text/css"> 7 <style type="text/css">
8 8
9 ::-webkit-scrollbar { 9 ::-webkit-scrollbar {
10 width: 0px; 10 width: 0px;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 </div> 46 </div>
47 47
48 <p id="description"></p> 48 <p id="description"></p>
49 <div id="console"></div> 49 <div id="console"></div>
50 <script type="text/javascript"> 50 <script type="text/javascript">
51 51
52 var movedbox; 52 var movedbox;
53 var touchtarget; 53 var touchtarget;
54 var iframe; 54 var iframe;
55 var iframeBody; 55 var iframeBody;
56 var iframeDocumentElement;
56 var expectedGesturesTotal = 1; 57 var expectedGesturesTotal = 1;
57 var gesturesOccurred = 0; 58 var gesturesOccurred = 0;
58 var scrollAmountX = ['0']; 59 var scrollAmountX = ['0'];
59 var scrollAmountY = ['50']; 60 var scrollAmountY = ['50'];
60 var wheelEventsOccurred = 0; 61 var wheelEventsOccurred = 0;
61 var expectedWheelEventsOccurred = ['0']; 62 var expectedWheelEventsOccurred = ['0'];
62 var scrollEventsOccurred = 0; 63 var scrollEventsOccurred = 0;
63 var scrolledElement = 'movedbox' 64 var scrolledElement = 'movedbox'
64 var scrollEventsOccurred = 0; 65 var scrollEventsOccurred = 0;
65 var expectedScrollEventsOccurred = '1'; 66 var expectedScrollEventsOccurred = '1';
66 67
67 function firstGestureScroll() 68 function firstGestureScroll()
68 { 69 {
69 iframe = touchtarget; 70 iframe = touchtarget;
70 iframeBody = iframe.contentDocument.body; 71 iframeBody = iframe.contentDocument.body;
72 iframeDocumentElement = touchtarget.contentDocument.documentElement;
71 73
72 var amountToScroll = iframeBody.scrollHeight - iframe.clientHeight; 74 var amountToScroll = iframeBody.scrollHeight - iframe.clientHeight;
73 75
74 touchtarget.contentDocument.body.scrollTop = amountToScroll; 76 iframeBody.scrollTop = amountToScroll;
75 77
76 // Sanity - make sure the iframe is actually fully scrolled scrolled 78 // Sanity - make sure the iframe is actually fully scrolled scrolled
77 shouldBe('iframeBody.scrollHeight - iframeBody.scrollTop', 'iframe.clientHei ght'); 79 shouldBe('iframeBody.scrollHeight - iframeDocumentElement.scrollTop', 'ifram e.clientHeight');
78 80
79 eventSender.gestureScrollBegin(10, 72); 81 eventSender.gestureScrollBegin(10, 72);
80 eventSender.gestureScrollUpdateWithoutPropagation(0, -20); 82 eventSender.gestureScrollUpdateWithoutPropagation(0, -20);
81 eventSender.gestureScrollUpdateWithoutPropagation(0, -18); 83 eventSender.gestureScrollUpdateWithoutPropagation(0, -18);
82 eventSender.gestureScrollUpdateWithoutPropagation(0, -15); 84 eventSender.gestureScrollUpdateWithoutPropagation(0, -15);
83 eventSender.gestureScrollUpdateWithoutPropagation(0, -10); 85 eventSender.gestureScrollUpdateWithoutPropagation(0, -10);
84 eventSender.gestureScrollEnd(0, 0); 86 eventSender.gestureScrollEnd(0, 0);
85 87
86 amountToScroll = movedbox.scrollHeight - movedbox.clientHeight; 88 amountToScroll = movedbox.scrollHeight - movedbox.clientHeight;
87 scrollAmountY[0] = amountToScroll.toString(); 89 scrollAmountY[0] = amountToScroll.toString();
88 90
89 // Wait for layout. 91 // Wait for layout.
90 checkScrollOffset(); 92 checkScrollOffset();
91 } 93 }
92 94
93 if (window.testRunner) 95 if (window.testRunner)
94 testRunner.waitUntilDone(); 96 testRunner.waitUntilDone();
95 97
96 function runTest() 98 function runTest()
97 { 99 {
98 movedbox = document.getElementById("outerdiv"); 100 movedbox = document.getElementById("outerdiv");
99 touchtarget = document.getElementById("touchtargetiframe"); 101 touchtarget = document.getElementById("touchtargetiframe");
100 102
101 touchtarget.contentDocument.addEventListener("scroll", recordScroll); 103 touchtarget.contentDocument.addEventListener("scroll", recordScroll);
102 touchtarget.contentDocument.body.addEventListener("mousewheel", recordWheel) ; 104 touchtarget.contentDocument.documentElement.addEventListener("mousewheel", r ecordWheel);
103 105
104 if (window.eventSender) { 106 if (window.eventSender) {
105 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 ' +
106 'is correctly targeting the parent container.'); 108 'is correctly targeting the parent container.');
107 109
108 if (checkTestDependencies() && window.eventSender.gestureScrollUpdateWit houtPropagation) 110 if (checkTestDependencies() && window.eventSender.gestureScrollUpdateWit houtPropagation)
109 firstGestureScroll(); 111 firstGestureScroll();
110 else 112 else
111 exitIfNecessary(); 113 exitIfNecessary();
112 } else { 114 } else {
113 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.");
114 } 116 }
115 } 117 }
116 </script> 118 </script>
117 119
118 120
119 121
120 </body> 122 </body>
121 </html> 123 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698