28
Jan
reflow

We often take mobile web browsing for granted, but sometimes the simplest of problems can turn it into a miserable experience. One of the early improvements to Android’s built-in web browser was a neat little feature that allowed text to re-wrap based on zoom level. It’s an obvious function, something that seems natural for reading more than a few words on a small screen. Unfortunately, a significant change in Android 4.4 resulted in the loss of this incredibly convenient capability for most web browsers and several applications. Not only does this affect browsers that rely on the built-in layout engine, it also applies to every app that relies on an embedded WebView.

1148-38795-s6o6DG7F4zEWJyD-upload

The Problem

A lot of people probably haven’t even noticed the difference because it can be subtle on well designed web pages and may not even apply to pages designed for mobile devices. In older versions of Android, zooming in on a column of text, especially with a double-tap, would automatically enlarge and re-wrap the text so that it fit within the edges of the screen. The result was easily readable and didn’t require sliding the screen back and forth to see each line. The screenshots below are a good example of before-and-after.

3 pre KitKat2 KK wide viewport
Source: AOSP Issue Tracker - Left: Jellybean, Right: KitKat

Text reflow was not technically an automatic feature of the WebView, but something that app developers could easily enable by simply enabling NARROW_COLUMNS and SINGLE_COLUMN. It turns out that both of those settings are no longer supported or functional in KitKat, even for apps that still target older versions of the API. This appears to have been a side-effect of swapping out the old WebKit rendering engine for the new Blink engine.

You see, back in April 2013, Google announced that its Chromium Project, the open source component of the Chrome web browser, would be forking WebKit to create a custom layout engine called Blink. The intent was to remove some clutter and add deeper customizations. Chrome for Android officially made the switch in July with v28, and the AOSP WebView followed suit with KitKat in October. Despite being based on WebKit, which was able to reflow text, Blink seems to lack this ability. It's worth pointing out that one of the longest standing criticisms of Chrome for Android is that text reflow has always been disabled.

What Is Affected?

Losing text reflow in Chrome and the AOSP browser is certainly a problem, but it reaches farther than just a couple of browsers; anything relying on the WebView class has lost this feature. Some popular alternative browsers like Dolphin and Lightning offer their own customizations, but still use the built-in WebView for rendering. Naturally, we can also see this issue popping up in several apps that include embedded browser windows, something commonly found in Twitter clients, forum readers, RSS clients, and many others. Even some eBook readers have been known to render content to a WebView.

Screenshot_2014-01-26-05-40-27Screenshot_2014-01-26-06-23-21
Left: Gmail on Jellybean, Right: Gmail on KitKat

No Fix Coming

The bad news is that it appears Google intended to remove reflow and there's no going back. There is a section on the Android Developer site dedicated to migrating web apps to the KitKat WebView, which clearly states that single and narrow column layouts are no longer supported. Judging by the language used in that section, it appears that this was an intentional move. If that isn't enough confirmation, this issue has been declared "Working As Intended" and a project member has clearly stated that there are no plans to change course.

2014-01-27_08-27-06

It's not clear why text reflow would be a target for removal, but another closely timed event might offer some hints. Less than two months after the announcement of Blink, Google declared it would begin down-ranking websites that didn't serve smartphones. This could certainly be a coincidence and there's no firm reason to connect the two, but it may suggest Google is subtly (and very forceful) pushing web developers to focus on mobile devices. Of course, this is just speculation.

Workarounds

Since we know reflow didn't just disappear because of an oversight, it may be worth shopping around for software that can offer it. A good starting point is Opera for Android which has long been based on WebKit and offers many of the same features as Chrome. It followed Chrome in making the switch to Blink, but reflow has been implemented independently. You'll have to manually enable the feature by switching on Menu -> Settings -> Text Wrap, but it works exactly like you would expect.

Screenshot_2014-01-27-05-54-23Screenshot_2014-01-27-05-54-39Screenshot_2014-01-27-05-55-10

There are plenty of other browsers with text reflow, as well. Firefox for Android is a popular option, but it may not be as consistent as Opera and hasn't had the best year for security issues. Another option is Dolphin with the Jetpack extension, but potential users should be warned that Dolphin is known to track the urls you visit. Of course, you can also try Dolphin Zero which doesn't phone home, but it might be less convenient depending on your usage.

Switching browsers might be good for basic browsing, but it doesn't solve the issue for apps that rely on a WebView for more basic purposes. Unfortunately, there's no way to bring this functionality back without modifying the underlying firmware. Some custom ROMs like CyanogenMod have taken to reverting back to the AOSP browser code from Android 4.3. Update: Nevermind, they abandoned that plan.

