Problem/Motivation

In #1963886: Use HiDPI icons in the toolbar and #2142655: [policy, no patch] Agree on a technique for loading SVG images in HTML that degrades to PNG we developed a technique for degrading SVGs to PNG files for browsers that do not support SVG. This was fairly easy but laborious for CSS background images, where it only required a few duplicate lines of CSS and attaching the modernizr library:

toolbar.icons.css

.toolbar-bar .toolbar-icon-menu:before {
  background-image: url("../../../misc/icons/bebebe/hamburger.svg");
}
.no-svg .toolbar-bar .toolbar-icon-menu:before {
  background-image: url("../../../misc/icons/bebebe/hamburger.png");
}

Although this is minor, it's still an extra, non obvious step for contrib module and I'm beginning to worry that most contrib module developers will just add the png image and be done with it (the Search API 8.x sandbox already does this).

Supporting png fallbacks for SVG in img tags is actually a lot harder. The method we developed in #2142655: [policy, no patch] Agree on a technique for loading SVG images in HTML that degrades to PNG requires a completely different tag to img and requires a total rebuild of the html element. See #2083949: filter.module: Update use of icons to new standards

Proposed resolution

According to Caniuse data the only major browser that doesn't support SVG is IE8, which we don't support anyway.

I propose we drop all support for browsers that don't support SVG. This will reduce complexity and improve DX.

Remaining tasks

  1. Agree on support policy
  2. Decide if we should remove all PNG equivalents from the core repo or leave them in to make it easier for contrib to polyfill support.
  3. Write a patch

User interface changes

IE8 users will not see SVG CSS background images, which should be purely presentational anyway.
IE8 users will not see SVG HTML images, but they should see alt text(?)

API changes

None

Comments

nod_’s picture

+1 from me.

Damien Tournoud’s picture

+1 here too. Especially since Drupal 8 isn't expected until mid-next year anyway.

chx’s picture

Most importantly, https://drupal.org/files/druplicon.vector.svg exists. Go ahead :D

AdamGerthel’s picture

+1. IMO we should remove the pngs as well.

Crell’s picture

The data seems to support this move, and so do I. SVG FTW.

Wim Leers’s picture

The New York Times dropped IE8 support a few days ago. If they don't support it, why should we?

+1

RainbowArray’s picture

My understanding is that we largely don't support IE8 already. I think the biggest effect of this decision would be that we would no longer be supporting Android 2.1 and down, as that's the other prime culprit beyond IE8 that doesn't support svg.

Wim Leers’s picture

mdrummond makes a great point — I think all of us in this thread so far forgot about Android. 15.7% of Android users are still on 2.2 (0.8%) or 2.3 (14.9%) (at the time of writing), neither of which has SVG support.
That being said, we have to think of the long term. Does anybody know of estimates when Android <=2.3 will have insignificant market share? How fast is Android 2.x disappearing? And even then, how many of them are not using Chrome? Because Chrome does exist for Android 2.x, is much faster, and does support SVG.

RainbowArray’s picture

Ah, you're right, it's Android 2.3 and down. Here's a chart from caniuse.com on SVG support: http://caniuse.com/svg

LewisNyman’s picture

Here are the trends for net market share (not device market share)

Android 2.3

Android 2.2

Both have halved in a year.

I'm happy to discuss about how we support phones with a limited feature set but if we we talked ourselves out of supporting IE8, that still has a huge market share in comparison, this seems like an obvious decision.

RainbowArray’s picture

Everybody's mileage is going to vary of course, but I just checked the browser stats in Google analytics for the primary site I manage (a local government website for a suburb in Minnesota), and while the Android Browser is 4.51% of our traffic, 99.21% of it is Android Browsers 4.0. I have one visit from Android Browser 3.0 and nothing lower than that. Numerically that's 2,532 visits in the last month on the Android Browser out of 6,227 total Android visits. So a little more than half are using the Chrome browser.

Again, traffic's going to vary per site, but that result surprised me. I thought there'd be some Android Browser 2.x traffic, but nope.

When I check OS versions, I do have 147 visits on Android OS 2.3.6: I guess they're using Chrome browser?

My hypothesis would be that in developing parts of the world we'd see more usage of older versions of Android. As to how much, I don't know.

I'm not trying to talk us out of dropping support for non-SVG browsers. Just trying to find some stats to base the decision on. Thanks for the info, Lewis!

chx’s picture

> My hypothesis would be that in developing parts of the world we'd see more usage of older versions of Android. As to how much, I don't know.

Father Google knows. It's freakin' all-knowin.

http://www.chinainternetwatch.com/6653/hd-large-screen-android-encroache...

chx’s picture

If we go into Africa, the picture is more grim. http://www.mtnblog.co.za/introducing-the-mtn-steppa/ this for example is set to topple the smartphone vs feature phone battle and it's introduced this January and it's gingerbread because the only way to push retail this low was to equip it with a truly weak CPU. Food for thought.

Edit: http://businesstech.co.za/news/mobile/53967/mtn-steppa-smartphone-a-huge...

Edit2: Maybe it won't last? http://ibnlive.in.com/news/celkon-campus-a35k-the-cheapest-android-kitka... this is $50 too.

Wim Leers’s picture

Assuming D8 will be released late 2014/early 2015, then it will become widespread/popular late 2015. AFAIK that means we have to estimate what the situation will be 1.5 years from now, and then decide whether we should retain Android 2.3 stock browser support or not. Because, again, anybody who browses relatively often on an Android 2.x device will want to install Chrome (or Opera Mini, or something else) anyway, because it's much faster.

I personally would say we drop IE8/Android 2.x stock browser support.

chx’s picture

Do we even test with the stock Android 2.3 browser whether our layout works in the first place? (I have a suspicion.)

Wim Leers’s picture

#15: We don't have official test procedures across the myriad of mobile devices, so… no. Your suspicion may very well be correct :)

corbacho’s picture

Wikipedia has a interesting chart of Android versions usage http://upload.wikimedia.org/wikipedia/commons/e/ee/Android_historical_ve...
In SVG, oh the irony

I don't think supporting Android 2.3 is worth it

sqndr’s picture

@corbacho: Haha. The irony, true story.

I agree. Don't think it would be worth it.

chx’s picture

I found a CM7 phone! Should I test D8 on it or just let it die :) ?

LewisNyman’s picture

Status: Active » Reviewed & tested by the community

I'm not really sure what the process is for policy patches. This feels RTBC? :)

LewisNyman’s picture

nod_’s picture

need change notice

nod_’s picture

Actually we might want a doc page with the list of unsupported browsers (and the reason for each). We can't realistically come up with a list of supported browsers (which means we'd have to test them all, all the time, we're not there yet).

RainbowArray’s picture

Should change notice explicitly state that SVGs will not fallback to PNGs?

nod_’s picture

yeah maybe. I think we can omit the fact that we introduced a fallback during development and just say that D8 uses SVG and makes no effort for old browsers. Or something like that :)

LewisNyman’s picture

Status: Reviewed & tested by the community » Needs review

Thanks for the feedback, I've updated change notice.

Wim Leers’s picture

Status: Needs review » Fixed

AFAIK this has been decided, and in fact #2298039: Remove all PNG fallbacks for SVG has already been committed, so we can mark this as fixed.

Nice progress in this area while I was away :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.