MathML in Chromium

MathML plans for 2021
15 February 2021

Igalia will restart their MathML work in Q2 2021.

It’s been a while since our previous update on the implementation of MathML in Chromium so we thought it was important to provide an update on what Igalia has (and hasn’t) been up to, and why.

One big thing that has been happening during this time has been that Igalia has been helping to coordinate and facilitate the the re-activation of the MathML WG in the W3C. Our aim has always been to not only ship an implementation, but to help define MathML-Core, resolving the initial historical challenges and setting MathML back on stable standards footing. As part of this, we helped draft a new charter, present things to a few different groups within the W3C, answer questions during the early review phase and, help gather votes and answer questions on the charter itself. You can view the charter, as well as see a presentation we did at W3C’s annual conference on this thread.

Last fall, our implementations reached a point where things weren’t quite ready to move on due to some pending re-work that was underway. Given the pending charter, some necessary wait time and a number of more immediate opportunities, a few of Igalia’s engineers temporarily reallocated most of their efforts to help advance on some other exciting web platform projects such as distributed web or :focus-visible. While severly reduced in capacity during this time, we did still manage to do some MathML implementation tasks (i.e. fixes or reviews in security & stability) and fix a serious integration bug regarding the fact that legacy layout was forced for MathML in SVG, fragmented or editable trees.

Since then, however, things are shaping up on the charter and pending chromium rework has progressed a bit and we believe it’s time to start talks on how we take this up again. Our plans are to return to this work part time during the second quarter. Let’s recap the current status and plans with respect to the initial roadmap :

  1. Basic setup
  2. Basic Layout
    • Basic HTML-like implementation of mtable
  3. Operator Dictionary
  4. Stretchy operators
    • Stretch logic in <mrow>-like elements and under and over scripts. ❌
    • Using stretchy and symmetric attributes. ❌
    • Simple embellished operators ❌
  5. Advanced Style

According to Google engineers from the Rendering Core Team, a few LayoutNG features necessary to implement MathML Core completely won’t be ready very soon (more details below).

Igalia has a CL pending for mtable which still requires refinement to pass the test for alignment within cells. However, as said in previous announcements, this was pending on the new table support to be available. Currently, this new implementation is still being experimented by Google engineers with the flag flipping on and off recently. They seem positive it will be ready this year though. Once it gets stable enough, work on improving math tables can be restarted.

Regarding stretchy operators, a critical aspect is to ensure that the min-content and max-content inline sizes are calculated as described in MathML Core, otherwise a lot of gaps will appear in formulas. This concern was already raised when upstreaming started in fall 2019. From recent chats, the idea of better min/max pass for LayoutNG is relatively complicated, it will take time and resources from Google engineers and is not going to start before Q4 2021. However, in the meantime, we believe that a more rudimentary support for stretchy operators can be implemented.

Another important task that must be addressed before sending an intent-to-ship is related to accessibility. This was discussed with Google’s accessibility team in 2019 but not much progress was made, again due to other tasks of higher priority and some pending issues in MathML (such as text-transform changing string length or mtable support). Still, first experiments for ATK started and an initial MathML AAM draft was published.

There are additional features that would be helpful (though perhaps not strictly required) to implement before an intent-to-ship as well, such as font-related features (ink metrics, italics correction, font-family: math, etc) or improving interoperability (more conformance tests, refinements in specification, development in WebKit and Firefox). None are really a requirement for shipping, but they will be considered depending on available resources and progress on other tasks mentioned in the above paragraphs.

As usual, updates will be published on this blog when new milestones are reached. Stay tuned!

More news