Intent to Ship: Unified Touch adjustment

114 views
Skip to first unread message

Ella Ge

unread,
Mar 23, 2018, 4:59:33 PM3/23/18
to blink-dev

Contact emails

eir...@chromium.org


Design doc/Spec

Unified Touch adjustment plan


Summary

Move touch adjustment to the “touchstart” event, use this adjusted target for the subsequent touch events. Apply the adjusted point to corresponding gesture event, so that touch events and synthesized mouse events should be dispatched to the same node. Apply an upper bound of 16 dips to touch adjustment range for both desktop and mobile.


See the design doc for specific finch trial results.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/touch$20adjustment/blink-dev/VjFBlOBwkmY/rDS04njmCAAJ


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

Yes


Demo link

http://output.jsbin.com/losawen/quiet


Debuggability

Yes. Developers should have an improved experience because the targets synthesized mouse events and touch events should be the same now.


Risks

Interoperability and Compatibility

Touch adjustment is not spec’ed feature. It’s hard to interop. The risk should be low since it’s a minor change and it’s not very visible to users. Finch data shows that about 98% of events currently dispatched would be dispatched exactly the same with the proposed changes.

 

Edge:  Adjust both coordinates and targets for touchevents & click events

Firefox: No touch adjustment at all

Safari: Adjusts ‘click’ target and coordinates, no adjustment on touch events (Chrome’s previous behavior)

Web developers: No signals

 

Ergonomics

N/a.

 

Activation

N/a. This is not an api change but a behaviour change of an existing feature. No code needs to change for current websites. It’s more like a bug fixing to users since they wouldn’t expect synthesized mouseevent target is different from touchevent target.


Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.

No.


Entry on the feature dashboard

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




--
Ella Ge

Daniel Bratell

unread,
Mar 26, 2018, 1:28:05 PM3/26/18
to blink-dev, Ella Ge
Makes sense. I had some trouble changing 16 dip to a physical size though. Is it a static size for all platforms? (Some site claimed a definition of dip that would make 16 dip mean 2.5 mm on Android and 4.5 mm on a Windows laptop and I think it can be assumed that Android and Windows users have equivalent fingers).

Possibly it would be better to change the coordinates as well to create internal consistency. Yes, it might forever snap a click between elements to an element nearby but will that surprise a site developer more or less than the coordinates being outside the element?

What happens if someone uses a stylus and suddenly get a much higher precision and accuracy?

/Daniel
--
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/CAGbAJuFYzRXwGZ%3Dxo8K_78-pq95nH03u2zNHD36jL0EmcqL-2Q%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

eir...@chromium.org

unread,
Mar 26, 2018, 2:52:30 PM3/26/18
to blink-dev, eir...@chromium.org


On Monday, March 26, 2018 at 9:28:05 AM UTC-4, Daniel Bratell wrote:
Makes sense. I had some trouble changing 16 dip to a physical size though. Is it a static size for all platforms? (Some site claimed a definition of dip that would make 16 dip mean 2.5 mm on Android and 4.5 mm on a Windows laptop and I think it can be assumed that Android and Windows users have equivalent fingers).

From my understanding, dip is not a static physical size. But 16 dip is larger in laptop than mobile device sounds reasonable since mobile device has smaller screen and elements are closer to each other. 
 
Possibly it would be better to change the coordinates as well to create internal consistency. Yes, it might forever snap a click between elements to an element nearby but will that surprise a site developer more or less than the coordinates being outside the element?

If the event coordinates is also changed, the original touch point becomes totally concealed from developers. I think it's not good.

 
What happens if someone uses a stylus and suddenly get a much higher precision and accuracy?

adjustment for stylus is disabled earlier.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Ojan Vafai

unread,
Mar 26, 2018, 6:18:27 PM3/26/18
to eir...@chromium.org, blink-dev
LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Chris Harrelson

unread,
Mar 26, 2018, 6:26:21 PM3/26/18
to Ella Ge, blink-dev
Hi,

Was any progress made on specifying the behavior here? In particular, see my response on the intent-to-implement thread for the kind of spec I have in mind.

Thanks,
Chris

On Mon, Mar 26, 2018 at 7:52 AM <eir...@chromium.org> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
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/0093e72d-2360-479d-9c9e-8c46d7b44b3b%40chromium.org.

eir...@chromium.org

unread,
Mar 28, 2018, 7:50:59 PM3/28/18
to blink-dev, eir...@chromium.org, chri...@chromium.org


On Monday, March 26, 2018 at 2:26:21 PM UTC-4, Chris Harrelson wrote:
Hi,

Was any progress made on specifying the behavior here? In particular, see my response on the intent-to-implement thread for the kind of spec I have in mind.

The hit targeting thing is not well specced anywhere, so I'm not sure if it's possible to specifying the behavior. I just open an issue with touch-event spec to see if we can add a not to let developer aware of the adjusting.
 
Thanks,
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
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+unsubscribe@chromium.org.

eir...@chromium.org

unread,
Mar 28, 2018, 7:55:43 PM3/28/18
to blink-dev, eir...@chromium.org
Btw, about the coordinates being outside the element part. Edge actually doesn't adjust click events coordinates but the implicitly capture the target to touch target. That means the click events coordinate is outside of element.
So I think our implementation which might cause pointerdown & touchstart coordinates being outside the element won't be too risky.

