On load, consider not doing fit to zoom

RESOLVED WONTFIX

Status

Firefox for Android Graveyard
Panning/Zooming
RESOLVED WONTFIX
9 years ago
8 years ago

People

(Reporter: stechz, Assigned: stechz)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

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.
(Assignee)

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)
(Assignee)

Updated

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:

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

Updated

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

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?

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