Closed Bug 710298 (reflow-zoom) Opened 12 years ago Closed 12 years ago

Add option for reflow-on-zoom

Categories

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

ARM
Android
defect

Tracking

(firefox18 verified, firefox19 verified, blocking-fennec1.0 -, fennecNightly+)

VERIFIED FIXED
Firefox 18
Tracking Status
firefox18 --- verified
firefox19 --- verified
blocking-fennec1.0 --- -
fennec Nightly+ ---

People

(Reporter: glandium, Assigned: jwir3)

References

(Depends on 1 open bug, )

Details

(Keywords: feature, Whiteboard: readability)

Attachments

(1 file, 1 obsolete file)

When a page is large and text expands on a large portion of the page, readability is impaired. See for example the "Description" section on http://www.javaforge.com/issue/10983

With the stock browser, double-tab on the section does reflow-on-zoom, which makes it readable. On Firefox, it just zooms so that the whole text section width fits on screen, which leaves the text tiny. Manually zooming makes the text readable, but then you need to scroll horizontally to read. Either way it's really not helpful.
Whiteboard: readability
Priority: -- → P4
Summary: Zoom behaviour is hurting readability on large pages → Add option for reflow-on-zoom
tracking-fennec: --- → 11+
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → -
Assignee: nobody → bugs
tracking-fennec: 11+ → 18+
P2 per font inflation scrub.
Assignee: bugs → sjohnson
Priority: P4 → P2
Priority: P2 → P4
Priority: P4 → P2
Depends on: 784887
Attached patch b710298 (obsolete) — Splinter Review
Actually, not entirely sure who to request review for on this one...

Mark, if you think someone else is better suited, would you send it to them for review?
Attachment #663727 - Flags: review?(mark.finkle)
This requires the patch for bug 784887 before it will work correctly. 

Also, it should be noted that this patch works, but doesn't preserve scroll position very well. It's currently preffed off, and will be landed that way until things are a bit more polished.
Blocks: 795932
Attached patch b710298 (v2)Splinter Review
New version of the patch that utilizes Wes' changes in b784887.
Attachment #663727 - Attachment is obsolete: true
Attachment #663727 - Flags: review?(mark.finkle)
Attachment #667110 - Flags: review?(blassey.bugs)
Comment on attachment 667110 [details] [diff] [review]
b710298 (v2)

Review of attachment 667110 [details] [diff] [review]:
-----------------------------------------------------------------

r=blassey with preference listener added and debug messages removed. Happy to re-review with those changes if you'd like though.

::: mobile/android/chrome/content/browser.js
@@ +3519,5 @@
>      Services.obs.addObserver(this, "Gesture:DoubleTap", false);
> +    //Services.obs.addObserver(this, "MozMagnifyGestureStart", false);
> +    //Services.obs.addObserver(this, "MozMagnifyGestureEnd", false);
> +    //Services.obs.addObserver(this, "MozMagnifyGestureUpdate", false);
> +    

ws

@@ +3539,5 @@
> +                        aEvent.type === "MozMagnifyGestureStart")) {
> +      this.observe(this, aEvent.type, JSON.stringify({x: aEvent.screenX, y: aEvent.screenY}));
> +      return;
> +    }
> +    

ws

@@ +3689,3 @@
>      }
>    },
>   

ws (not yours)