On Monday, March 26, 2018 at 9:28:05 AM UTC-4, Daniel Bratell wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Daniel Bratell

unread,
Mar 29, 2018, 6:54:29 AM3/29/18
to blink-dev, eir...@chromium.org
LGTM2
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */
--
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/6937165e-457b-4d3d-b8db-1170e89be501%40chromium.org.

Chris Harrelson

unread,
Mar 29, 2018, 4:42:54 PM3/29/18
to Ella Ge, blink-dev
On Wed, Mar 28, 2018 at 12:51 PM <eir...@chromium.org> wrote:


On Monday, March 26, 2018 at 2:26:21 PM UTC-4, Chris Harrelson wrote:
Hi,

Was any progress made on specifying the behavior here? In particular, see my response on the intent-to-implement thread for the kind of spec I have in mind.

The hit targeting thing is not well specced anywhere, so I'm not sure if it's possible to specifying the behavior. I just open an issue with touch-event spec to see if we can add a not to let developer aware of the adjusting.

In the intent to implement, I said that it seems possible/straightfoward to spec "what happens to the events generated as result of those adjustments" (as opposed to the algorithm for determining adjustment).

I am also concerned about an interop risk. Do other browsers think the approach you are proposing to ship is the right way to go? If not, this intent will decrease interop. The lack of WPT tests is also another signal of not moving towards interop.

 
Thanks,
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
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.

--
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/94813df3-982b-4f10-932e-4234bad8fb94%40chromium.org.

eir...@chromium.org

unread,
Mar 29, 2018, 5:37:24 PM3/29/18
to blink-dev, eir...@chromium.org, chri...@chromium.org


On Thursday, March 29, 2018 at 12:42:54 PM UTC-4, Chris Harrelson wrote:


On Wed, Mar 28, 2018 at 12:51 PM <eir...@chromium.org> wrote:


On Monday, March 26, 2018 at 2:26:21 PM UTC-4, Chris Harrelson wrote:
Hi,

Was any progress made on specifying the behavior here? In particular, see my response on the intent-to-implement thread for the kind of spec I have in mind.

The hit targeting thing is not well specced anywhere, so I'm not sure if it's possible to specifying the behavior. I just open an issue with touch-event spec to see if we can add a not to let developer aware of the adjusting.

In the intent to implement, I said that it seems possible/straightfoward to spec "what happens to the events generated as result of those adjustments" (as opposed to the algorithm for determining adjustment).

I am also concerned about an interop risk. Do other browsers think the approach you are proposing to ship is the right way to go? If not, this intent will decrease interop. The lack of WPT tests is also another signal of not moving towards interop.


Right. I didn't mean the "adjustment algorithm" but the "what happens to the events" part.I think by "what happens to the events", you mean "the event target and coordinates may be changed by UA"
I doubt that FF and Edge will support this proposal because FF doesn't have any touch adjustment and Edge have kinda opposite implementation. So keeping it as UA behavior might be the best thing we can do.

The previous implementation(adjust synthesized mouse events but not touch) wasn't spec'ed and no tested by WPT. So I think it won't increase the interop risk but maybe stay the same.
 
 
 
Thanks,
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
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+unsubscribe@chromium.org.

--
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+unsubscribe@chromium.org.

Rick Byers

unread,
May 2, 2018, 2:15:26 AM5/2/18
to Ella Ge, blink-dev, Chris Harrelson
I've avoided chiming in on this issue as an API owner because I was the one who originally argued for this design.  But I just want to say that I support trying this as a pragmatic step forward.  We've long lived with touch adjustment as a bit of a hack on the platform (mirroring mobile safari behavior), and for years hoped we could just deprecate adjustment entirely as a hack needed only for dealing with legacy desktop sites in a mobile browser.  But since we're now pretty convinced that adjustment is here to stay even for mobile-optimized pages, I'm really happy that Ella is working to rationalize the design.

Ella has added a non-normative note to the Touch Events spec, which given the IPR concerns around this space, is probably about the best we can hope for in any W3C spec for now.

There is some compat risk here, but I think it's probably minimal and counter-balanced by having a less surprising design.  In particular, rather than touch/pointer and click events being potentially inconsistent in targeting (which can lead to unsolvable problems in composition scenarios), adjustment now behaves just like a modification of (the long unspecified) hit-testing behavior (similar to how pointer capture does).  But, as always, let's keep our eyes open for reports of breakage and re-evaluate if there's anything non-trivial.

Rick


Chris Harrelson

unread,
May 2, 2018, 4:09:15 AM5/2/18
to Rick Byers, Ella Ge, blink-dev
Thanks Ella and Rick for the additional explanations and spec text, and for your patience.

LGTM3!

 
 
Thanks,
Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

--
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.

--
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.

--
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/e7ae75c7-6744-4b8f-88a5-7f20a598255f%40chromium.org.

--
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/CAFUtAY_NjLc7xMeGrtj0U_cngtUjb25_-f6D3OS%2BjgwnxgBO8A%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages