While working on MathML support in WebKit in 2016, Igalia has regularly been in touch with Google engineers involved in Chromium layout developments. Following the technical discussions, there is now a general agreement on the way to proceed the implementation. The general technical agreement is based on two important premises.
The proposed implementation focuseson the MathML rendering described in this implementation note which extends MathML with some rules from the MATH table of the Open Font Format and from the TeXBook’s Appendix G. and which focuses on good integration in HTML5 technologies and in web engines.
As a consequence, it becomes much easier to write conformance tests that can be automatically executed in web engines. Tests for that implementation note have already been integrated into the official W3C’s web-platform-tests in order to ensure consistent rendering in Gecko, WebKit or any other web engines compatible with that test framework. This approach has been already successful for Gecko and WebKit developments.
The implemenation will be done directly in Blink. We will rely on the existing C++ implementation of Houdini as well as other non-exposed features (e.g. HarfBuzz OpenType MATH support). Houdini is a set of specifications providing APIs to allow web authors to implement their own custom layout and rendering.
Additionally, we identified and discussed with Google the following basic features required to build a proper MathML implementation:
Here is a proposed roadmap with estimated full-time resource. On the one hand, testing and review might require additional work or waiting period. On the other hand, some tasks may be performed in parallel. Initial plan may be adjusted as we make progress or depending of the funds raised.
We will create basic classes for the following MathML elements as well as simple layout using LayoutNG. Right-to-left and vertical layout should be taken into account from the beginning.
<merror>(with special CSS style),
semantics: just display the first child and hide annotations.
We will create partial implementation of some layout elements. Some, but not all OpenType MATH constants will be used. During this step,
displaystyle is assumed to be true while
scriptlevel is not incremented.
<mfrac>), with its
mpaddedwith simplified interpretation of
We will import the operator dictionary from WebKit and implement the following
form(for selecting an entry in the dictionary)
movablelimits(to perform spacing in under and over scripts)
rspace(to perform spacing in
This is an important step during which the following tasks will be performed:
MathVariantstable. See this blog post for a shaping algorithm.
largeopoperators in under and over scripts (again, we assume
displaystyleto be true for now).
<mrow>-like elements and under and over scripts.
mroot): Some, but not all OpenType MATH constants will be used. During this step,
displaystyleis assumed to be true while
scriptlevelis not incremented.
The following attributes will be considered:
Additional features and bug fixes might be considered if time permits. For example:
href: To do hyperlinks.
menclose: To draw special notations (important ones such as horizontal strike).
mtable: Extra attributes for spacing or alignments.
sstyfeature to adjust the size of pre-scripted operators.
maction or elementary math will not be considered in this project.