Intent to Implement and ship: Fractional coordinates in PointerEvents of type mouse

60 views
Skip to first unread message

Ella Ge

unread,
Oct 11, 2017, 2:55:06 PM10/11/17
to blink-dev

Contact emails

eir...@chromium.org


Spec

https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface


Summary

PointerEvent of type “mouse” expose fractional coordinates.


Motivation

In M56, we exposed fractional coordinates for PointerEvents of type “touch”, to avoid possible loss in precision (caused by truncating to integers) particularly in modern mobile hardware where one CSS px unit represents multiple device pixels.  We deferred the case of type “mouse” because of the amount of work involved, see discussions in intent.


Now we are ready to ship fractional coordinates for PointerEvent type “mouse” to match Edge.


Compatibility and Interoperability Risks

The risk is pretty low since Edge/IE already have fractional coordinates in all PointerEvents for a while, for all pointerTypes including “mouse”.  Tested in IE 11 and Edge 40.

Moreover, we already have fractional coordinates for PointerEvents of type “touch” since M56.  


Firefox & Safari don’t support PointerEvents yet.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5117956774166528


Requesting approval to ship?

Yes



--
Ella

Rick Byers

unread,
Oct 11, 2017, 9:34:29 PM10/11/17
to Ella Ge, blink-dev
LGTM1, but please be on the lookout for reports of breakage and be prepared to revert temporarily to understand the risk if we see non-trivial signs of breakage.  

This is one of those cases where I don't think we can do much to quantify the impacted page views or sites other than try to ship, but Edge's experience and our experience with Touch is likely to be representative.  With the Touch change I remember we found a couple sites that were using co-ordinates as an array index.  If we see this happen for Mouse, then we might want to try to quantify how popular the specific libraries that do this are before proceeding.

Just to confirm, you believe you're matching the Edge behavior exactly, right?  i.e. "click" is still just a MouseEvent and so gets truncated co-ordinates (like other non-PointerEvent MouseEvents).


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGbAJuH0haQB37e1uBS%3DhGP5bGQbj6d%2Bbv7MQNJm8gUsX8XWpg%40mail.gmail.com.

Mustaq Ahmed

unread,
Oct 12, 2017, 11:52:10 AM10/12/17
to Rick Byers, Ella Ge, blink-dev
Ella just confirmed to me offline that "click" coordinates are integers as before.  So yes, we are matching Edge for "click" coordinates too.

Note, however, that Edge's "click" event is a PointerEvent which we have no plan to match.

Philip Jägenstedt

unread,
Oct 13, 2017, 8:36:33 AM10/13/17
to Mustaq Ahmed, Rick Byers, Ella Ge, blink-dev
LGTM2, even if "click" events will continue to be different, this is still a step closer to interop.

Can this change be tested in web-platform-tests, or is it perhaps already?

Mustaq Ahmed

unread,
Oct 13, 2017, 10:21:20 AM10/13/17
to Philip Jägenstedt, Rick Byers, Ella Ge, blink-dev
Looks like we currently have no PointerEvent web-platform-tests to test this.  It's not clear to me if we can do it right away without a PointerEvent spec change since these fractional coordinates are implicitly defined through the CSS OM View spec instead.

I just asked the same question in this github issue, let's continue the test discussion there.

Dimitri Glazkov

unread,
Oct 13, 2017, 11:58:17 AM10/13/17
to Mustaq Ahmed, Philip Jägenstedt, Rick Byers, Ella Ge, blink-dev
Reply all
Reply to author
Forward
0 new messages