Contact emails
rby...@chromium.org, mus...@chromium.org
Summary
The Pointer Events API is a low-level input API for mouse, touch and stylus introduced by IE. Pointer Events extends the MouseEvent model while offering a replacement for all uses of Mouse and Touch events. Based on the feedback we’ve received, and the productive collaboration in the Pointer Events working group, I now believe we should implement this API in Blink.
Motivation
Last year we announced that, despite our involvement in the Pointer Events standard, we were going to focus on incremental improvements to existing APIs (like Touch Events), rather than implement Pointer Events in Chromium. Since then we’ve received a steady stream of feedback from web developers, framework authors, and other browser vendors indicating that they see Pointer Events as a highly valuable addition to the platform. Since we’re committed to a web platform which evolves collaboratively through open discussion and data from real-world development, we need to take this feedback very seriously.
During this same period, many of our outstanding technical concerns with the API have made progress towards being addressed. Enabling rich touch effects which interact with scrolling now has an official avenue for exploration within the W3C, and improvements to touch-action richness are planned within the PEWG. Mouse event compatibility issues with existing models for touch are being addressed (and planned for a future version of the PE spec). The PEWG has been responsive to feedback and we enjoy the productive and collaborative relationship we have with the the other members including representative from the IE, jQuery, Mozilla and Opera teams.
Pointer Events offers some technical advantages over the existing use of Touch Events and Mouse Events. Most notably, pointer event listeners never block scrolling, and so replacing all touch event handlers with pointer event handlers will address the main longstanding source of scroll-start jank we see on Android (irrespective of whatever scheduler improvements we’re able to make to better prioritize input handling).
Compatibility Risk
IE: Public support (shipping since IE10)
Firefox: Public support (implemented behind a flag)
Safari: Publicly opposed
Web developers: Mostly positive public support, including jQuery and Dojo
Pointer Events has pretty broad support, but we have some outstanding concerns with the existing API which probably cannot be addressed without a non-trivial breaking change (see below for details). The key outstanding challenge is to try to identify a design which addresses our concerns without seriously breaking websites which support the existing API. We will of course work closely with the other vendors to try to find a design we can all agree to implement consistently.
We don’t expect Touch Events to go away in the foreseeable future, but with IE adding support for Touch Events, they’ve shown that it’s possible to support both models simultaneously without serious web compat impact. Jacob Rossi on the IE team has been very helpful (through his investment in the Touch Events Community Group), helping us understand their experience with Touch Events and the interaction with Pointer Events. I’m confident that we can come to a consensus on a model for pointer, touch and mouse events that is highly interoperable between IE, Chrome and Firefox, while remaining compatible with Safari’s implementation of touch and mouse events.
Ongoing technical constraints
Pointer Events as currently defined requires a hit-test on every pointermove (as is the case for mousemove, but not touchmove). This imposes a performance cost on the engine which the major native mobile platforms and browsers don’t have. I intend to work with the PEWG to identify some (probably breaking) API changes to allow us to avoid this cost for touch by default. This will be challenging to do without substantial compat pain, but I’m optimistic some solution can be reached to enable us to support Pointer Events without committing to this performance constraint.
Also implementing the desired performance properties of Pointer Events means we must be able to do accurate touch-action hit-testing on the impl thread. This is work we planned to do anyway for ‘scroll-blocks-on: none’, and is expected to be easy once CC operates in terms of display lists instead of layers.
Spec
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug?
Link to entry on the feature dashboard
https://www.chromestatus.com/features/4504699138998272
Requesting approval to ship?
No. Implementation is expected to take some time.
This is exciting! Obviously, we fully support you here. Rick and I had the opportunity to discuss some of the technical constraints and ideas on how we can make some improvements to advance the API further, in particular WRT implicit vs explicit capture. We look forward to working on those ideas together.
-Jacob
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
> about this:
> > it’s possible to support both models simultaneously without serious web compat impact.
> turns out, when IE has problem with PoitnerEvents it reflects into Touch Events too. This page shows a demo which has been filed as bug and so far ignored:
http://www.3site.eu/ie/
> You tap and hold in mobile IE and after a little while it will trigger pointerup by its own.
> Absolutely not reproducible with any Touch Events based device **but** if you use these instead where supported in IE, the bug is absolutely the same: it will trigger by its own touchend without a reason.
> It's not clear if this happens in every mobile phone but at least you have a page to test against PointerEvents and behaviors VS touch events.
This is an unfortunate bug that has to do with the hosting mechanism for the rendering engine on Windows Phone 8.1 and below. The system gesture recognizer on WP was not configurable in such a way that we could fix this under that architecture. In Windows
10, we’ve changed our hosting mechanism and this is no longer an issue. The issue was purely implementation-specific and there’s nothing inherent in Pointer Events that should suggest implementing it should affect an existing Touch Events implementation.
In fact, we’ve been quite pleased thus far with our results of supporting both. The only real issues continue to be problems with enabling TE on more devices—we still see lots of issues with TE on machines that have additional inputs other than touch . But perhaps supporting Pointer Events interoperably gives justification to not worry about enabling TE everywhere.
-Jacob
The issues brought up in previous pointer-events threads resonate with me but I've come around to think this API is worth implementing from the developer productivity angle. A unified model helps developers get past the initial hurtles of getting pages off the ground.
Can you describe concrete plans for addressing the capture-by-default issue?
Ongoing technical constraints
Pointer Events as currently defined requires a hit-test on every pointermove (as is the case for mousemove, but not touchmove). This imposes a performance cost on the engine which the major native mobile platforms and browsers don’t have. I intend to work with the PEWG to identify some (probably breaking) API changes to allow us to avoid this cost for touch by default. This will be challenging to do without substantial compat pain, but I’m optimistic some solution can be reached to enable us to support Pointer Events without committing to this performance constraint.
The WebKit feedback is from 2012, have you talked to anyone working on WebKit about what they'll do if every other engine supports pointer events?
From that email: "Combining the very different models of touch and mouse is a bad idea. They are distinct and for anything beyond the trivial, you really need to treat them separately to get a good outcome. The basic premise of pointer events seems to be over-abstraction at the expense of the user experience."Is there anything to this criticism? PointerEvent.pointerType allows the distinction to be made, but is it the norm or the exception to want to handle touch and mouse in a unified way?
Philip
That sentence is still valid in my opinion, Pointer Events simply moved the problem inside the listener, instead of having separated concerns outside the same.With Pointer Events we have now to understand internally, instead of using an appropriate event name separating concerns, the nature of the event: was it a mouse, a touch, a pen, or an empty string that no developer knows at that point how to fallback or handle?touchmove would never happen if at least a touchstart happened before, so now it's a developer problem if pointermove can be triggered at any time, the developer needs to handle this too.
Considering that DOM handlers can also be Objects, and not just function, the ability to create classes of gestures and pointers per type is lost, since every event needs potentially an `if/else if/else if/else` switch inside each event to correctly understand what to do: meaning also more performance lost in user-land.
As summary: I've been working with PointerEvents for the entire IE10 and beginning of IE11 era, and all I needed was a working and consistent implementation of Touch events there too.
There are very few things if not just one that Pointer Event does better, but the API itself makes things more complicated from a developer prospective, without providing any real/concrete advantage.
Custom gestures are also easier to implement via Touch thanks to the TouchList ... in PoitnerEvents we need to somehow handle pointers ID too.
That being said, and even if I cannot agree more with that 2012 answer, Touch territory is apparently doomed so, as Web developer, I'd sign anytime / anywhere to have a consistent API across all platforms, even if that will end up being this PointerEvents thing that at least is there, and it's already deployed somewhere.
Just my 2 cents from a 6 years Mobile Web developer
In almost every circumstance, I've seen a desire from devs to have most mouse/touch events unified. Furthermore, nothing precludes adding separate listeners in cases where separate evaluation (using the type prop) is necessary. I don't see much validity in the argument myself, but welcome other thoughts/comments.
- Daniel