Closed Bug 520593 Opened 15 years ago Closed 14 years ago

On load, consider not doing fit to zoom

Categories

(Firefox for Android Graveyard :: Panning/Zooming, defect)

ARM
All
defect
Not set
normal

Tracking

(fennec1.0-)

RESOLVED WONTFIX
Tracking Status
fennec 1.0- ---

People

(Reporter: stechz, Assigned: stechz)

Details

Attachments

(1 file)

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.
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)
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
tracking-fennec: ? → 1.0-
Ben, Is this bug now valid due to us setting the default zoom to 1.0 ?
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
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: