On load, consider not doing fit to zoom



Firefox for Android Graveyard
9 years ago
8 years ago


(Reporter: stechz, Assigned: stechz)




(1 attachment)



9 years ago
We currently render handheld unfriendly sites at 800x600, which works well for most sites.  On these sites, fit to zoom causes the zoom level to be roughly 1 because the page width is close to 800px.  Some sites, like Facebook and Bugzilla, do not render well at 800x600.  I see two solutions:
1) Fit to zoom, so that entire horizontal space is seen immediately. (we do this now)
2) Zoom level 1, so that user must pan to see rest of horizontal space. (I think this is what Android browser does)

We should think about doing #2.  It fixes the Facebook case where the toolbar is floating instead of being on the bottom of the screen.  In general, #2 causes the viewport dimensions to be exactly what the webpage *thinks* the dimensions are by default.

Comment 1

9 years ago
Created attachment 404975 [details] [diff] [review]
Don't fit to zoom

Set zoom level to 1 by default on all pages.  The code in zoomToPage had to be put in tab loading.  This is a little ugly because the code is copy/pasted but that is addressed in bug 520872.
Assignee: nobody → webapps
Attachment #404975 - Flags: review?(pavlov)


9 years ago
tracking-fennec: --- → ?
Comment on attachment 404975 [details] [diff] [review]
Don't fit to zoom

>-      let restoringPage = (this._state != null);
>-      if (!this._browserViewportState.zoomChanged && !restoringPage) {
>-        // Only fit page if user hasn't started zooming around and this is a page that
>-        // isn't being restored.
>-        bv.zoomToPage();
>+      let browser = this._browser;
>+      let windowUtils = browser.contentWindow
>+                               .QueryInterface(Ci.nsIInterfaceRequestor)
>+                               .getInterface(Ci.nsIDOMWindowUtils);
>+      let handheldFriendly = windowUtils.getDocumentMetadata("HandheldFriendly");
>+      if (handheldFriendly == "true") {
>+        browser.handheld = true;
>+        browser.setAttribute("style", "width: " + window.screen.width + "px;");
>+      } else {
>+        delete  browser.handheld;

This patch is bitrotted due to the viewport changes made to isContentHandheld. I'd like to find a way to add the meta results from isContentHandheld to the browser itself, so we don't need to keep calling the function when we need that information.

Also, I'd like to change the default zoom to a preference instead of hard coding it one way or the other. how about:

Attachment #404975 - Flags: review?(pavlov) → review-
Component: General → Panning/Zooming


8 years ago
tracking-fennec: ? → 1.0-
Ben, Is this bug now valid due to us setting the default zoom to 1.0 ?

Comment 4

8 years ago
We still fit the page in the viewport, but for pages that are very close to rendering at 800px, we leave the zoom level at 1.0 and let the users pan over to the sidebars.  For huge pages, we still fit the page into the viewport.

I think our current behavior is good.  I vote for resolving this as won't fix.  Any objections?
(In reply to comment #4)

> I think our current behavior is good.  I vote for resolving this as won't fix. 
> Any objections?

Last Resolved: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.