Closed Bug 514351 Opened 15 years ago Closed 15 years ago

support HandheldFriendly meta tag

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed
fennec 1.0b1-wm+ ---

People

(Reporter: blassey, Assigned: blassey)

Details

(Keywords: mobile)

Attachments

(2 files, 3 obsolete files)

When a page specifies this we shouldn't scale the page, just fit to actual screen width.
Flags: wanted-fennec1.0+
Attached patch content patchSplinter Review
Assignee: nobody → bugmail
Attachment #398333 - Flags: review?
Attached patch mobile patch (obsolete) — Splinter Review
Attachment #398334 - Flags: review?(mark.finkle)
Comment on attachment 398334 [details] [diff] [review]
mobile patch


>-    let [w, h] = BrowserView.Util.getBrowserDimensions(browser);
>-    this.setZoomLevel(BrowserView.Util.pageZoomLevel(this.getVisibleRect(), w, h));
>+    var windowUtils = browser.contentWindow.QueryInterface(Components.interfaces
>+							   .nsIInterfaceRequestor)
>+                                .getInterface(Components.interfaces.nsIDOMWindowUtils);

Use Ci in these two places

>+    if (handheldFriendly == "true") {
>+	 browser.setAttribute("style", "width: " + window.screen.width + "px;");
>+	 this.setZoomLevel(1);
>+	 browser.markupDocumentViewer.textZoom = 1;

There is code in the window resize handler that updates the height of the browsers based on the width. However, the code assumes the width is always the default:

http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#401

When we create the browser, we default the width:

http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2404

So, you could change the code at line 401 to use the parseInt(browser.style.width) instead of the hardcoded default.
Attachment #398334 - Flags: review?(mark.finkle) → review-
Attached patch mobile patch v.2 (obsolete) — Splinter Review
I untabified browser.js, which led to some ws changes outside the code I'm modifying.  Mark said he welcomed that clean up, so I've included it in the patch.
Attachment #398334 - Attachment is obsolete: true
Attachment #398379 - Flags: review?(mark.finkle)
Attachment #398333 - Flags: review? → review?(jonas)
Attached patch mobile patch v.3 (obsolete) — Splinter Review
changes suggested on irc
Attachment #398379 - Attachment is obsolete: true
Attachment #398415 - Flags: review?(mark.finkle)
Attachment #398379 - Flags: review?(mark.finkle)
Comment on attachment 398415 [details] [diff] [review]
mobile patch v.3

>diff --git a/chrome/content/BrowserView.js b/chrome/content/BrowserView.js

>+    if (handheldFriendly == "true") {
>+      browser.handheld = true;
>+      browser.setAttribute("style", "width: " + window.screen.width + "px;");
>+      this.setZoomLevel(1);
>+      browser.markupDocumentViewer.textZoom = 1;
>+    } else {
>+        let [w, h] = BrowserView.Util.getBrowserDimensions(browser);
>+        this.setZoomLevel(BrowserView.Util.pageZoomLevel(this.getVisibleRect(), w, h));
>+    }

You probably want to remove the property in the else clause: delete browser.handheld;

>diff --git a/chrome/content/browser.js b/chrome/content/browser.js

>   let scrollbox = document.getElementById("tile-container-container")
>-		.boxObject
>-		.QueryInterface(Components.interfaces.nsIScrollBoxObject);
>+                .boxObject
>+                .QueryInterface(Components.interfaces.nsIScrollBoxObject);

Ci. while you're here?

>-        let scaledH = (kDefaultBrowserWidth * (h / w));
>+        let scaledDefaultH = (kDefaultBrowserWidth * (h / w));
>+        let scaledScreenH = (window.screen.width * (h/w));

Add spaces: (h / w)

>+          browserStyle.height = ((browser.hasOwnProperty("handheld") && 
>+                                  browser.handheld) ? 
>+                                 scaledScreenH : scaledDefaultH) + 'px';

Oops: there is no "browser" variable in this block. need to make one or use "browsers[i]"
and use "px" (double quotes)

Sorry I didn't catch some of these earlier
Attachment #398415 - Flags: review?(mark.finkle) → review-
Attached patch mobile patch v.4Splinter Review
Attachment #398415 - Attachment is obsolete: true
Attachment #398418 - Flags: review?(mark.finkle)
Attachment #398418 - Flags: review?(mark.finkle) → review+
this meta tag was originally defined by AvantGo.  Its fairly common on the web and signifies that the page is designed to work well with small screens.  It is used by m.cnn.com and referenced by blackberry in their docs: 
http://docs.blackberry.com/en/developers/deliverables/6176/HTML_ref_meta_564143_11.jsp
i'd really much rather we support the viewport meta tag, than this tag...
Assignee: bugmail → nobody
Component: General → DOM
Product: Fennec → Core
QA Contact: general → general
Attachment #398333 - Flags: approval1.9.2?
pushed http://hg.mozilla.org/mozilla-central/rev/bb5d0b3c624a
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
tracking-fennec: --- → 1.0b1-wm+
Keywords: mobile
Attachment #398333 - Flags: approval1.9.2? → approval1.9.2+
pushed http://hg.mozilla.org/releases/mozilla-1.9.2/rev/f3b8ed7b59ae


the mobile-browser patch has bitrotted or has landed already?
(In reply to comment #11)
> the mobile-browser patch has bitrotted or has landed already?

It has landed
Assignee: nobody → blassey.bugs
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: