[pointerevents] Clarify `pointercancel` event target for drag start if the hit-testing result is different document from `dragstart` target (#552)

masayuki-nakano has just created a new issue for https://github.com/w3c/pointerevents:

== Clarify `pointercancel` event target for drag start if the hit-testing result is different document from `dragstart` target ==
The `pointercancel` event target is defined as same as the other pointer events by ["fire a pointer event"](https://w3c.github.io/pointerevents/#dfn-fire-a-pointer-event).

> * If the [pointer capture target override](https://w3c.github.io/pointerevents/#dfn-pointer-capture-target-override) has been set for the pointer, set the target to [pointer capture target override](https://w3c.github.io/pointerevents/#dfn-pointer-capture-target-override) object.
> * Otherwise, set the target to the object returned by normal [hit test](https://w3c.github.io/pointerevents/#dfn-hit-test) mechanisms (out of scope for this specification).

If `pointercancel` is caused by staring a drag session of mouse, it follows `dragstart` and usually it's not captured by the pointer capture API. Therefore, the target should be considered by the second one of the definition, i.e., considered with a hit-testing.

In edge cases, another document may be under another document which is different from the document received the preceding `pointerdown` and `dragstart`. In this case, `pointercancel` event should be fired on:
* root element or the document node which received `pointerdown` if the pointer is canceled outside the document
* the `<iframe>` element if the pointer is over a child document

The reason is, `pointercanel` is required for aborting to handle the pointer maybe started by `pointerdown` event listener.

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


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

Received on Thursday, 15 May 2025 00:51:43 UTC