MathJax 2.0 was released last Sunday and contains a lot of bug fixes and new features. The changes are extensively described on the MathJax web site, but one of them is particularly important to know for Mozillians, so I thought I should write a blog post about it. As indicated in the title, MathJax 2.0 no longer uses Firefox MathML support by default, because of some (more or less serious) limitations of the Mozilla MathML engine. Maybe the main reason is the lack of support for <mlabeledtr>, which is essential to implement LaTeX commands introduced in MathJax 2.0 for equation labeling/numbering.

First of all, for those who do not know, MathJax is an open source Javascript display engine for mathematics. Basically, it parses mathematical expressions (e.g. LaTeX or MathML) inside the source code of a Web page, converts it into an internal format (more or less the MathML format) and outputs some code (HTML+CSS, SVG or MathML) that the browsers can use to render the mathematical expressions. MathJax allows to get an excellent rendering quality across all the browsers (as opposed to the traditional raster images of mathematical formulas), requires no specific installation for the visitors (no need for native MathML support, downloadable fonts can be used etc) and is very easy to set up and maintain for the webmaster (author just have to insert a <script> tag linking to the MathJax CDN and write LaTeX inside the source code ; automatic upgrades...). MathJax provides other advantages and also has some drawbacks, but I will not enter in the details here.

As it has already said elsewhere, three main reasons have prevented the mainstream adoption of MathML: need for a converter or other tools to generate MathML, need to serve the page as XML (until recently) and lack of a good support in main browsers. Because of the main advantages mentioned above, MathJax has become very popular, the MathJax user list is active and MathJax is even considered to be used by arXiv or Wikipedia. Since MathJax relies on MathML it has contributed to increase the use of this W3C recommendation. This has also obviously enabled the Mozilla MathML Project to receive a lot of feedback to improve its implementation.

Unfortunately with the release of MathJax 2.0, Firefox MathML support is going to be much less used or tested. More precisely, it will not be used by default on Web sites that use MathJax unless the web master modify this configuration or the visitors select it in the MathJax menu. It is definitely a shame for Mozilla and the MathML community in general to see that the best native MathML support will be disabled. I want to highlight that in most case, Firefox will display without problems the MathML code generated by MathJax. Thus if you are a Web master / Firefox user willing to help the Mozilla MathML project, I suggest you to override the default configuration. But more importantly, this change should encourage Mozilla developers to continue improving the Firefox MathML support so that it becomes the default renderer in MathJax again...

--update: I forgot to mention that now bug 356870 is fixed (Firefox 9), it is possible to show the label on the left of <mlabeledtr> rows with the simple CSS rule below. That should provide a satisfying result in most cases.

mlabeledtr > mtd:first-child {
  display: table-cell;
}

--update 2: Because I got feedback about that, I just want to clarify things: the change described here is not arbitrary or political. It has been made from a purely technical point of view: there have always been various issues in the MathML rendering that can be inconvenient for Firefox users. Now, MathJax 2.0 relies on two key MathML features that are missing in Firefox rendering (namely linebreaking and equation labeling) which are thought important enough to make the choice of switching to HTML-CSS. Again, please read the Bugzilla entry for technical details.