Turn on word-wrapping for plain text documents
Categories
(Firefox for Android Graveyard :: General, enhancement, P2)
Tracking
(firefox66 wontfix, firefox67 fixed)
People
(Reporter: JanH, Assigned: JanH)
Details
Attachments
(6 files, 1 obsolete file)
For ages I've wondered why text files didn't word-wrap when viewed on Android and require far too much horizontal scrolling, and now I know why:
"plain_text.wrap_long_lines" was never enabled by default in mobile.js.
On top of that, we should probably make plaintext documents render with "width=device-width", so that the text appears at a readable size even without font inflation enabled, i.e. basically what I did for view-source in bug 1392996.
Assignee | ||
Comment 1•6 years ago
|
||
Just as bug 1392996 did for view-source documents, this will ensure that plain
text documents will always render with a readable font size by default on
mobile.
Assignee | ||
Comment 2•6 years ago
|
||
Assignee | ||
Comment 3•6 years ago
|
||
I want to turn on word-wrapping for plain text documents on mobile. However
currently, these are rendered with the desktop viewport by default, leading to
still tiny font sizes and still having to scroll horizontally if you then
pinch-zoom in to achieve a readable font size.
While font inflation would solve that problem, the layout of plain text
documents is so simple that we can also just render them using a
"width=device-width" viewport instead.
This test will test that plain text documents will be rendered as they would
include a <meta name="viewport" content="width=device-width"> tag.
Assignee | ||
Comment 4•6 years ago
|
||
Based on the current implementation of nsContentUtils::IsPlainTextType(), we
could just call that function again if we need to know whether we're
dealing with plain text content or not later on, but doing it this way ensures
we're always consistent with the current code in StartDocumentLoad(), which
includes some additional sanity checks.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 7•6 years ago
|
||
Thank you for working on this! The lack of this has bothered me on multiple occasions.
Updated•6 years ago
|
Assignee | ||
Comment 10•6 years ago
|
||
It seems that that test is loading a 260 kB GIF as a text file (!). With word-wrapping turned on, we'll spend additional time reflowing and line-breaking the text, which on the ARM emulator is long enough to take us over the current timeout.
Assignee | ||
Comment 11•6 years ago
|
||
With word-wrapping turned on, loading that graphic as text takes around 7½ minutes in a debug build on the ARM emulator. Should I just increase the timeout on that test, should we use a smaller file there, or something else?
(In reply to Jan Henning [:JanH] from comment #11)
With word-wrapping turned on, loading that graphic as text takes around 7½ minutes in a debug build on the ARM emulator. Should I just increase the timeout on that test, should we use a smaller file there, or something else?
Geez. My vote goes for a smaller (saner) file.
Assignee | ||
Comment 13•6 years ago
|
||
The animation is cute, but one test is effectively treating the image data as a
text file, and displaying the whole file as text leads to very long loading
times on the ARM emulator when word-wrapping is turned on, especially with a
debug build.
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/65a5625c4790
https://hg.mozilla.org/mozilla-central/rev/dc422efc3103
https://hg.mozilla.org/mozilla-central/rev/7b61f5d7f7d2
https://hg.mozilla.org/mozilla-central/rev/60e8006f70d2
https://hg.mozilla.org/mozilla-central/rev/7634907d87d0
https://hg.mozilla.org/mozilla-central/rev/14e0efdd3d9c
Updated•4 years ago
|
Description
•