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

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

Issue 2127163002: Limit PassiveDocumentEventListeners to touch and make it experimental (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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="resources/compositor-touch-hit-rects.css"> 4 <link rel="stylesheet" href="resources/compositor-touch-hit-rects.css">
5 <style> 5 <style>
6 body { 6 body {
7 /* make it easy to validate rects are covering the entire document */ 7 /* make it easy to validate rects are covering the entire document */
8 height: 1968px; 8 height: 1968px;
9 margin: 16px 5px; 9 margin: 16px 5px;
10 } 10 }
11 </style> 11 </style>
12 </head> 12 </head>
13 <body> 13 <body>
14 <p id="description"> 14 <p id="description">
15 This tests verifies the hit test regions given to the compositor in the simple c ase where 15 This tests verifies the hit test regions given to the compositor in the simple c ase where
16 touch handles cover (or nearly cover) the entire document. It can only be run in DumpRenderTree. 16 touch handles cover (or nearly cover) the entire document. It can only be run in DumpRenderTree.
17 </p> 17 </p>
18 18
19 <div id="tests"> 19 <div id="tests">
20 </div> 20 </div>
21 21
22 <div id="console"></div> 22 <div id="console"></div>
23 <script src="resources/compositor-touch-hit-rects.js"></script> 23 <script src="resources/compositor-touch-hit-rects.js"></script>
24 <script> 24 <script>
25 25
26 function runGlobalTest(name, element) { 26 function runGlobalTest(name, element) {
27 // With a global handler, no other handlers should matter 27 // With a global handler, no other handlers should matter
28 var elements = [document.getElementById('description'), element, document.getE lementById('tests')]; 28 var elements = [document.getElementById('description'), element, document.getE lementById('tests')];
29 for (var i = 0; i < elements.length; i++) 29 for (var i = 0; i < elements.length; i++)
30 elements[i].addEventListener('touchmove', listener, false); 30 elements[i].addEventListener('touchmove', listener, {passive: false});
31 31
32 if (window.internals) 32 if (window.internals)
33 internals.forceCompositingUpdate(document); 33 internals.forceCompositingUpdate(document);
34 logRects(name, true); 34 logRects(name, true);
35 35
36 for (var i = 0; i < elements.length; i++) 36 for (var i = 0; i < elements.length; i++)
37 elements[i].removeEventListener('touchmove', listener, false); 37 elements[i].removeEventListener('touchmove', listener, {passive: false});
38 } 38 }
39 39
40 function runOverlayTest() { 40 function runOverlayTest() {
41 if (window.testRunner) 41 if (window.testRunner)
42 testRunner.addWebPageOverlay(); 42 testRunner.addWebPageOverlay();
43 43
44 if (window.internals) 44 if (window.internals)
45 internals.forceCompositingUpdate(document); 45 internals.forceCompositingUpdate(document);
46 logRects('webPageOverlay', true); 46 logRects('webPageOverlay', true);
47 47
48 if (window.testRunner) 48 if (window.testRunner)
49 testRunner.removeWebPageOverlay(); 49 testRunner.removeWebPageOverlay();
50 } 50 }
51 51
52 function additionalTests() { 52 function additionalTests() {
53 runGlobalTest('document', document); 53 runGlobalTest('document', document);
54 runGlobalTest('html', document.documentElement); 54 runGlobalTest('html', document.documentElement);
55 runGlobalTest('body', document.body); 55 runGlobalTest('body', document.body);
56 runOverlayTest(); 56 runOverlayTest();
57 } 57 }
58 </script> 58 </script>
59 </body> 59 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698