[pointerevents] Clarify what event is `userEvent` to consider `click`/`auxclick` event target after `touchend` (or `pointerup`) (#508)

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

== Clarify what event is `userEvent` to consider `click`/`auxclick` event target after `touchend` (or `pointerup`) ==
Pointer Events [defines](https://w3c.github.io/pointerevents/#event-dispatch) that `click`/`auxclick` event target is:

> 2. If userEvent is not a PointerEvent, dispatch event following the [[UIEVENTS](https://w3c.github.io/pointerevents/#bib-uievents)] spec without overriding event target and skip the remaining steps below.
> 3. If event is a contextmenu event, or userEvent was dispatched while the corresponding pointer was captured, then let target be the target of userEvent.

and `userEvent` is defined as:

> userEvent be the user interaction event that caused the firing of event.

If you touch the device with a single input, `touchstart` and `touchend` may cause compatibility mouse events, `mousemove`, `mousedown` and `mouseup`. However, web apps consumes `pointerdown` or `touchstart`, the compatibility mouse events are not fired. Therefore, `userEvent` may be `pointerup`, `touchend` or `mouseup`. The compatibility mouse event target is [defined](https://w3c.github.io/touch-events/#mouse-events) as the element at the `touchend` position. The `touchend` event target is [defined](https://w3c.github.io/touch-events/#event-touchend) as the element which is the target of `touchstart`. So, these events may be targeted different elements. Therefore, `click`/`auxclick` event target may be different from which event is `userEvent`.

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


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

Received on Tuesday, 18 June 2024 00:27:24 UTC