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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/pointerevents/pointerevent_touch-action-verification.html

Issue 2303013002: Add UMA metric to track usage of sending a mousedown to select elements. (Closed)
Patch Set: W3C auto test import CL. Created 4 years, 3 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 <title>touch-action: basic verification</title> 4 <title>touch-action: basic verification</title>
5 <meta name="assert" content="TA15.20 - The touch-action CSS property det ermines whether touch input MAY trigger default behavior supplied by the user ag ent. 5 <meta name="assert" content="TA15.20 - The touch-action CSS property det ermines whether touch input MAY trigger default behavior supplied by the user ag ent.
6 auto: The user agent MAY determine any permitted touch behaviors, such a s panning and zooming manipulations of the viewport, for touches that begin on t he element. 6 auto: The user agent MAY determine any permitted touch behaviors, such a s panning and zooming manipulations of the viewport, for touches that begin on t he element.
7 none: Touches that begin on the element MUST NOT trigger default touch b ehaviors. 7 none: Touches that begin on the element MUST NOT trigger default touch b ehaviors.
8 pan-x: The user agent MAY consider touches that begin on the element onl y for the purposes of horizontally scrolling the element's nearest ancestor with horizontally scrollable content. 8 pan-x: The user agent MAY consider touches that begin on the element onl y for the purposes of horizontally scrolling the element's nearest ancestor with horizontally scrollable content.
9 pan-y: The user agent MAY consider touches that begin on the element onl y for the purposes of vertically scrolling the element's nearest ancestor with v ertically scrollable content. 9 pan-y: The user agent MAY consider touches that begin on the element onl y for the purposes of vertically scrolling the element's nearest ancestor with v ertically scrollable content.
10 manipulation: The user agent MAY consider touches that begin on the elem ent only for the purposes of scrolling and continuous zooming. Any additional be haviors supported by auto are out of scope for this specification."> 10 manipulation: The user agent MAY consider touches that begin on the elem ent only for the purposes of scrolling and continuous zooming. Any additional be haviors supported by auto are out of scope for this specification.">
11 <meta name="viewport" content="width=device-width"> 11 <meta name="viewport" content="width=device-width">
12 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> 12 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
13 <script src="/resources/testharness.js"></script> 13 <script src="/resources/testharness.js"></script>
14 <script src="/resources/testharnessreport.js"></script> 14 <script src="/resources/testharnessreport.js"></script>
15 <script src="pointerevent_support.js"></script> 15 <script src="pointerevent_support.js"></script>
16 <style> 16 <style>
17 #target0 { 17 /*
18 width: 700px; 18 Give some rules below something to override in order to test
19 height: 20px; 19 that they really are being parsed
20 touch-action: auto; 20 */
21 } 21 .defnone {
22 #target1 { 22 touch-action: none;
23 width: 700px; 23 }
24 height: 20px;
25 touch-action: none;
26 background: black;
27 margin-top: 5px;
28 touch-action: pan-x;
29 }
30 #target2 {
31 width: 700px;
32 height: 20px;
33 touch-action: none;
34 background: black;
35 margin-top: 5px;
36 touch-action: pan-y;
37 }
38 #target3 {
39 width: 700px;
40 height: 20px;
41 touch-action: none;
42 background: black;
43 margin-top: 5px;
44 touch-action: none;
45 }
46 #target4 {
47 width: 700px;
48 height: 20px;
49 touch-action: none;
50 background: black;
51 margin-top: 5px;
52 touch-action: manipulation;
53 }
54 </style> 24 </style>
55 </head> 25 </head>
56 <body onload="run()"> 26 <body onload="run()">
57 <h2>Pointer Events touch-action attribute support</h2> 27 <h2>Pointer Events touch-action attribute support</h2>
58 <h4 id="desc">Test Description: Test will automatically check behaviour of following values: 'auto', 'pan-x', 'pan-y', ' none', 'manipulation'</h4> 28 <h4 id="desc">Test Description: Test will automatically check parsing be haviour of various touch-action combinations.</h4>
59 <div id="target0"></div>
60 <div id="target1"></div>
61 <div id="target2"></div>
62 <div id="target3"></div>
63 <div id="target4"></div>
64 <script type='text/javascript'> 29 <script type='text/javascript'>
65 var detected_pointertypes = {}; 30 var detected_pointertypes = {};
66 31
67 setup({ explicit_done: true }); 32 setup({ explicit_done: true });
68 33
69 function run() { 34 function run() {
70 var target0 = document.getElementById('target0'); 35 var tests = document.querySelectorAll('.test');
71 var target1 = document.getElementById('target1');
72 var target2 = document.getElementById('target2');
73 var target3 = document.getElementById('target3');
74 var target4 = document.getElementById('target4');
75
76 //TA 15.20 36 //TA 15.20
77 test(function() { 37 for (var i = 0; i < tests.length; i++) {
78 assert_true(getComputedStyle(target0).touchAction == 'au to', "'auto' is set properly"); 38 test(function() {
79 }, "'auto' is set properly"); 39 var style = window.getComputedStyle(tests[i]);
80 test(function() { 40 assert_equals(tests[i].attributes.expected.value, style.to uchAction);
81 assert_true(getComputedStyle(target1).touchAction == 'pa n-x', "'pan-x' is corrected properly"); 41 }, tests[i].id);
82 }, "'pan-x' is corrected properly"); 42 }
83 test(function() {
84 assert_true(getComputedStyle(target2).touchAction == 'pan-y' , "'pan-y' is set properly");
85 }, "'pan-y' is set properly");
86 test(function() {
87 assert_true(getComputedStyle(target3).touchAction == 'none', "'none' is set properly");
88 }, "'none' is set properly");
89 test(function() {
90 assert_true(getComputedStyle(target4).touchAction == 'manipu lation', "'manipulation' is set properly");
91 }, "'manipulation' is set properly");
92 done(); 43 done();
93 } 44 }
94 </script> 45 </script>
95 <h1>touch-action: basic verification</h1> 46 <h1>touch-action: basic verification</h1>
96 <div id="complete-notice"> 47 <div id="complete-notice">
97 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p> 48 <p>The following pointer types were detected: <span id="pointertype- log"></span>.</p>
98 </div> 49 </div>
99 <div id="log"></div> 50 <div id="log"></div>
51 <div class="test" id="default" expected="auto"></div>
52 <div class="test defnone" id="stylesheet-none" expected="none"></div>
53 <div class="test defnone" id="explicit-auto" style="touch-action: auto;" expected="auto"></div>
54 <div class="test" id="explicit-pan-x" style="touch-action: pan-x;" expec ted="pan-x"></div>
55 <div class="test" id="explicit-pan-left" style="touch-action: pan-left;" expected="pan-left"></div>
56 <div class="test" id="explicit-pan-right" style="touch-action: pan-right ;" expected="pan-right"></div>
57 <div class="test" id="explicit-pan-y" style="touch-action: pan-y;" expec ted="pan-y"></div>
58 <div class="test" id="explicit-pan-up" style="touch-action: pan-up;" exp ected="pan-up"></div>
59 <div class="test" id="explicit-pan-down" style="touch-action: pan-down;" expected="pan-down"></div>
60 <div class="test" id="explicit-pan-x-pan-y" style="touch-action: pan-x p an-y;" expected="pan-x pan-y"></div>
61 <div class="test" id="explicit-pan-y-pan-x" style="touch-action: pan-y p an-x;" expected="pan-x pan-y"></div>
62 <div class="test" id="explicit-pan-left-pan-up" style="touch-action: pan -left pan-up;" expected="pan-left pan-up"></div>
63 <div class="test" id="explicit-pan-left-pan-down" style="touch-action: p an-left pan-down;" expected="pan-left pan-down"></div>
64 <div class="test" id="explicit-pan-right-pan-up" style="touch-action: pa n-right pan-up;" expected="pan-right pan-up"></div>
65 <div class="test" id="explicit-pan-right-pan-down" style="touch-action: pan-right pan-down;" expected="pan-right pan-down"></div>
66 <div class="test" id="explicit-pan-up-pan-left" style="touch-action: pan -up pan-left;" expected="pan-left pan-up"></div>
67 <div class="test" id="explicit-pan-up-pan-right" style="touch-action: pa n-up pan-right;" expected="pan-right pan-up"></div>
68 <div class="test" id="explicit-pan-down-pan-left" style="touch-action: p an-down pan-left;" expected="pan-left pan-down"></div>
69 <div class="test" id="explicit-pan-down-pan-right" style="touch-action: pan-down pan-right;" expected="pan-right pan-down"></div>
70 <div class="test" id="explicit-manipulation" style="touch-action: manipu lation;" expected="manipulation"></div>
71 <div class="test" id="explicit-none" style="touch-action: none;" expecte d="none"></div>
72 <div class="test" id="explicit-invalid-1" style="touch-action: bogus;" e xpected="auto"></div>
73 <div class="test defnone" id="explicit-invalid-2" style="touch-action: a uto pan-x;" expected="none"></div>
74 <div class="test" id="explicit-invalid-3" style="touch-action: pan-y non e;" expected="auto"></div>
75 <div class="test" id="explicit-invalid-4" style="touch-action: pan-x pan -x;" expected="auto"></div>
76 <div class="test" id="explicit-invalid-5" style="touch-action: manipulat ion pan-x;" expected="auto"></div>
77 <div class="test" id="explicit-invalid-6" style="touch-action: pan-x pan -left;" expected="auto"></div>
78 <div class="test" id="explicit-invalid-7" style="touch-action: auto pan- left;" expected="auto"></div>
79 <div class="test" id="explicit-invalid-8" style="touch-action: none pan- left;" expected="auto"></div>
80 <div class="test" id="explicit-invalid-9" style="touch-action: pan-x pan -right;" expected="auto"></div>
81 <div class="test" id="explicit-invalid-10" style="touch-action: pan-y pa n-up;" expected="auto"></div>
82 <div class="test" id="explicit-invalid-11" style="touch-action: pan-y pa n-down;" expected="auto"></div>
83 <div class="test" id="explicit-invalid-12" style="touch-action: pan-left pan-right;" expected="auto"></div>
84 <div class="test" id="explicit-invalid-13" style="touch-action: pan-up p an-down;" expected="auto"></div>
85 <div style="touch-action: none;">
86 <div class="test" id="not-inherited" expected="auto"></div>
87 <div class="test" id="inherit" style="touch-action: inherit;" expected ="none"></div>
88 </div>
89 <div class="test defnone" id="initial" style="touch-action: initial;" ex pected="auto"></div>
100 </body> 90 </body>
101 </html> 91 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698