Implement "Pinch to zoom" like Safari (and not like it used to be in Firefox)

NEW
Unassigned

Status

()

enhancement
P3
normal
8 years ago
24 days ago

People

(Reporter: bugzilla, Unassigned)

Tracking

(Depends on 1 bug, Blocks 2 bugs, 4 keywords)

unspecified
x86
macOS
Points:
---
Dependency tree / graph
Bug Flags:
webcompat ?

Firefox Tracking Flags

(Webcompat Priority:?, firefox67 affected)

Details

(Whiteboard: [DevRel:P2][gfx-noted] [webcompat])

Attachments

(1 attachment, 1 obsolete attachment)

Reporter

Description

8 years ago
Firefox is currently the only browser on Mac OS X Lion that does not support "pinch to zoom".

My understanding is that this was WONTFIX'ed due to that it was not possible to zoom back to the original page zoom.

Safari 5.1 in Lion solves this issue by not allowing to zoom back more than the original zoom state. You can only zoom in and zoom back to the default size. 

This bug request does not request to only enable the pinch to zoom feature, but to implement it like Safari 5.1 does.
Reporter

Updated

8 years ago
Summary: Implement "Pinch to zoom" like Safari 5.1 → Implement "Pinch to zoom" like Safari 5.1 (and not like it used to be in Firefox)
Reporter

Updated

8 years ago
Severity: normal → enhancement
Reporter

Updated

8 years ago
Related to bug 674371?
Summary: Implement "Pinch to zoom" like Safari 5.1 (and not like it used to be in Firefox) → [10.7] Implement "Pinch to zoom" like Safari 5.1 (and not like it used to be in Firefox)
Reporter

Updated

8 years ago
Whiteboard: [parity-safari]
We didn't want to support it since the thresholds were all wrong and we only zoom 20% at a time, etc.

If we could zoom the way Safari 5.1 does it, I'd be all for it. I don't think it's trivial, but I'd love to see it. :)
Referencing the older bugs about this: bug 613909 where the old-style handling of the gestures was disabled and bug 632733 and bug 481092 related to the old implementation. They can be closed once this is fixed.

Updated

7 years ago
Duplicate of this bug: 684433

Updated

7 years ago
Duplicate of this bug: 728799
Can we use the zoom behavior from Firefox for Android for this?
Reporter

Updated

