Bug 694901 (metaviewport)

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

VERIFIED FIXED in Firefox 11

Status

()

Firefox for Android
General
P1
normal
VERIFIED FIXED
6 years ago
11 months ago

People

(Reporter: Ehsan, Assigned: mbrubeck)

Tracking

(Depends on: 1 bug, {feature})

unspecified
Firefox 11
All
Android
feature
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox11 fixed, fennec11+)

Details

Attachments

(2 attachments, 6 obsolete attachments)

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

Comment 1

6 years ago
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
(Assignee)

Updated

6 years ago
Component: General → General
Product: Fennec → Fennec Native
Version: Trunk → unspecified
Priority: -- → P1
(Assignee)

Updated

6 years ago
Blocks: 699006
(Assignee)

Comment 2

6 years ago
Created attachment 571657 [details] [diff] [review]
WIP

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

Comment 3

6 years ago
Created attachment 574378 [details] [diff] [review]
WIP 2

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

Comment 4

6 years ago
Created attachment 574914 [details] [diff] [review]
WIP 3

Updated to latest birch tip.  Still working out some bugs.
(Assignee)

Updated

6 years ago
Attachment #574378 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Depends on: 703141
(Assignee)

Updated

6 years ago
Blocks: 703752
Duplicate of this bug: 703767
(Assignee)

Comment 6

6 years ago
Created attachment 575897 [details] [diff] [review]
WIP 4

Rebased to birch tip.
Attachment #574914 - Attachment is obsolete: true

Updated

6 years ago
Duplicate of this bug: 703752
No longer blocks: 703752
(Assignee)

Comment 8

6 years ago
Created attachment 576011 [details] [diff] [review]
WIP 5

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

Comment 9

6 years ago
Created attachment 576030 [details] [diff] [review]
WIP 6

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
Duplicate of this bug: 704896
The patch applies cleanly, but doesn't seem to set the width to 980 by default for me.

Comment 12

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

Comment 14

6 years ago
Created attachment 577359 [details] [diff] [review]
patch

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

Comment 15

6 years ago
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+
(Assignee)

Comment 17

6 years ago
Created attachment 577652 [details] [diff] [review]
2/2: set the default zoom level based on the viewport

r=mfinkle (via IRC because Bugzilla was down)
Attachment #577652 - Flags: review+
(Assignee)

Comment 18

6 years ago
https://hg.mozilla.org/projects/birch/rev/2ecdcf3961a8
https://hg.mozilla.org/projects/birch/rev/18678a2f8091
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Duplicate of this bug: 699006

Updated

6 years ago
Depends on: 706215
(Assignee)

Updated

6 years ago
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+
(Assignee)

Updated

6 years ago
status-firefox11: --- → fixed
Target Milestone: --- → Firefox 11

Updated

6 years ago
Keywords: feature
(Assignee)

Updated

5 years ago
Depends on: 756473
You need to log in before you can comment on or make changes to this bug.