Skip to content
Permalink
Browse files

Merge branch 'InternetExplorer-submission/Microsoft/PointerEvents'

  • Loading branch information...
jacobrossi committed Jun 3, 2014
2 parents a2389cf + 93cd6e1 commit b1b700d57d3de857d636212d69fdbe6e12ca68be
Showing with 4,629 additions and 180 deletions.
  1. +0 −180 pointerevents/pointerdown.html
  2. +59 −0 pointerevents/pointerevent_button_attribute_mouse.html
  3. +125 −0 pointerevents/pointerevent_capture_mouse.html
  4. +168 −0 pointerevents/pointerevent_capture_suppressing_mouse.html
  5. +137 −0 pointerevents/pointerevent_change-touch-action-onpointerdown_touch.html
  6. +90 −0 pointerevents/pointerevent_gotpointercapture_before_first_pointerevent.html
  7. +141 −0 pointerevents/pointerevent_lostpointercapture_is_first.html
  8. +78 −0 pointerevents/pointerevent_pointercancel_touch.html
  9. +60 −0 pointerevents/pointerevent_pointerdown.html
  10. +52 −0 pointerevents/pointerevent_pointerenter.html
  11. +89 −0 pointerevents/pointerevent_pointerenter_does_not_bubble.html
  12. +68 −0 pointerevents/pointerevent_pointerenter_nohover.html
  13. +61 −0 pointerevents/pointerevent_pointerleave_descendant_over.html
  14. +54 −0 pointerevents/pointerevent_pointerleave_descendants.html
  15. +78 −0 pointerevents/pointerevent_pointerleave_does_not_bubble.html
  16. +53 −0 pointerevents/pointerevent_pointerleave_mouse.html
  17. +53 −0 pointerevents/pointerevent_pointerleave_pen.html
  18. +53 −0 pointerevents/pointerevent_pointerleave_touch.html
  19. +69 −0 pointerevents/pointerevent_pointermove_isprimary_same_as_pointerdown.html
  20. +65 −0 pointerevents/pointerevent_pointermove_pointertype.html
  21. +46 −0 pointerevents/pointerevent_pointerout.html
  22. +55 −0 pointerevents/pointerevent_pointerout_received_once.html
  23. +53 −0 pointerevents/pointerevent_pointerover.html
  24. +64 −0 pointerevents/pointerevent_pointertype_mouse.html
  25. +61 −0 pointerevents/pointerevent_pointertype_pen.html
  26. +62 −0 pointerevents/pointerevent_pointertype_touch.html
  27. +44 −0 pointerevents/pointerevent_pointerup.html
  28. +121 −0 pointerevents/pointerevent_releasepointercapture_events_to_original_target.html
  29. +76 −0 pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html
  30. +71 −0 pointerevents/pointerevent_releasepointercapture_onpointercancel_touch.html
  31. +79 −0 pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html
  32. +59 −0 pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html
  33. +65 −0 pointerevents/pointerevent_setpointercapture_invalid_pointerid.html
  34. +92 −0 pointerevents/pointerevent_setpointercapture_relatedtarget.html
  35. +57 −0 pointerevents/pointerevent_styles.css
  36. +166 −0 pointerevents/pointerevent_support.js
  37. +129 −0 pointerevents/pointerevent_touch-action-auto-css_touch.html
  38. +67 −0 pointerevents/pointerevent_touch-action-illegal.html
  39. +133 −0 pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch.html
  40. +128 −0 pointerevents/pointerevent_touch-action-inherit_child-none_touch.html
  41. +148 −0 pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-x_touch.html
  42. +133 −0 pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch.html
  43. +133 −0 pointerevents/pointerevent_touch-action-inherit_highest-parent-none_touch.html
  44. +127 −0 pointerevents/pointerevent_touch-action-inherit_parent-none_touch.html
  45. +132 −0 pointerevents/pointerevent_touch-action-keyboard.html
  46. +130 −0 pointerevents/pointerevent_touch-action-mouse.html
  47. +118 −0 pointerevents/pointerevent_touch-action-none-css_touch.html
  48. +133 −0 pointerevents/pointerevent_touch-action-pan-x-css_touch.html
  49. +135 −0 pointerevents/pointerevent_touch-action-pan-x-pan-y-pan-y_touch.html
  50. +126 −0 pointerevents/pointerevent_touch-action-pan-x-pan-y_touch.html
  51. +133 −0 pointerevents/pointerevent_touch-action-pan-y-css_touch.html

This file was deleted.

