[pointerevents] Release Implicit Capture, Capture at Ancestor Element (#327)

msalsbery has just created a new issue for https://github.com/w3c/pointerevents:

== Release Implicit Capture, Capture at Ancestor Element ==
Scenario: A parent and a child element, both with pointerdown event handlers. Depending on application's need, when a pointerdown occurs on the child, it should be ignored and the parent (when pointer down bubbles) will want to capture the pointer:

1. pointerdown on child
1. child calls hasPointerCapture and determines pointer is captured implicitly (touch)
1. child immediately calls releasePointerCapture
1. pointerdown bubbles to parent
1. Parent calls setPointerCapture
1. Parent processes pointermove events until pointerup, pointercancel, or lostpointercapture

The way the [W3C Implicit Pointer Capture docs](https://w3c.github.io/pointerevents/#implicit-pointer-capture) read to me, this should be a reasonable approach.

When there's no implicit capture (mouse device, for example) there's no issue. It works great.

With touch and implicit capture on pointerdown, however, this does not work (only tested on iOS Safari/Firefox/Chrome/Chromium Edge so far). While the gotpointercapture events indicate the parent received capture, the pointermove/pointerup events following capture are not targeted to the parent - in other words, the parent never really got capture. pointermove/pointerup events outside the parent cease, instead of continuing like they should when an element has a pointer captured.

Is this something that should be doable? Should it work as described and the implementation in the browsers is flawed, or is the approach flawed?

Thank you!


Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/327 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 11 August 2020 21:03:09 UTC