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

@mustaqahmed  Thank you for the explanation!

Does the "low-level" event mean internal event to handle default actions? I.e., DOM events exposed to the web may have different targets?

> Define target as follows:
>
> If event is a contextmenu event, or userEvent was dispatched while the corresponding pointer was captured, then let target be the target of userEvent.
>
> Otherwise **(event is a click or auxclick event for which userEvent is a pointerup event that was dispatched uncaptured) let target be the nearest common inclusive ancestor of the corresponding pointerdown and pointerup targets** in the DOM at the moment event is being dispatched.

Currently, Gecko uses same event instance to dispatch into the DOM and to handle default actions. Therefore, adjusting the pointer event target also changes the default action target. (Yeah, if current spec will become stable, Gecko needs to store the adjusted targets separately.)

-- 
GitHub Notification of comment by masayuki-nakano
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/508#issuecomment-2264574721 using your GitHub account


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

Received on Friday, 2 August 2024 05:16:00 UTC