Closed Bug 936225 Opened 11 years ago Closed 10 years ago

pinch-to-zoom not working in webapp on ZTE Open, but works in the browser and as webapp on Android

Categories

(Core :: Panning and Zooming, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: robert.reitenbach, Assigned: vingtetun)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131025151332

Steps to reproduce:

In a web-app that uses the whole page I declare in the header the meta tag that it should be scalable:

<meta name="viewport" content="user-scalable=yes, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0, width=device-width, height=device-height">

 


Actual results:

When this web-app is installed on a ZTE Open phone (FireFox OS 1.0) it will NOT allow pinch-to-zoom. 

However on the same device when the same HTML is loaded in Phones Web-Browser then pinch-to-zoom works. 

On an Android device installed as webapp with Firefox 25, pinch-to-zoom works as well.



Expected results:

Pinch-to-zoom should work in the webapp on the Firefox OS phone.

The same way as it already works in the browser on the same phone and as it works in the webapp on the Android.
OS: All → Gonk (Firefox OS)
Hardware: All → ARM
Component: Gaia → Panning and Zooming
Product: Firefox OS → Core
I see the same behavior with the webapp I developed, on Firefox OS v1.1.0hd on Peak device.
I's surprising that webapps in Firefox OS do not have the same built-in pinch-to-zoom ability as standard web pages.
The code being used on Firefox OS for pan/zoom in the browser is different from the code being used in webapps, which is why this is happening. We have plans to address that but not sure when exactly it will be fixed.
Status: UNCONFIRMED → NEW
Depends on: gaia-apzc
Ever confirmed: true
Thank you Gupta for providing an answer and a link to the related bug. I understand that it might be resolved in future, but we do not know when and if it will be available on the devices that are on the market now.

In the meant time it would be cool to have a "least-effort" workaround. What are the suggestions on how to enable pinch-to-zoom in webapps in the meantime, with least effort and least external libraries/dependencies?
At the current time the only way to get pinch-to-zoom in webapps is to import some third-party library that does it. I'm not aware of any such library, and I doubt the results will be any good because the web browser actually has to render things at a higher resolution for it to look good, and no third-party library can make that happen.
So in B2G 1.3 and above you should get pinch-to-zoom behaviour in webapps if you specify a meta-viewport tag with user-scalable=yes. For backwards compatibility, we have a default viewport with user-scalable=no if you don't specify one explicitly. This was done in bug 940036 and will eventually be removed so that the default behaviour allows pinch-to-zoom.

I'm going to mark this bug resolved but please re-open it if you disagree or comment here if you have further questions.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee: nobody → 21
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.