Summary: | Pinch-to-zoom has no JavaScript event and cannot be prevented, unlike Chrome | ||
---|---|---|---|
Product: | WebKit | Reporter: | evan.exe |
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | bdakin, ebrahim, hikezoe.birchill, sam, simon.fraser, smartj, thorton |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Description
evan.exe
2015-05-20 11:12:49 PDT
I'd like to pile on that this feature is incredibly confusing to end-users. Here are some grievances: (1) pinch gesture is very sensitive, too easy to do by accident (2) does not show zoom-level-% to inform the user of their zoom level (3) zooming and then refreshing the page leaves the window zoomed, leading end-users to believe the site or their computer is broken (seriously!) (4) ignores the Viewport meta tag "standard" (5) no good way to detect zoom level or zoom events in JavaScript (6) Apple Touchpad acts like a touch device, but does not trigger proper touch events Giving Macbook TrackPad more touch-device-like capabilities is laudable, but failing to properly hook it up to existing touch APIs is hurting the end-user experience. Those are good points. However, the trackpad is a bit of an odd beast and doesn't map well to touch events. The touches are indirect and don't have screen-space positions. I'm much more in favor of something like the approach OS X takes where the gesture recognition has already been performed and you get separate pinch and rotate events. This could easily be added to the web platform either as new events or using existing events as Chrome has done. One easy way to introduce pinch-to-zoom that's less hacky than Chrome's approach could be to emit wheel events with the scale factor change in the deltaZ value. Some useful links: * https://github.com/dimsemenov/PhotoSwipe/issues/897 * https://bugs.chromium.org/p/chromium/issues/detail?id=289887 * http://jsbin.com/cuxopid/1/edit There /are/ non-standard gesture events that do allow custom pinch-zooming (e.g. your map example; try pinch-zooming on DuckDuckGo Maps, for example (https://duckduckgo.com/?q=1+infinite+loop&t=h_&ia=places&iaxm=maps). These have been around for a long time: https://trac.webkit.org/changeset/191299/webkit The Chrome-like "map it to ctrl-wheel" behavior was also recently implemented in https://trac.webkit.org/changeset/277772/webkit. I'm going to dupe you to the second one; feel free to kick this back with more details if it doesn't address your needs. *** This bug has been marked as a duplicate of bug 225788 *** |