Closed Bug 694901 (metaviewport) Opened 13 years ago Closed 13 years ago

[birch] meta name="viewport" support for native Android front-end

Categories

(Firefox for Android Graveyard :: General, defect, P1)

All
Android
defect

Tracking

(firefox11 fixed, fennec11+)

VERIFIED FIXED
Firefox 11
Tracking Status
firefox11 --- fixed
fennec 11+ ---

People

(Reporter: ehsan.akhgari, Assigned: mbrubeck)

References

Details

(Keywords: feature)

Attachments

(2 files, 6 obsolete files)

I've been running the native UI for the past few days, and one of the problems I've been facing is that Google Reader appears much smaller in the native UI than in the XUL UI, making it barely readable.  I am on a Galaxy S Vibrant phone.
Summary: Google Reader appearing smaller in the native UI than the XUL UI → [birch] Google Reader appearing smaller in the native UI than the XUL UI
The native front-end does not yet support the <meta name="viewport"> tag and related features to scale pages intelligently based on the device size and density.

We don't yet have real zooming implemented in birch; viewport sizing will depend on that.  (People are working on it already, but I don't have a bug number.)
Assignee: nobody → mbrubeck
OS: Mac OS X → Android
Hardware: x86 → All
Summary: [birch] Google Reader appearing smaller in the native UI than the XUL UI → [birch] meta name="viewport" support for native Android front-end
Product: Fennec → Fennec Native
Version: Trunk → unspecified
Priority: -- → P1
Blocks: 699006
Attached patch WIP (obsolete) (deleted) — Splinter Review
This work-in-progress patch doesn't do anything useful yet, but it transplants most of the viewport code from XUL Fennec and gets it running in native Fennec.
Attached patch WIP 2 (obsolete) (deleted) — Splinter Review
This is fully-functional, but has some bugs.  For example, the real screen/window size is not exposed to Gecko chrome, so "width=device-width" is currently using the wrong dimensions.

Next step is to integrate this with the displayport patch queue.
Attachment #571657 - Attachment is obsolete: true
Attached patch WIP 3 (obsolete) (deleted) — Splinter Review
Updated to latest birch tip.  Still working out some bugs.
Attachment #574378 - Attachment is obsolete: true
Depends on: 703141
Blocks: 703752
Attached patch WIP 4 (obsolete) (deleted) — Splinter Review
Rebased to birch tip.
Attachment #574914 - Attachment is obsolete: true
No longer blocks: 703752
Attached patch WIP 5 (obsolete) (deleted) — Splinter Review
Getting very close. This applies on top of the birch-pan-zoom patch queue [1], and it correctly sets the viewport size.  However, the gfx code still stores a viewport size based on the screen size, so the page's viewport gets overridden and reset on the next update from Java.

[1]: http://hg.mozilla.org/users/pwalton_mozilla.com/birch-pan-zoom/
Attachment #575897 - Attachment is obsolete: true
Attached patch WIP 6 (obsolete) (deleted) — Splinter Review
This works; it sets and maintains the correct viewport.  Needs some testing, and I should talk to Chris about how to integrate the changes into his patches.
Attachment #576011 - Attachment is obsolete: true
Alias: metaviewport
The patch applies cleanly, but doesn't seem to set the width to 980 by default for me.
Did something land recently related to this work?

Sites now have a normal width!!! and I wanted to thank whoever did it.
(In reply to Armen Zambrano G. [:armenzg] - Release Engineer from comment #12)
> Did something land recently related to this work?
> 
> Sites now have a normal width!!! and I wanted to thank whoever did it.

This changed with the viewport patch. However, it's still wrong -- sites should be 980 by default, unless a <meta viewport> tag is present.
Attached patch patch (deleted) — Splinter Review
This patch sets the viewport width and height correctly.

This does not yet set the correct initial scale; I think we might need to add a way to control zooming from JavaScript (or for the Java code to ask the JS code for an initial zoom level).
Attachment #576030 - Attachment is obsolete: true
Attachment #577359 - Flags: review?(mark.finkle)
Bug 704950 might make the zooming part easier to fix.
Depends on: 704950
Comment on attachment 577359 [details] [diff] [review]
patch


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

>   startup: function startup() {

>+    ViewportHandler.init();

I didn't notice an uninit() call

>+  get defaultBrowserWidth() {
>+    var width = Services.prefs.getIntPref("browser.viewport.desktopWidth");

let

>+var ViewportHandler = {

>+  handleEvent: function handleEvent(aEvent) {

>+    let tab = BrowserApp.getTabForBrowser(browser);

Maybe I am paranoid, but we should probably check "tab" for null and bail
Attachment #577359 - Flags: review?(mark.finkle) → review+
r=mfinkle (via IRC because Bugzilla was down)
Attachment #577652 - Flags: review+
https://hg.mozilla.org/projects/birch/rev/2ecdcf3961a8
https://hg.mozilla.org/projects/birch/rev/18678a2f8091
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 706215
Depends on: 706309
Samsung Nexus S (Android 4.0.1)
20111130040240
http://hg.mozilla.org/projects/birch/rev/4e745f151abd
Status: RESOLVED → VERIFIED
tracking-fennec: --- → 11+
Target Milestone: --- → Firefox 11
Keywords: feature
Depends on: 756473
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: