| Summary: | [iOS] Pinch to zoom gesture should map to mousewheel with the control key | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Thomas Steiner <tomac> | ||||
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | REOPENED --- | ||||||
| Severity: | Normal | CC: | ap, simon.fraser, thorton, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | iPhone / iPad | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Thomas Steiner
2021-09-21 03:57:54 PDT
Addendum: The standards-based Safari way is documented in https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events/Pinch_zoom_gestures. Why do we want web pages to detect zooming? As a user, I just want the browser to zoom, and absolutely don't want the webpage to change anything as I'm doing that. The use case here would be pinch-zooming parts of an app. Example: go to https://jakearchibald.github.io/svgomg/, click “Demo” and pinch-zoom the 🚗. This was implemented in https://bugs.webkit.org/show_bug.cgi?id=225788 *** This bug has been marked as a duplicate of bug 225788 *** Oh, that’s amazing and I missed this. Thanks for implementing this! Can you tell me as of which Safari release on mobile this will land? I think it’s not part of iOS 15, but I may be wrong. The implementation was macOS-only (we only dispatch wheels events on iOS when using the Magic Keyboard, and there you have a trackpad which supports pinch-zoom already). You can test in Safari Tech Preview on Mac. Thanks, Simon, this explains why I wasn’t seeing it on mobile Safari. Since Firefox and Chrome on Android expose this (see https://bugs.webkit.org/attachment.cgi?id=438802), could you consider exposing this as well? To be clear, are you expecting pinch-zoom on the iPhone/iPad screen to generate wheel events with the Ctrl key set? Yes, since this lets developers create zoom UIs as needed in apps like the linked one above purely by listening for the `wheel` event and working with `ev.deltaY`. Here’s an example: https://developer.mozilla.org/en-US/docs/Web/API/Element/wheel_event#examples. Not a dup then. One reason we don't do this when users interact with the screen is that there is no pointer. You'd have to use the centroid of the fingers as the wheel event location, and that's different from what users are used to. |