liviu...@chromium.org, mus...@chromium.org, nzol...@chromium.org
Make “click”, “contextmenu” and “auxlick” instances of PointerEvents (instead of MouseEvents), to allow web apps to identify the source of such events in a multi-pointer environment (with mouse, pen and multitouch capabilities), and utilize fractional coordinates. No other aspect of these events or their dispatch mechanism would be changed.
(The “dblclick” event remains unchanged because it is considered a legacy event.)
The change proposed here covers three different specs which are in a “mixed” state now:
The UI Events Spec defines “click” and “auxlick” as events of “Mouse Event Type” based on the PointerEvent interface (updated through this pull request). This looks like a minor wording problem, modulo the fact that the definition should ideally reside in the PointerEvent spec.
The HTML spec has a pending pull request blocked on compat study. See Compat Study and Risks sections below for more details.
The PointerEvent spec has a pending pull request blocked on compat study.
No spec defines the “contextmenu” event, and major browsers expose it as a MouseEvent (spec issue).
Change “click”, “contextmenu”, “auxlick” events to PointerEvent (instead of MouseEvent) to let developers: distinguish between mouse, pen and individual fingers in a multitouch interaction through pointerType and pointerId attributes, and utilize fractional event coordinates for high precision use cases.
There were concerns about compat implications of this change but our compat study (see below) does not support those concerns.
The “click” and “contextmenu” events were defined as MouseEvents decades ago when a mouse was the only source of pointer-like events. The “auxclick” event was defined similarly only a few years ago. The ability to distinguish these events by input source in a multi-pointer environment is a long-standing developer request (e.g. this MSDN request). PointerEvents spec discussion reached consensus that it would be a useful change and also expressed compat concerns.
Compat study
To better understand compat implications, Chrome committed to experimenting in the wild. We made the change available as an experimental web-platform feature in Sep 2019, started a Finch experiment in Canary in Aug 2020, and gradually expanded the scope of the experiment to cover Canary, Dev and Beta by Nov 3rd 2020. We have been running weekly “bug hunting” sessions to spot any related bug report, so far didn’t find any.
Demo link
New event properties available now (pointerType, pointerId, fractional coordinates, etc) could be viewed through https://rbyers.github.io/eventTest.html or any event inspection tools (including DevTools). Chrome needs to be started with the command-line switch --enable-blink-features=ClickPointerEvent
The tag review process is being skipped because this change does not involve any design decision.
Not applicable
The availability of new event attributes (pointerType, pointerId) in “click”, “contextmenu” and “auxlick” won’t pose any compat risk. For interop, any app that would rely on these PointerEvent attributes would work on an unsupported browser (where these events are MouseEvents) if the app remembers the corresponding attributes in the last “pointerdown” or “pointerup” event before the “click”/“contextmenu”/“auxlick” event.
There are compatibility concerns with switching the event coordinates to floating point numbers. So far we know about a single case that Microsoft Edge faced many years ago with Microsoft Ajax framework; that particular repro works fine with Chrome changes. We are not aware of any breakage caused by either our ongoing finch trial or our experimental feature status.
Gecko: Request for Position
WebKit: Request for Position
Web developers: No signals
Yes.
Yes.
pointerevents/pointerevent_click_is_a_pointerevent.html
pointerevents/pointerevent_auxclick_is_a_pointerevent.html
pointerevents/pointerevent_contextmenu_is_a_pointerevent.html
uievents/interface/click-event.htm
https://www.chromestatus.com/feature/5670732015075328
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHaAqYJdaq6SsmMNT3oDBqZGv_DgMh3x5yebJ-Ykyvvp4iF3tQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY9gPm-N2bVj0FsSO6p7g%2BUmKf05FeQsO8cfF6iPJX5SJQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw9UE75qVii5MiW9uRp6wmJO8Z34Rvsp%3Dr4O4ar4mMnFDw%40mail.gmail.com.
click
, auxclick
and contextmenu
events will be instances of PointerEvents but their coordinates will be integers like before (like MouseEvents).To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f3cf21ba-c52b-466e-a975-11b96238d5f8n%40chromium.org.