OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Pointer Events properties tests</title> |
| 5 <meta name="viewport" content="width=device-width"> |
| 6 <link rel="stylesheet" type="text/css" href="pointerevent_styles.css"> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <!-- Additional helper script for common checks across event types --> |
| 10 <script type="text/javascript" src="pointerevent_support.js"></script> |
| 11 <script> |
| 12 var detected_pointertypes = {}; |
| 13 var detected_eventTypes = {}; |
| 14 var eventList = ['pointerout', 'pointerover', 'pointerenter', 'point
ermove', 'pointerdown', 'pointerup', 'pointerleave']; |
| 15 |
| 16 function resetTestState() { |
| 17 detected_eventTypes = {}; |
| 18 } |
| 19 function run() { |
| 20 var test_pointerEvent = setup_pointerevent_test("pointerevent at
tributes", ALL_POINTERS); |
| 21 var target = document.getElementById("target0"); |
| 22 |
| 23 eventList.forEach(function(eventName) { |
| 24 on_event(target, eventName, function (event) { |
| 25 detected_eventTypes[event.type] = true; |
| 26 detected_pointertypes[event.pointerType] = true; |
| 27 |
| 28 if (Object.keys(detected_eventTypes).length == eventList
.length) { |
| 29 test_pointerEvent.done(); |
| 30 } |
| 31 }); |
| 32 }); |
| 33 on_event(target, "click", function (event) { |
| 34 assert_unreached("click should not fire on disabled element"
); |
| 35 }); |
| 36 } |
| 37 </script> |
| 38 <style> |
| 39 #target0 { |
| 40 background: purple; |
| 41 border: 1px solid orange; |
| 42 touch-action: none; |
| 43 width: 200px; |
| 44 height: 100px; |
| 45 } |
| 46 </style> |
| 47 </head> |
| 48 <body onload="run()"> |
| 49 <h1> Pointer Event: pointerevents fire to disabled form controls</h1> |
| 50 <h2 id="pointerTypeDescription"></h2> |
| 51 <h4> |
| 52 Test Description: |
| 53 Pointerevents are dispatched to disabled form controls. |
| 54 </h4> |
| 55 <div id="instructions"> |
| 56 Use the mouse or pen to press on the purple button. Or with touch, t
ap on the purple box. |
| 57 </div> |
| 58 <button id="target0" disabled>Disabled button</button> |
| 59 <div id="complete-notice"> |
| 60 <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p> |
| 61 <p>The following pointer types were detected: <span id="pointertype-
log"></span>.</p> |
| 62 <p>Refresh the page to run the tests again with a different pointer
type.</p> |
| 63 </div> |
| 64 <div id="log"></div> |
| 65 </body> |
| 66 </html> |
OLD | NEW |