Re: [pointerevents] Should pointerover and pointerenter work on mobile? (#346)

> getCoalescedEvents is interesting (and probably hardly used, I've never heard of it and I've been around for a while). I see that it could be useful for calculating a better movement curve for example, but the handler still doesn't need to run more than once per rAF. No handler ever needs to run faster than the screen will re-draw, I believe.

Before we introduced getCoalescedEvents we had to actually send all the events (and maybe multiple in a frame) to the js (as say a drawing app wanted to see all the events to be able to draw a smooth(er) curve) and we couldn't just limit it to once per frame as calling the js event handler was the only way to deliver all the events back then and hence the hit-testing for all of them. But getCoalescedEvents API (that will be used for the drawing apps and others) allowed us to actually limit the hit-testing and dispatching one event per animation loop that you see today in Chrome.

> Seems like it does, because pointer-events: none disables JS pointer events, and pointer-events: auto enables them.

The part that I don't get regarding your proposal about `pointer-events` is the performance benefits. It's been quite some time that I looked at the Chromium code and particularly the hit-testing but "pointer-events: none" on parts of your page doesn't necessarily increase the performance of hit-testing. At the end users will touch the parts of the page that are interactive and you want them to interact with. So again `pointer-events: none` on some non-interactive elements (that users aren't going to touch anyway) isn't going to make things faster. If anything it might make it slower as we have to add layers for those regions and some special cases.

Anyhow, this is just all history. APIs can come and go and indeed change (although hardly due to compat issues). If there are enough interests in a particular subject or maybe the ergonomics of an API I'm sure other people will be onboard as well. I have to say I don't have much more to add here in terms of the future direction as I no longer actively work in Chrome. But feel free to file another issue outlining your proposal so others can chime in. This issue doesn't seem particularly relevant to what you have in mind regarding the ergonomics.

-- 
GitHub Notification of comment by NavidZ
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/346#issuecomment-759087732 using your GitHub account


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

Received on Tuesday, 12 January 2021 22:51:44 UTC