Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!doctype html>
<title>Pointer Event: Boundary event sequence at implicit capture release</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="author" title="Google" href=" "/>
<meta name="assert" content="When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event."/>
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script type="text/javascript" src="pointerevent_support.js"></script>
<script type="text/javascript">
var detected_pointertypes = {};
var event_log = [];
var start_logging = false;
function resetTestState() {
detected_eventTypes = {};
event_log = [];
start_logging = false;
function run() {
var test_pointer_event = setup_pointerevent_test("Event sequence at implicit release on click", ["mouse"]);
var actions_promise;
var target = document.getElementById("target");
var capture_target = document.getElementById("capture-target");
All_Pointer_Events.forEach(function(eventName) {
on_event(target, eventName, function (event) {
detected_pointertypes[event.pointerType] = true;
if (event.type == "pointerdown") {
start_logging = true;
} else if (start_logging) {
event_log.push(event.type + '@' +;
on_event(capture_target, eventName, function (event) {
detected_pointertypes[event.pointerType] = true;
event_log.push(event.type + '@' +;
if (event.type == 'lostpointercapture') {
step_timeout(function() {
test_pointer_event.step(function () {
var expected_events = "pointerup, lostpointercapture, pointerout, pointerleave";
assert_equals(event_log.join(", "), "pointerout@target, pointerleave@target, pointerover@capture-target, pointerenter@capture-target, gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target, pointerout@capture-target, pointerleave@capture-target, pointerover@target, pointerenter@target");
// Make sure the test finishes after all the input actions are completed.
actions_promise.then( () => {
}, 200);
// Inject mouse inputs.
actions_promise = new test_driver.Actions()
.pointerMove(0, 0, {origin: target})
#target {
margin: 20px;
background-color: black;
<body onload="run()">
<h1>Pointer Event: Boundary event sequence at implicit capture release</h1>
<h2 id="pointerTypeDescription"></h2>
When a captured pointer is implicitly released after a click, the boundary events should follow the lostpointercapture event.
<li>Click on the black box with mouse and do not move the mouse after or during the click.</li>
<div id="capture-target"></div>
<div id="target"></div>
<div id="complete-notice">
<p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
<p>The following events were logged: <span id="event-log"></span>.</p>
<div id="log"></div>