Developers will find themselves in varying situations. If they can directly control the content being rendered by the WebView, such as eBook readers and web apps, it's probably best to just make these pages mobile-friendly. As a shortcut that closely emulates the old behavior, give a shot to this method posted on StackOverflow. For apps that have no control over the content, you may want to try the WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING algorithm or just leave it on the default layout and hope for the best. Neither option is desirable, but the alternative is to fire off an Intent and let the user pick a browser to view pages in.

Wrap-Up

Calling this a bug might be a bit inaccurate - it seems like Google intended to remove text reflow. Maybe the search giant really is tired of waiting on web developers to support mobile devices and decided to be more aggressive about it. Perhaps this is just a precursor to Google introducing an improved and more intelligent algorithm. After all, the method of forcing content into a single narrow column was a bit hack-ish and prone to its own set of bad behaviors. Whatever the case may be, besides hoping for a quick turnaround from the greater world of web development, there isn't much we can do.

Source: AOSP Issue Tracker,

Cody Toombs
Cody is a Software Engineer and Writer with a mildly overwhelming obsession with smartphones and the mobile world. If he’s been pulled away from the computer for any length of time, you might find him talking about cocktails and movies, sometimes resulting in the consumption of both.

  • Aaron

    That's crazy now that you mention it, I have noticed it in feedly today.

  • Fatal1ty_93_RUS

    But Text Wrap has been gone since, like, forever now? It's not just KitKat problem...

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      Chrome for Android never had it (as far as I can tell), but it was in the WebView class in AOSP up through 4.3.

  • spacekobra

    Typo, you got the two gmail pictures screwed up. Should be left Jellybean, right Kitkat

    Good read though, I was wondering if that was a bug or me going crazy.

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      Damn it, that's the second time I've done that this week. I put up pictures and then change the order without switching the caption.

      Thanks, great catch! fixed

      • Telefunken

        Now you just need to fix the that you consistently use "left" and "right" to distinguish between two images which are *always* on top of each other on every story on this site when viewed on an..uh..Android device.

        • Evan Knofsky

          Left is the going to be the top image, I don't see why they would need to change what they are doing now.

          • Telefunken

            It's wrong. No other reason.

        • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

          I think there's a solution for that when the site redesign is finished. Whenever that may be....

  • tokuiten

    Eh, I can't stand text reflow. It's an artifact of pre-smartphone mobile browsers. Won't miss it in the least.

    Of course, I categorically refuse to use any browser that doesn't allow me to, in a persistent manner, tell it to use a desktop useragent.

    • Joke99

      Some websites are nearly unreadable without reflow. Do you simply avoid them? Or are you cool with scrolling back and forth by line?

      • http://www.modminecraft.com/ Nick Coad

        That sounds like a web development issue.

        • Joke99

          Well, I'm not a web developer. But it's an issue for me. Is it not an issue for you?

          • http://www.modminecraft.com/ Nick Coad

            I mean it's an issue for a web developer to solve, not a KitKat issue. The web developer should be responsible for making their site readable, not the browser. Where should it end? How many web development mistakes should Google run around fixing for them?

          • Joke99

            When I first decided to get a smartphone 2.5 years ago, it was able to capably handle all the websites I visited most frequently. Now with KitKat, at least 2 of those are nearly unusable.

            You're welcome to your opinion that these are development mistakes needing to be fixed by the millions of websites that render poorly. I hold the opposite opinion. To me, smartphones truly came of age when they attained the ability to render standard websites in a way that was functional for the user. Moving away from that, and making it really unpleasant to use your phone with anything other than a "mobile" version of website feels like a return to the Blackberry world of the mid-00's.

        • Mad Girl Disease

          This is a step backwards no matter how you effing slice it. And
          arguing whether the fault, or responsibility, most properly lies with
          the site or the browser -- or the OS, the carrier, or whoever else the user might blame -- overlooks how when people buy and use these devices they're buying a system and don't readily distinguish between its components. It degrades the composite Android experience.

          As s smartphone user making a decision about buying a new device and renewing a contract, this is a direct disincentive for both. I can just as easily get a lesser experience by staying right where I am: out of contract, a device that works perfectly as a phone, and a slowly degrading experience with an outdated version of Android.

          It's hard to see how this is in anyone's interest other than Apple's.

          Everyone who likes horizontal scrolling, raise your free hand.

  • Jorim Tielemans

    Can't this be implemented using a yet to be made Xposed-module?

    • William

      The short answer. YES, pretty much anything can be done with xposed.
      The little longer answer: yes, but good luck with that. The more changes made to aosp the more and more unrealistic this will be come.

    • Nate

      I came here to say that. Kinda waiting now. Devs are awesome--if this is perceived as a big enough issue--we'll definitely get a module that does this.

  • Anthony Restaino

    Oddly enough I haven't had one single complaint from users about TextReflow not working in KitKat on my browser. So many websites are mobile friendly now I guess people just don't notice that much.

    • Ror

      I think sticking with Blink (which Google want to optimize for mobile devices more than anything this year) is more important than less-needed things like text-wrap. Just like it's not a big deal a lot of old WAP sites don't work anymore. Its a niche need.

      • Anthony Restaino

        Definitely. A lot of people have been upset that Google switched to Blink, but the WebKit had huge rendering problems that weren't getting fixed and now it's all well with Blink.

  • http://twitter.com/rluik Rafael Luik

    Yes Opera is the best alternative. They base it in Chromium 32 in the latest version, yet they implement text wrap themselves.

    And Opera is Blink-based not WebKit!

    • Roger Siegenthaler

      CyanogenMod should license Opera's Blink to power their WebView/-Engine, seeing as they have the cash now it's a very real possibility.

    • David Hart

      I just don't have all my passwords/autofill, bookmarks, history, open tabs, or translate.. but damn Opera is nice for desktop view and text wrap.

  • matteventu

    "Some custom ROMs like CyanogenMod have taken to reverting back to the AOSP browser code from Android 4.3."

    Sadly, not

    "Status: Abandoned"
    (from the CM code review page)

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      (rage)

      I wrote this a few days ago and pushed publishing it until now. I didn't think to re-check that link. Thanks!

      • matteventu

        ;)

        (and ..I. to the Android team)

    • eff

      If you want open source, you could just use Firefox.

  • Brayden Reesor

    Yeah.. I maintain an RSS application, and this was a pain in the ass. For me, however, the issue with them disabling NARROW_COLUMNS and SINGLE_COLUMN was with images that were too large for the screen. Instead of it re-sizing them down to fit, they'd just overflow and mess up everything. I eventually fixed it through some html/javascript hackery. But it's definitely less convenient/more complicated.

  • http://gadgeticmusings.net/ Soul_Est

    Opera wasn't always based on WebKit. They used their own engines (Presto or Carakon I think) before switching to WebKit.

    • Fatal1ty_93_RUS

      Let alone the fact that Opera had wrapping since Symbian days

      • http://gadgeticmusings.net/ Soul_Est

        Thanks for reminding me of that. I'll stick with Opera.

    • hhhh

      Opera is now blink based, but they added text wrapping. Best of both worlds

      • http://gadgeticmusings.net/ Soul_Est

        Agreed. Why couldn't Google have done the same I wonder?

  • Carlos

    This was driving me nuts on Gmail. Thanks for the explanation (and the bad news)

  • Fatal1ty_93_RUS

    By the way, why do mobile and desktop versions of Chrome use different engines? Platform limitations?

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      What do you mean? Both are using Blink for layout and V8 for Javascript execution.

      • Fatal1ty_93_RUS

        Ah, heck, they do :/ my mistake

        • Telefunken

          So what explains Chrome randomly changing font sizes? Slashdot on Chrome for Android makes seme text (for example Slashdot headlines on the desktop site) far too small to read, whereas it's done correctly on the desktop browser. Is there some technical reason for this, or is it a bug? (Right now you might be able to see the difference on the headline "AMD announces First ARM Processor")

          • Fatal1ty_93_RUS

            Oh yeah, that one... It has been getting on my nerves a lot, and AOSP browser NEVER had that issue... I guess it's a text scaling bug that has been pursuing Chrome since it appeared on Android but never really got to the devs because, you know, they don't go to every site and test it to se such issues

          • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

            That's another bug in the layout engine. There's a vague mention of it in the issue tracker thread I linked to, but I stumbled onto a little more detail somewhere else, but I can't seem to find the link now. They know about that one and intend to fix it, but it's an issue with the TEXT_AUTOSIZING algorithm. The idea is that it sizes text in columns in advance for different zoom levels, that way it doesn't have to be reflowed when somebody zooms in to the preferred level. It's really obvious on reddit.

  • Firelight

    Dolphin no longer tracks clicks (per XDA) and thanks for the Jetpack solution. Reflow is back! Some may not like it but for non-mobile optimized pages (like the insufferable newsandobserver.com) this is a must.

    • Queeblo

      No, Dolphin encrypts data so there is no way to know what information they are phoning home. Dolphin Zero also phones home data. Dolphin / Boat / Maxthon / Next / One / Baidu / etc. devs are all scumbags.

  • Dr_knowhow

    You might want to correct the heading to stock and AOSP android as I am running 4.4.2 sense based Rom on HTC one and text reflow is working perfectly on its stock browser .

  • Stanley Chan

    I think the old good AOSP browser is trully dead now.

    No browser will be Like AOSP. Chrome cant even get close to te fast rendering page and other things.

    Why people still keep with Windows XP? 'Cause is a good OS. Simple that.

    New techs are not always good. We have to understant some things.

  • BlackBoy88

    Thank you for calling this out.

  • msrkg

    Opera is based on blink not webkit

  • Carlos David

    This seems a job for XPOSED! Tada...or teehee

  • Jon

    What bothers me is the ones bothered by this decision are the users. I reckon they could have implemented something less annoying, maybe a small warning on a corner that you could dismiss or something. Now you're forced to seek for another browser. Not to mention a lot of apps are gonna need some fixing on their own due to Google's decision.

    • http://www.modminecraft.com/ Nick Coad

      I've been using KitKat since the Nexus 5 was released and I hadn't even noticed. Claiming that anyone is being "forced" to do anything is ludicrous, it's not as big a deal as everyone is making it out to be.

  • GraveUypo

    it almost looks like google's making an effort to make everything worse, ffs.

  • Martin Cohen

    First Google severely damages Maps (no save as contact, no my maps, poor navigation), and now this. To coin a phrase, What Are They Thinking? Makes the iPhone look more attractive every day.

    • Lucas C.

      The reason for this decision is simple: Google made this travesty to force
      people to still see the goddam ads. When you use text refow, the user
      will basically only see the text, and every other content will not be
      visible. It's the same story with the death of Google Reader. On my
      part, if I was not getting money out of the Android ecosystem through my
      apps, I would stop using Google services altogether.

  • wurst

    It's laudable that this article is now here.

    But it's absolutely not understandable why it comes only now - MONTHS after Kitkat was released and this bug / annoyance / impudent move by Google became apparent!

    All people talk about the absolutely minor and insignificant changes in Kitkat and how Kitkat is the best thing since sliced bread (which it ISN'T!), but the most glaring change doesn't get mentioned at all for months.

    Humans are a strange breed.

    • http://www.androidpolice.com/author/cody-toombs/ Cody Toombs

      'Ay, I'm workin' here!

    • BlackBoy88

      At first I though that I was doing something wrong on my end until this blog post.

  • wurst

    @all who say: "OK, then simply make all websites mobile-friendly, and the problem will be solved because the text wrap is no longer needed":

    You're wrong, very wrong!

    Text wrap enables users to CHOOSE a text size which they can comfortably read and then wrap the text.

    The implementation of Google forces the user to use the text size which is defined by the website and the global browser settings! (Which, needless to say, can be too small or too big.)

    • guest

      This! Even mobile sites have different text sizes, this users still need a way too choose the text size that is comfortable for them,

    • http://www.modminecraft.com/ Nick Coad

      Except that part of making the web site mobile friendly would be making the text an appropriate size. If your visitors are having to zoom, you've fucked up.

      • wurst

        Which text size is appropriate is an individual preference of the user! That's what I wanted to say and what you don't seem to understand!
        Some people like their text rather small so that they must scroll as little as possible and can fly over paragraphs as fast as possible.
        Other people like their text big because they have not-so-good eyesight.
        Capisce?

        • Duffy

          Truth. I'm legally blind but i am constantly checking news articles on my phone for work. I am always zooming in to read content. I actually prefer zooming to mobile sites or apps b/c the text is typically too small. Users aren't one-size-fits all, and if Google's goal was to make the browser more customizable, they took a step backward in this regard. Reflow is a big reason why I've stayed with Android. Maybe it's time to reconsider.

          • Lucas C.

            I can only imagine that Google made this travesty of a decision to force people to still see the goddam ads. When you use text refow, the user will basically only see the text, and every other content will be not visible. It's the same story with the death of Google Reader. On my part, if I was not getting money out of the Android ecosystem through my apps, I would stop using Google services altogether.

  • Edward Dunlap

    I hate the lack of this feature, which is (the only reason) I use Opera.

  • lehung
  • Telefunken

    How does pushing developers towards smartphone-friendly sites work? What screen size are they targetting? How will it work, without flow, on both a small iPhone in portrait and a 10inch tablet in landscape?

  • kingdazy

    "Maybe the search giant really is tired of waiting on web developers to support mobile devices and decided to be more aggressive about it."
    Interesting. I suppose this tactic works well enough as intended for sites that are publishing things daily, media "outlets" (read as: the Gawker empire), advertising and sales sites (BestBuy, Walmart, Target), but a large segment of "The Internet" in general is archives, old things, information, searchable content, smaller sites with no financial motivation to adhere to The Lord Googles standards.

    • Lucas C.

      The reason for this decision is simple: Google made this travesty to force
      people to still see the goddam ads. When you use text refow, the user
      will basically only see the text, and every other content will be not
      visible. It's the same story with the death of Google Reader. On my
      part, if I was not getting money out of the Android ecosystem through my
      apps, I would stop using Google services altogether.

  • Scott Ricketts

    HTC bakes this into their browser and has for ages now. Chrome, for some reason, has never had this in my memory and it's always pierced me off.

  • gsDroid

    I'll never use a browser that doesn't support text reflow. Chrome can go suck it. I've found that the Dolphin browser works great. Supports text reflow and automatically goes to a new tab (unlike Chrome which is another reason not to use it.)

    • Queeblo

      And Dolphin phones home your data.

  • jl sc

    time to look at apple or microsoft. maybe competition will get google to think of the customer again

  • Mike

    Chrome for Android intelligently chooses font to be readable, making this mobile wordwrap unnecessary.

    • Paul Hanlon

      Wow, it has a built in opthalmologist? That's great

    • Joke99

      And it looks like hot garbage, especially on discussion forums. Every comment in a different sized font! It resembles nothing so much as a ransom note.

  • John Smith

    WebView is so f'ing fragmented anyway - one more issue like this is like a drop in the bucket.

    Pro tip:
    don't use the damn WebView in a native app... EVER!... because it's full of heartache when you have to tell your Project Manager :

    "I recommend against shipping that feature because HTML5 works well on phoneA with 4.4.2 and phoneB with 4.2.2 and phoneC with 4.1, but phoneA with 4.1 doesn't function"

  • markgbe

    who cares?

  • artcomm

    If there is an impractical way of reading, it is when you need to scroll from side to side; it's simply unbearable. I find it aggrivating and I need to use it when the content is interesting and that's the only way to go about it. Now, why in the world would a company like Google need web sites to have two flowing versions, one for the desktop and one for the mobile phones screens? When desktop sites are properly designed, it's possible to focuse on one column and read; most of the time I find myself reading using the iPad/iPhone built-in reader, which could be better if it had the final touch for reflowing text once you have extracted the part of the page you need. I'm returning the Samsung S4 today, simply because the text reflow feature is not there anymore! And I know it isn't Samsung's fault (in part it is, since they should've pressured for the feature NOT to be taken away from Android 4.4), but it's mainly a bad decision within those that are working on Android. And no, Opera does have the single column mode, but once in that mode, no text-reflowing. So, Good-by Android! Back to my jailed iPhone/iPad world. It's clearer (and just as expensive in the large, full featured models).

    • Lucas C.

      The reason for this decision is simple: Google made this travesty to force
      people to still see the goddam ads. When you use text refow, the user
      will basically only see the text, and every other content will not be
      visible. It's the same story with the death of Google Reader.

      On my part, if I was not getting money out of the Android ecosystem through my
      apps, I would stop using Google services altogether.

      But you are wrong about Opera: it's text reflow works well. I believe it just uses the javascript hack mentioned on the beginning of this article, which is the same thing I did on my apps. Jut go to settings, and check "Enable text wrap".

  • Andre

    The only way is to stay in JB. I never considered Kit Kat as something really new.
    I usually browse through several websites and reading is impossible with KK.
    I hope Google change their minds because reading is still practiced by many people.

  • Donald

    Thanks for the hint to Opera. Made it the default browser on my now CM11-based S4 Mini. I'm far-sighted, and this KitKat nonsense that doesn't acknowledge users' needs was almost making me downgrade to CM10.1. Thanks to this hint I may as well stay on CM11 if Opera cuts it in all the other disciplines. Well... didn't uninstall Chrome and Dolphin for now ;-)

  • Tudor Ioan

    decentest clearest explanation on web :)