pointerevent_pointerenter-manual.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>Pointer Event: Dispatch pointerenter. </title>
  5. <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
  6. <link rel="author" title="Microsoft" href="http://www.microsoft.com/"/>
  7. <meta name="assert" content="When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerenter event must be dispatched."/>
  8. <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
  9. <!-- /resources/testharness.js -->
  10. <script src="/resources/testharness.js"></script>
  11. <!--script src="/resources/testharnessreport.js"></script-->
  12. <!-- Additional helper script for common checks across event types -->
  13. <script type="text/javascript" src="pointerevent_support.js"></script>
  14. <script type="text/javascript" src="mochitest_support_internal.js"></script>
  15. <script type="text/javascript">
  16. var detected_pointertypes = {};
  17. var test_pointerEvent = async_test("pointerenter event"); // set up test harness
  18. // showPointerTypes is defined in pointerevent_support.js
  19. // Requirements: the callback function will reference the test_pointerEvent object and
  20. // will fail unless the async_test is created with the var name "test_pointerEvent".
  21. add_completion_callback(showPointerTypes);
  22. function run() {
  23. var target0 = document.getElementById("target0");
  24. on_event(target0, "pointerenter", function (event) {
  25. detected_pointertypes[event.pointerType] = true;
  26. check_PointerEvent(event);
  27. test_pointerEvent.step(function () {
  28. assert_equals(event.type, "pointerenter", "pointer event received: " + event.type);
  29. });
  30. test_pointerEvent.done(); // complete test
  31. });
  32. }
  33. </script>
  34. </head>
  35. <body onload="run()">
  36. <h1>Pointer Event: Dispatch pointerenter</h1>
  37. <h4>
  38. Test Description:
  39. When a pointing device is moved into the hit test boundaries of an element or one of its descendants, the pointerenter event must be dispatched.
  40. </h4>
  41. <div id="target0">
  42. Use the mouse or pen to move over this box.
  43. </div>
  44. <div id="complete-notice">
  45. <p>Test complete: Scroll to Summary to view Pass/Fail Results.</p>
  46. <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
  47. <p>Refresh the page to run the tests again with a different pointer type.</p>
  48. </div>
  49. <div id="log"></div>
  50. </body>
  51. </html>