7 years ago
Duplicate of this bug: 816499
Assignee: nobody → waterlo1
Status: NEW → ASSIGNED
We want this on Windows 8 too (in both "Metro" and desktop modes); see bug 789906.  If I understand correctly, the right way to do this is to use the AsyncPanZoomController from B2G (bug 745136).
Depends on: 789906, 745136
(In reply to Stefan Arentz [:st3fan] from comment #6)
> Can we use the zoom behavior from Firefox for Android for this?

Possible, but we probably shouldn't. Firefox for Android reflows text, and it probably shouldn't. We really want this like Safari, or a more iOS-like zooming. That is, where everything gets bigger and does not move its' contents, just allows you to pan around the larger view.
The text reflow in Firefox for Android is controlled by prefs and can be disabled.

More importantly, the Android version of this code is mostly implemented in Java and can't be used on other platforms; however, the B2G port of that same code (bug 745136) is already part of Gecko, and we are already planning to use it on Windows 8.

Comment 11

6 years ago
Posted patch Patch v0.2.0 (obsolete) — Splinter Review
This is a very rough version for pinch zooming. It is compatible with rotation.  It works a lot better for ImageDocuments than regular documents.
Attachment #714526 - Flags: feedback?(jAwS)

Comment 12

6 years ago
Apologies for bitrot in previous patch, forgot to update from central before diff'ing.
I have a fixed version of the patch ready, just building real quick to make sure it works.

Comment 14

6 years ago
Posted patch Patch v0.2.1Splinter Review
Same as the last patch, but with way less bit rot!
Attachment #714526 - Attachment is obsolete: true
Attachment #714526 - Flags: feedback?(jAwS)
Attachment #714536 - Flags: feedback?(jAwS)
(In reply to Josiah [:JosiahOne] from comment #13)
> I have a fixed version of the patch ready, just building real quick to make
> sure it works.

Scratch that. Brandon got it fixed. :)
The big-picture plan for panning and zooming across all platforms is to get off-main-thread-compositing working for all platforms (builds on the layers refactoring work being done currently on the gfx branch) and use the AsyncPanZoomController we built for B2G on desktop (and ultimately Android too). In other words, port the stuff we built for B2G to the desktop.
Comment on attachment 714536 [details] [diff] [review]
Patch v0.2.1

Most of the code looks fine, but this is probably not something that we will end up shipping in Firefox since the plans for AZPC are too near.

Can you please convert this patch in to an add-on? See https://addons.mozilla.org/en-US/developers/docs/sdk/latest/ for more information and feel free to ask questions on IRC as you work on it.
Attachment #714536 - Flags: feedback?(jAwS) → review-

Comment 18

6 years ago
As per https://bugzilla.mozilla.org/show_bug.cgi?id=688990#c17, we'll be moving our work into an add-on.  Once OMTC / APZC is ready to go, the add-on will be deprecated.

The add-on depends on bugs 851128 and 853490.  It will be called "Multi-Touch Gestures" (or something very similar), and will be available on addons.mozilla.org before the end of April.

Unassigning myself from the bug.
Status: ASSIGNED → NEW

Updated

6 years ago
Assignee: waterlo1 → nobody

Updated

5 years ago
No longer depends on: 789906

Updated

5 years ago
Blocks: apz-desktop
No longer blocks: apz-desktop
Depends on: apz-desktop
Comment hidden (advocacy)

Updated

5 years ago
Duplicate of this bug: 1005111

Comment 21

5 years ago
advocacy-reviewed
I keep going back from Firefox to Safari because of this missing feature, i prefer an open platform over proprietary software but ****, the zooming in Firefox feels like going back in time 5 years :'(
See Also: → 674371

Updated

4 years ago
Keywords: DevAdvocacy
Whiteboard: [parity-safari] → [parity-safari] [parity-chrome]

Comment 22

4 years ago
(In reply to Brandon Waterloo from comment #18)
> As per https://bugzilla.mozilla.org/show_bug.cgi?id=688990#c17, we'll be
> moving our work into an add-on.  Once OMTC / APZC is ready to go, the add-on
> will be deprecated.
> 
> The add-on depends on bugs 851128 and 853490.  It will be called
> "Multi-Touch Gestures" (or something very similar), and will be available on
> addons.mozilla.org before the end of April.
> 
> Unassigning myself from the bug.

Any progress?
Depends on: 1180706
No longer depends on: apz-desktop
Blocks: desktop-zoom
No longer depends on: 1180706

Comment 23

3 years ago
I too would really love a soft 'pinch to zoom'. I've recently moved back to Firefox from Google Chrome and it sucks that I can't have this feature anymore.
I'm trying to see if we can find a way to move forward with issues that can benefit from APZ awesomeness.

Is there prior art that we can 'copy' from b2g or Android implementations?
[cont comment 24]

Is there some kind of API that the frontend team can use to wire things up, or do we need support from platform?
Flags: needinfo?(mstange)
Flags: needinfo?(bugmail.mozilla)
This needs to be implemented in the platform. I think the plan is to look at it once scrolling is solid.
Flags: needinfo?(mstange)
Yeah, what Markus said. There's a bunch of work that needs to be done to handle zoom properly on desktop. With some pref flips you can enable it on Windows touch devices but it exposes a number of bugs that will need to be fixed before it's ready to be used. Once we have shipped the basic APZ scrolling feature we can look into this in more detail.
Flags: needinfo?(bugmail.mozilla)
Whiteboard: [parity-safari] [parity-chrome] → [parity-safari] [parity-chrome][DevRel:P2]
We've had async scrolling for a while now. Any updates on this?

> With some pref flips you can enable it on Windows touch devices

Is there a similar pref incantation for enabling it on macOS or are we still lacking code there?

Comment 29

2 years ago
Would you mind forwarding this bug to the appropriate people / triagers, please?
Flags: needinfo?(bugmail)
Summary: [10.7] Implement "Pinch to zoom" like Safari 5.1 (and not like it used to be in Firefox) → Implement "Pinch to zoom" like Safari (and not like it used to be in Firefox)
Component: General → Panning and Zooming
Flags: needinfo?(bugmail)
Keywords: feature
Priority: -- → P3
Product: Firefox → Core
Whiteboard: [parity-safari] [parity-chrome][DevRel:P2] → [parity-safari] [parity-chrome][DevRel:P2][gfx-noted]
Duplicate of this bug: 1047444

Updated

2 years ago
Duplicate of this bug: 1417193

Comment 32

2 years ago
Looks like this has been in development hell for a while, but this is the only missing feature stopping me from switching to Firefox full-time and I would love to see it implemented.

Comment 33

2 years ago
Yeah it seems like now that APZ has landed (as of 57.0) that now might be a good time to readdress this

Comment 34

2 years ago
This bug deserves a higher priority. I will not use Firefox until the browser zoom behavior and multi-touch support is responsive and matches other browsers.

Comment 35

2 years ago
It's possible to add smooth multi-touch zooming to current Firefox - I've developed an extension to demo https://addons.mozilla.org/en-GB/firefox/addon/multi-touch-zoom/?src=userprofile

(macOS only)

Comment 36

2 years ago
(In reply to haxiomic from comment #35)
> It's possible to add smooth multi-touch zooming to current Firefox - I've
> developed an extension to demo
> https://addons.mozilla.org/en-GB/firefox/addon/multi-touch-zoom/
> ?src=userprofile
> 
> (macOS only)

This seems to work as expected. Thanks!

Comment 37

2 years ago
That is fantastic news ! Hope to see the windows equivalent (it works with SHIFT + pinch on touchpad now) !
One day I'll switch back to firefox, very soon I hope !

Comment 38

2 years ago
noise
Amazing work haxiomic, only took 6 years! I hope this is a big step forward in squashing this bug.
haxiomic, would you be interested in landing that directly in Firefox?
Flags: needinfo?(haxiomic)

Comment 40

2 years ago
I think it could use some tweaking and fine tuning to make it more responsive. Seems to be a delay after zooming that prevents the user from immediately being able to scroll.

Should also assess resource consumption and possible optimization.

Comment 41

2 years ago
Hey Sylvestre, I'm keen to help the feature land in Firefox if I can. I expect it'll take a different approach to the one used in the add-on (which does some ugly things with transform: perspective). Is there someone who owns the gesture code that I should get in touch with?

mixxster, I agree, I think there's lots of room for optimization – I'd love to see it as smooth as Safari. That delay seems to be down to a re-paint of the page when the scroll bars become visible which I suspect could be avoided.
Flags: needinfo?(haxiomic)
(In reply to haxiomic from comment #41)
> Hey Sylvestre, I'm keen to help the feature land in Firefox if I can. I
> expect it'll take a different approach to the one used in the add-on (which
> does some ugly things with transform: perspective). Is there someone who
> owns the gesture code that I should get in touch with?

Most existing methods for manipulating the view (such as scrolling, or zooming on mobile) are implemented in native (C++) code using our "asynchronous panning and zooming" (APZ) infrastructure. 

The "asynchronous" part means that the processing of the input events and the progress of the animation that is changing the view is independent of the browser's main loop, and thus can be smooth and responsive even if the main loop is busy running JS or the page is slow to repaint.

We would definitely like to add APZ-based support for desktop zooming (that's what this bug tracks). As mentioned earlier, it's a nontrivial undertaking and the timeline for it is uncertain.

The idea of landing a JS-based solution like this one as a stopgap, until the APZ-based implementation is ready to take its place, is an interesting one. I'm not opposed to it, but I think the decision is up to the owners of the relevant Firefox front-end code that would need to be modified. :jaws, do you have any thoughts on whether there might be interest in accepting such a contribution?
Flags: needinfo?(jaws)
I looked at the code of the extension[1] and it does this pretty much how I would do this for an extension but I don't think we can ship this built-in as part of Firefox since it works by setting style properties directly on the root element[2] which would be visible from content as well as could have conflicts with some pages that expect various styles set on the root to hold at all times.

If haxiomic wants to try to write a patch that implements this without being visible to content (possibly by creating and updating a user agent stylesheet in tab-content.js[3]) then that might work and I would be happy to accept the contribution.

[1] https://github.com/haxiomic/firefox-multi-touch-zoom/blob/master/extension/pinch-zoom.js
[2] https://github.com/haxiomic/firefox-multi-touch-zoom/blob/master/extension/pinch-zoom.js#L156
[3] https://searchfox.org/mozilla-central/rev/51cd1093c5c2113e7b041e8cc5c9bf2186abda13/browser/base/content/tab-content.js
Flags: needinfo?(jaws)
Duplicate of this bug: 1433834
Touchscreen zooming has been implemented into haxiomic's extension.
Anyone still interested in implementing this?
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Whiteboard: [parity-safari] [parity-chrome][DevRel:P2][gfx-noted] → [DevRel:P2][gfx-noted]

Comment 47

Last year
IMHO it's crazy that Firefox doesn't implement this natively. I think "people might leave" Firefox as soon as they realise they can't easily pinch zoom that image or whatever like they've been doing for years on Safari. I think most won't bother to install an add-on. They'll just leave. 

Haxiomatic's extension is fantastic and makes Firefox useable for me, but IMHO Firefox really needs to do this nicely right out of the box. Soon.

Could you not just repurpose the Firefox Android pinch zoom code? It works well enough.
Comment hidden (advocacy)
The patch is unassigned, triaged and P3 and available for grabs. If you want to write a patch, take it, if not, wait until someone else does.

If the triage owner will decide to mark is as wontfix, they will. No need to ask about it.

Please, familiarize yourself with the Bugzilla etiquette. Your comment is not adding any technical value to the issue at hand.
Depends on: 1458711
We definitely haven't forgotten about this, and we are working on it (as other priorities permit).

We do plan to reuse most of the Android pinch-zoom code, but there are issues specific to desktop that are not present on mobile that need to be tackled (e.g. different scrollbar behavior). 

I reorganized the dependency tree of bug 1245183 to make the dependencies of this work more clear. Most of the work involved is not specific to Mac, but common to all desktop platforms; you can follow the progress of that work in the dependencies of bug 1461360.

Comment 51

Last year
Thanks for the heads up
Duplicate of this bug: 1513444
Flags: webcompat?
Whiteboard: [DevRel:P2][gfx-noted] → [DevRel:P2][gfx-noted] [webcompat]

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

You need to log in before you can comment on or make changes to this bug.