@@ -0,0 +1,59 @@
<!doctype html>
<html>
<head>
<title>Button and buttons attribute test for mouse</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="http://w3c-test.org/resources/testharness.js"></script>
<script src="http://w3c-test.org/resources/testharnessreport.js"></script>
<script type="text/javascript" src="pointerevent_support.js"></script>
</head>
<body onload="run()">
<h1>Button attribute test for mouse</h1>
<h2>This test is for mouse only</h2>
<h4>
Test Description: This test checks if button attribute for mouse handled properly.
<p>Put your mouse over the black rectangle</p>
</h4>
<p>
<div id="target0" style="background:black"></div>
<script>
var eventTested = false;
var detected_pointertypes = {};
setup({ explicit_done: true });
add_completion_callback(showPointerTypes);
function run() {
var target0 = document.getElementById("target0");
// If pointerType is "mouse" and no mouse button is depressed, then the button attribute of the pointermove event must be -1 and the buttons attribute must be 0.
// TA: 5.8
on_event(target0, "pointerover", function (event) {
if(event.pointerType != "mouse") {
alert("Use mouse for this test please!");
return;
}
if (eventTested == false) {
detected_pointertypes[event.pointerType] = true;
test(function() {
assert_true(event.button == -1, "If mouse buttons are released button attribute is -1")
}, "If mouse buttons are released button attribute is -1");
test(function() {
assert_true(event.buttons == 0, "If mouse buttons are released buttons attribute is 0")
}, "If mouse buttons are released buttons attribute is 0");
eventTested = true;
done();
}
});
}
</script>
<h1>Pointer Events button attribute test for mouse test</h1>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>Would you like to <a href="#">run the tests again</a> with a different pointer type?</p>
</div>
<div id="log"></div>
</body>
</html>
@@ -0,0 +1,125 @@
<!doctype html>
<html>
<head>
<title>Set/Release capture</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="http://w3c-test.org/resources/testharness.js"></script>
<script src="http://w3c-test.org/resources/testharnessreport.js"></script>
<!-- Additional helper script for common checks across event types -->
<script type="text/javascript" src="pointerevent_support.js"></script>
</head>
<body>
<h1>Pointer Events capture test</h1>
<h4>
Test Description: This test checks if setCapture/releaseCapture functions works properly. Complete the following actions:
<ol>
<li> Move your mouse over the black rectangle. pointermove event should be logged in the black rectangle</li>
<li> Move your mouse over the purple rectangle. pointerover event should be logged in the purple rectangle</li>
<li> Press and hold left mouse button over "Set Capture" button. "gotpointercapture" should be logged in the black rectangle</li>
<li> Move your mouse anywhere. pointermove should be logged in the black rectangle</li>
<li> Move your mouse over the purple rectangle. Nothig should happen</li>
<li> Move your mouse over the black rectangle. pointermove should be logged in the black rectangle</li>
<li> Release left mouse button. "lostpointercapture" should be logged in the black rectangle</li>
</ol>
</h4>
Test passes if the proper behaviour of the events is observed.
<div id="target0"></div>
<br>
<div id="target1"></div>
<br>
<input type="button" id="btnCapture" value="Set Capture">
<script type='text/javascript'>
var isPointerCapture = false;
var pointermoveNoCaptureGot0 = false;
var pointermoveCaptureGot0 = false;
var pointermoveNoCaptureGot1 = false;
var ownEventForTheCapturedTargetGot = false;
var count=0;
var target0 = document.getElementById('target0');
var target1 = document.getElementById('target1');
var captureButton = document.getElementById('btnCapture');
var test_gotpointercapture = async_test("gotpointercapture event received");
var test_lostpointercapture = async_test("lostpointercapture event received");
window.onload = function() {
on_event(captureButton, 'pointerdown', function(e) {
if(isPointerCapture == false) {
sPointerCapture(e);
}
});
on_event(target0, 'gotpointercapture', function(e) {
test_gotpointercapture.done();
log("gotpointercapture", target0);
});
on_event(target0, 'lostpointercapture', function(e) {
test_lostpointercapture.done();
isPointerCapture = false;
log("lostpointercapture", target0);
});
run();
}
function run() {
var test_pointermove0 = async_test("pointerover event for black rectangle received")
var test_pointermove1 = async_test("pointerover event for purple rectangle received")
on_event(target0, "pointermove", function (event) {
if(!pointermoveNoCaptureGot0) {
test_pointermove0.done();
log("pointermove", document.getElementById('target0'));
pointermoveNoCaptureGot0 = true;
}
if(isPointerCapture) {
if(!pointermoveCaptureGot0) {
test(function() {
assert_true(event.relatedTarget==null, "relatedTarget is null when the capture is set")
}, "relatedTarget is null when the capture is set. relatedTarget is " + event.relatedTarget);
test(function() {
assert_true((event.clientX < target0.getBoundingClientRect().left)||
(event.clientX > target0.getBoundingClientRect().right)||
(event.clientY < target0.getBoundingClientRect().top)||
(event.clientY > target0.getBoundingClientRect().bottom),
"pointermove received for captured element while out of it")
}, "pointermove received for captured element while out of it");
log("pointermove", document.getElementById('target0'));
pointermoveCaptureGot0 = true;
}
if((event.clientX > target0.getBoundingClientRect().left)&&
(event.clientX < target0.getBoundingClientRect().right)&&
(event.clientY > target0.getBoundingClientRect().top)&&
(event.clientY < target0.getBoundingClientRect().bottom)&&
!ownEventForTheCapturedTargetGot) {
test(function() {
assert_true(true, "pointermove received for captured element while inside of it");
}, "pointermove received for captured element while inside of it");
log("pointermove", document.getElementById('target0'));
ownEventForTheCapturedTargetGot = true;
}
}
});
on_event(target1, "pointermove", function (event) {
if(isPointerCapture == true) {
test(function() {
assert_unreached("pointermove shouldn't trigger for this target when capture is enabled");
}, "pointermove shouldn't trigger for the purple rectangle while the black rectangle has capture");
}
if(!pointermoveNoCaptureGot1) {
test_pointermove1.done();
log("pointermove", document.getElementById('target1'));
pointermoveNoCaptureGot1 = true;
}
});
}
</script>
<h1>Pointer Events Capture Test</h1>
<div id="complete-notice"></div>
<div id="log"></div>
</body>
</html>

1 comment on commit b1b700d

@jacobrossi

This comment has been minimized.

Copy link
Contributor Author

commented on b1b700d Jun 3, 2014

Please sign in to comment.
You can’t perform that action at this time.