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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/touch/resources/compositor-touch-hit-rects.js

Issue 1895303007: Non passive touch end or touch cancel listeners should not block scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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 function listener() { 1 function listener() {
2 } 2 }
3 3
4 function log(msg) { 4 function log(msg) {
5 var span = document.createElement("span"); 5 var span = document.createElement("span");
6 document.getElementById("console").appendChild(span); 6 document.getElementById("console").appendChild(span);
7 span.innerHTML = msg + '<br />'; 7 span.innerHTML = msg + '<br />';
8 } 8 }
9 9
10 function nameForNode(node) { 10 function nameForNode(node) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 visualize = true; 129 visualize = true;
130 } 130 }
131 131
132 if (window.internals) { 132 if (window.internals) {
133 window.internals.settings.setMockScrollbarsEnabled(true); 133 window.internals.settings.setMockScrollbarsEnabled(true);
134 } 134 }
135 135
136 window.onload = function() { 136 window.onload = function() {
137 // Run each general test case. 137 // Run each general test case.
138 var tests = document.querySelectorAll('.testcase'); 138 var tests = document.querySelectorAll('.testcase');
139
140 // Add document wide touchend and touchcancel listeners and ensure the
141 // listeners do not affect compositor hit test rects.
142 document.documentElement.addEventListener('touchend', listener, false);
143 document.documentElement.addEventListener('touchcancel', listener, false);
144
139 for ( var i = 0; i < tests.length; i++) { 145 for ( var i = 0; i < tests.length; i++) {
140 // Force a compositing update before testing each case to ensure that 146 // Force a compositing update before testing each case to ensure that
141 // any subsequent touch rect updates are actually done because of 147 // any subsequent touch rect updates are actually done because of
142 // the event handler changes in the test itself. 148 // the event handler changes in the test itself.
143 if (window.internals) 149 if (window.internals)
144 window.internals.forceCompositingUpdate(document); 150 window.internals.forceCompositingUpdate(document);
145 testElement(tests[i]); 151 testElement(tests[i]);
146 } 152 }
147 153
148 if (window.additionalTests) 154 if (window.additionalTests)
149 additionalTests(); 155 additionalTests();
150 156
151 if (!visualize && window.internals) { 157 if (!visualize && window.internals) {
152 var testContainer = document.getElementById("tests"); 158 var testContainer = document.getElementById("tests");
153 testContainer.parentNode.removeChild(testContainer); 159 testContainer.parentNode.removeChild(testContainer);
154 } 160 }
155 161
156 document.documentElement.setAttribute('done', 'true'); 162 document.documentElement.setAttribute('done', 'true');
157 }; 163 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698