Page MenuHomePhabricator

Math Extension should support both MathML rendering and image fallback
Open, Needs TriagePublic

Description

By default, n 'mathml' output mode, MathML element generated by Math extension is always hide, only SVG image is shown.

Users have to manually insert custom CSS styles to let browser rendering mathml, and hide SVG images.

There seems to be some methods to let browser render mathml if available or degrade to SVG images. Why not support both ?

Event Timeline

Hi @AnotherUser002, thanks for taking the time to report this and welcome to Wikimedia Phabricator! Could you please follow the structure on https://www.mediawiki.org/wiki/How_to_report_a_bug ? Is this a feature request? Thanks.

@Aklapper

I think it's a bug report.

Steps to Reproduce:

  1. Go to https://en.wikipedia.org/wiki/Formula
  1. Select a formula, and inspect it's HTML source code, for example the formula whose xpath is "/html/body/div[3]/div[3]/div[5]/div[1]/dl[1]/dd/span"

Actual Result:

It's a node that contain a MathML element and an image. However, MathML element is hide by css rule, image is displayed all the time .

Expected Result:

For browsers that support MathML, for example Firefox and Safari, they should render formula directly. Only browsers that dont support MathML will fetch images rendered by mediawiki server.

@Vituzzu

not related exactly.

The problem of T278445 is that Chrome cant display PNG images correctly. Either wait for chrome's bug fix, or try to let chrome display SVG image.

AnotherUser002 changed the subtype of this task from "Task" to "Bug Report".Mar 26 2021, 4:43 PM

I would argue this is not a bug. When we started to implement that the MathML support of Firefox was simply not good enough and the MathML support (which can now be enabled in chrome nightly build) did not exist. Therefore, now we can consider to add another option to let users change their CSS configuration without custom rules. Can one estimate how many users would switch this setting, but not use the CSS solution?

It is 2014 when MathML is first introduced into mediawiki, and now it is 2021. MathML has already been supported by two of three major rendering engines used by modern browsers, and is being supported by the third, Blink.

There shouldn't be only two choice, pure image or pure MathML. And there are indeed some methods to support both of them with fallback.

If you insist that MathML support is far from enough, I respect your judgement.

Physikerwelt changed the subtype of this task from "Bug Report" to "Task".Aug 3 2021, 11:03 AM
Physikerwelt moved this task from Inbox to Needs community consensus on the Math board.

I checked https://caniuse.com/mathml and it seems there are about 3/4 that do not support MathML. However, that is something one could start with.