Page MenuHomePhabricator

Math equations not rendered on old native Android browsers (e.g. Android 2.1)
Open, LowPublic

Description

(Wikipedia article Bestimmtheitsmaß using Android 2.6.29 lg-electronics@si-rd10-ubld01 [hash]1 Tue Dec 7 16:57:09 EST 2010 native browser which does not support SVG)

When it is not possible to render the equations


(math.stackexchange, same device)

the source code should be shown, which, at least for mathematicians is also perfectly readable. Preferably the original LaTeX source code as written by the Wikipedia-editor, not what texvc derives from it.

Event Timeline

Debenben created this task.May 15 2018, 2:50 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 15 2018, 2:50 PM
Debenben updated the task description. (Show Details)May 15 2018, 2:56 PM
Aklapper renamed this task from Math unreadable on old android browsers to Math equations not rendered on old native Android browsers (e.g. Android 2.6).May 15 2018, 3:04 PM
Pkra added a subscriber: Pkra.May 15 2018, 3:12 PM

@Debenben a couple of questions.

  • Since there's no Android 2.6, I'm wondering if you mean the kernel -- you had mentioned 2.6.29 in another thread which would make this Android 2.0 or 2.1.
  • what browser or application is the screenshot from? (E.g., Android browser, Wikipedia App.)

@Pkra You are right, it is kernel version 2.6.29 and android version 2.1 update 1. The application is the native Android browser.

Debenben renamed this task from Math equations not rendered on old native Android browsers (e.g. Android 2.6) to Math equations not rendered on old native Android browsers (e.g. Android 2.1).May 15 2018, 3:16 PM
Pkra added a comment.May 15 2018, 3:41 PM

Thanks. A first guess would be that SVGs are used instead of PNGs (which would be required for that browser).

Next step. Can you open one of the equation images and check if it's an SVG? (E.g. the URL will include "svg" in the path or you could paste it here.)

When I click it in the android browser it does not open anything and I also can't copy it. I guess it should be click-able though, because the question-mark-icon slightly changes appearance when clicked. I don't know how I can debug it on that device, the browser doesn't give any useful options.

Pkra added a subscriber: mobrovac.May 15 2018, 7:28 PM

Thanks, @debenden. That's too bad. I couldn't get an old android simulator to work to test it myself.

Maybe someone from WMF could tell which browsers still get PNGs; ping @mobrovac.

If it's indeed the case that SVGs are deliverd instead of PNGs, then the next question seems to be whether MediaWiki supports this version of the Android browser. According to https://www.mediawiki.org/wiki/Compatibility#Browser_support_matrix "Android 2+" is listed with "basic support" which in turn includes "image formats used by the content"; so maybe that's in scope.

Debenben added a comment.EditedMay 15 2018, 8:40 PM

What I can do is:

  1. login with my account
  2. use the desktop-view
  3. go to preferences and select png images (using the mobile view I don't get those preferences)

and get an acceptable rendering of those formulas which also works if I switch back to mobile view.

However then (since the equations don't wrap around like on math.stackexchange) larger display equations get cut-off on the right. In the mobile view I can only zoom out until they become unreadable and not scroll horizontally like in the desktop view. I would already be happy if it would just fall back to printing the source code without me having to login or change any settings.

Pkra added a comment.May 15 2018, 8:53 PM

Thanks, @Debenben. I'd suggest first to track down the issue and then think about mitigation strategies (temporary or otherwise).

(But if you need a workaround right away, there's this trick using custom scripts.)

This looks like an issue for the Mobile Frontend folks, so tagging as such.

Maybe someone from WMF could tell which browsers still get PNGs; ping @mobrovac.

The default is MathML with SVG fallback for all domains. Additionally, there is a client-side feature check for SVG which should kick in in this instance, but it doesn't.

Pkra added a comment.May 16 2018, 11:19 AM

Thanks for confirming, @mobrovac!

Jdlrobson added a subscriber: Jdlrobson.

They're using SVGs e.g. https://wikimedia.org/api/rest_v1/media/math/render/svg/e32110fbce4646ee22f018ae3e27902aa708badd and Android 2 does not support SVG.

We only support Android 2 in a basic support mode (https://www.mediawiki.org/wiki/Compatibility). To fix this, the Math extension would need to use a combination of srcset and png fallbacks for all Math equations. Is that possible from the services side?

Pkra added a comment.May 29 2018, 3:44 PM

@Jdlrobson PNGs are generated, eg., https://wikimedia.org/api/rest_v1/media/math/render/png/e32110fbce4646ee22f018ae3e27902aa708badd.

As @mobrovac mentioned, the modernizr-like check that's in place seems to fail (or perhaps there's an earlier failure).

That's because no JavaScript runs at all in Android 2 so this code won't get executed. The change would need to be in the HTML markup for this to work (e.g. an onerror attribute - https://www.sarasoueidan.com/blog/svg-picture/)

Pkra added a comment.May 29 2018, 3:58 PM

That's because no JavaScript runs at all in Android 2 so this code won't get executed.

Ah, that would explain it ;-)

The change would need to be in the HTML markup for this to work (e.g. an onerror attribute - https://www.sarasoueidan.com/blog/svg-picture/)

Great. If the onerror approach is ok, that seems straight forward.

I haven't read up on all the context (sorry), but from a quick glance, it looks like it might make sense to default to using PNGs in the basic HTML response from the server. Also, to provide SVGs to newer browsers and for optimum high-resolution rendering, it might be possible to use the srcset attribute for the SVG url. Android 2 is old enough that it doesn't support srcset. This has the benefit of not requiring inline JavaScript event attributes and working in a wider set of environments (search-engine scraping, static HTML, Parsoid, VisualEditor), and probably resulting in simpler and easier to maintain code (given pure HTML without embedded JavaScript).

ovasileva triaged this task as Low priority.May 30 2018, 2:19 PM
Vvjjkkii renamed this task from Math equations not rendered on old native Android browsers (e.g. Android 2.1) to 3wcaaaaaaa.Jul 1 2018, 1:09 AM
Vvjjkkii raised the priority of this task from Low to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
mobrovac renamed this task from 3wcaaaaaaa to Math equations not rendered on old native Android browsers (e.g. Android 2.1).Jul 1 2018, 10:50 AM
mobrovac lowered the priority of this task from High to Low.
mobrovac updated the task description. (Show Details)
Pkra moved this task from Incoming to SVG specific on the Math board.Dec 8 2018, 12:09 AM