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 implementation 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:
During the project we will consider introducing new APIs or CSS features to support these features and they could be used as a foundation for future higher-level implementation in Chromium. That way this will ensure long-term alignment with Google’s layout goals.
This initial plan would be covered by the primary sponsor NISO.
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:
Depending on the other sponsors and the funds raised the following tasks, in no particular order, might be covered as part of this project.
MathML standard has been stalled for a while, with the new implementation in Chromium it seems a right moment to revive the standardization work around it.
Igalia would contribute to the different browser engines that support MathML (Firefox and Safari/WebKit) to improve interoperability between the different implementations and provide a proper maintenance of the feature.
Different tasks will be part of this work:
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.