Amazing set/releasePointerCapture. Part two.

Hi folks.

Unfortunately, I didn't find any discussions about
"set/releasePointerCapture. Part one" And would like to provide one
else non-obvious case.

function TargetOnPointerDown(event) {
  target.setPointerCapture(event.pointerId);
}
function TargetOnGotPointerCapture(event) {
  target.releasePointerCapture(event.pointerId);
}
function TargetOnLostPointerCapture(event) {
  target.setPointerCapture(event.pointerId);
}

User puts down mouse on target and then moves around.
After pointerdown, browser tried to send pointermove event. But:
According point 5.2.1 in specification gotpointercapture should be
fired before any other pointer events.
Browser send gotpointercapture and in this place releasePointerCapture
was called.
According point 5.2.12 in specification lostpointercapture should be
fired before other pointer events too.
Browser send lostpointercapture and in this place setPointerCapture was called.

When user receive pointermove event? Looks like, in this test case we have loop.

Thanks, Maksim Lebedev.

Received on Friday, 26 September 2014 16:33:23 UTC