@@ +3804,5 @@
> +     this._mLastPinchPoint = {x: data.x, y: data.y};
> +   },
> +
> +   onPinchFinish: function(aData, aX, aY) {
> +     let reflozPref = Services.prefs.getBoolPref("browser.zoom.reflowOnZoom");

probably don't want to check the pref every time. Instead, get the value the first time, cache it, and add a pref listener

::: widget/android/nsWindow.cpp
@@ +1457,5 @@
>  
>    switch (ae->Action() & AndroidMotionEvent::ACTION_MASK) {
>        case AndroidMotionEvent::ACTION_MAGNIFY_START:
>            msg = NS_SIMPLE_GESTURE_MAGNIFY_START;
> +          printf_stderr("***** DEBUG_jwir3: Dispatching NS_SIMPLE_GESTURE_MAGNIFY_START.\n");

I'm assuming you don't want to land these debug messages.
Attachment #667110 - Flags: review?(blassey.bugs) → review+
Inbound, with changes requested by blassey:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fba8214bfe19
Target Milestone: --- → Firefox 18
https://hg.mozilla.org/mozilla-central/rev/fba8214bfe19
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 798824
Here is a video of this feature: http://www.youtube.com/watch?v=23ngCT3xqVU
(In reply to Scoobidiver from comment #10)
> Here is a video of this feature: http://www.youtube.com/watch?v=23ngCT3xqVU

"Enable Reflow-on-Zoom" option was added in Settings and it's working the same as in this video. The soundtrack is great also :D

Closing bug as verified fixed on:

Firefox 18.0a1 (2012-10-09)
Device: Galaxy Note
OS: Android 4.0.4
Status: RESOLVED → VERIFIED
Flags: in-moztrap?(nicolae.cristian)
Alias: reflow-zoom
Depends on: 799333
Testcase added under Firefox Mobile: Settings Menu case for Firefox 18 and 19 versions (for both tablets and phones):

https://moztrap.mozilla.org/manage/cases/?filter-id=2738
Flags: in-moztrap?(nicolae.cristian) → in-moztrap+
Depends on: 799865
Blocks: 800662
Depends on: 800805
Depends on: 803719
Depends on: 804640
Depends on: 808173
Depends on: 830645
Depends on: 836565
Depends on: 836568
Depends on: 878928
Depends on: 878931
Depends on: 878935
Depends on: 878940
Please return text reflow to Firefox!

I was on Firefox 25 and have had to revert back to Firefox 23, and stuck on it. Whatever the reason, it's NEVER suitable to have to scroll left to right on a phone to read text.

And in real world terms that's the Firefox 24+ reality, the fangled automatic font size setting doesn't work. Give the user the control!

It may not have been perfect from a technical stand point but from a user stand point, if it ain't broke don't fix it.

Bring it back as an optional setting, leave it disabled if you like.

Incidentally Samsung have broken text reflow on Galaxy phones, so don't even get it on the Android browser or Chrome.

Text reflow is such an incredible must have!
tracking-fennec: 18+ → Nightly+
Keywords: feature
Please reopen this! We need this feature and removing it from Firefox means it is no longer fixed.
Flags: needinfo?(jaywir3)
(In reply to nardholio from comment #15)
> Please reopen this! We need this feature and removing it from Firefox means
> it is no longer fixed.

This is still in Firefox. It's simply not enabled by default, due to a number of reasons (mainly performance). You can enable it by going into about:config and adding the preference 'browser.zoom.reflowOnZoom' and setting it to 'true'.
Flags: needinfo?(jaywir3)
No way it is. Why hasn't this been said before?

It doesn't work very well though. It only "reflows" if you pinch to zoom then move forward to a new page then move back.

Simply pinch to zooming or pinch to zooming then reloading the page and reflow doesn't work.

It should never have been removed in the first place.
I think the bug you're looking for is bug 1127441.
(In reply to alexmcc78 from comment #17)
> No way it is. Why hasn't this been said before?
> 
> It doesn't work very well though. It only "reflows" if you pinch to zoom
> then move forward to a new page then move back.
> 
> Simply pinch to zooming or pinch to zooming then reloading the page and
> reflow doesn't work.
> 
> It should never have been removed in the first place.

Pinch-to-zoom reflow on zoom was turned off a while back, due to performance problems. Reflow is typically the most expensive operation the layout system will perform on typical pages. Pinch-to-zoom reflow was replaced with double-tap-to-zoom reflow, if the preference is enabled. Further, a number of constraints were added to make it work better, similar to the constraints imposed on font inflation.

See bug 847872.
(In reply to Scott Johnson (:jwir3) from comment #19)

> Pinch-to-zoom reflow on zoom was turned off a while back, due to performance
> problems. Reflow is typically the most expensive operation the layout system
> will perform on typical pages. Pinch-to-zoom reflow was replaced with
> double-tap-to-zoom reflow, if the preference is enabled. Further, a number
> of constraints were added to make it work better, similar to the constraints
> imposed on font inflation.
> 
> See bug 847872.

Oh I see thanks. That's a shame, especially given how powerful Android hardware is these days.

"double-tap-to-zoom reflow" I can't get that working either. Double tapping doesn't do anything :-(. I'm using Firefox 38.0.5 for Android.
(In reply to alexmcc78 from comment #20)
> "double-tap-to-zoom reflow" I can't get that working either. Double tapping
> doesn't do anything :-(. I'm using Firefox 38.0.5 for Android.

So, if I remember correctly, the reflow-on-zoom uses the font inflation setting for how large you want to text to be. In the bug that Kats quoted a bit ago, font inflation was turned off, causing the parameters for font inflation to be hidden (I think). What this means is that there isn't an easy way to control the size at which text is considered "ideal".

You can change the setting in the about:config parameter 'font.size.inflation.minTwips'. Reflow-on-zoom attempts to size the text to this setting (considering that the user considers this the minimum readable size). It will then reflow the page to wrap text according to the bounds of the viewport.

I'm not 100% sure of the state of this, since I've been out of the loop for a while. I will tell you that when this was last worked on, to the best of my knowledge, it was only really useful in situations where really tiny text was displayed on the phone. (In most cases, the text is actually sized appropriately by the page author now, so it's not really that useful of a feature)
Hi,

3 years later and text reflow did not become less important than it was before. Websites have not changed significantly in terms of how readable they are without zooming.

With Opera it just works - it really works fine out of the box using the normal zoom gesture.

On Firefox, this behaviour is off by default.

Can someone please confirm whether in the current version of Firefox a behaviour equivalent to Opera can be turned on?

Thanks,
Gustavo
There is no such behaviour in the current version of Firefox.
Thanks for the clarification Kartikaya. I'd just kindly point out that this feature looks like game-changer from the anecdotal evidence I gathered from people around me. Would be very interesting to have it back on Firefox mobile.

I cannot stress enough the importance of this feature.

It is the sole reaon I use Opera on my Android devices. As others have pointed out, the need for this feature has not gone away over the years, not even on the latest devices with 6" screens, such as the Gemini PDA I'm using to write this comment. Even in landscape mode, the way the Gemini is deisgned to be used, the need for text reflow is still there.

I desperately want to switch to Firefox Mobile but the continued lack of this feature ties me to Opera.

Please reconsider. If Opera can do this, Mozilla can too.

I confirm that the need for this feature did not go away. I still use Opera on the phone specifically because of this.

Now that hardware is more than capable, can pinch to zoom + text reflow be brought back to Firefox?

Folks following this bug might be interested in bug 1540809.

Please note:

  • The behaviour suggested in that bug is not on any kind of official roadmap. It's just a user suggestion, which I plan to run by UX for an opinion.
  • The behaviour suggested there is not the same as the past behaviour of the browser.zoom.reflowOnZoom pref (though it's related). Please keep any discussion in that bug on topic, that is, related to the suggestion being made in that bug.
See Also: → 1504809
See Also: 15048091540809
See Also: → 795552
See Also: 795552
Depends on: 1547181
No longer depends on: 1547181
See Also: → 1547181
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.