MathML 2024
As we have for several years now, Igalia continued its work on MathML. Thanks in part to some funding from the MathML-Core Support Collective, we were able to do more than we would have been able to otherwise.
This work was mainly geared toward advancing mathml-core integration in WebKit and Firefox, and our tasks were largely inspired by addressing feedback from the MathML Working Group and public submissions to Interop 2024 which were not chosen. We have made a very large amount of progress this year on these, with MathML now passing many tests for CSS styling of width
, height
, margin
and border
in all engines. These are useful properties in their own right, but are also fundamentally necessary for polyfilling other proposed features, or helping address other kinds of ragged support across browsers from the developer’s side.
The work (detailed below) was overwhelmingly focused in Firefox and Safari, since the initial integration of CSS in MathML-Core was completed in our Chromium implementation. But, there were even a few patches made to Chrome. Along the way we also contributed several minor spec edits to match reality and opened a few new spec issues we’d like to sort out. We added 251 new MathML related subtests to Web Platform Tests and greatly improved the interoperability around these basics.
While we made very considerable progress, there is still much to do, even just in good CSS support and interoperability. Two MathML related issues (CSS styling over MathML Core and Mathematics Rendering) were submitted to Interop 2025. We hope they can get the attention and priority of others, either directly from vendors or through financial support.
In 2025, Igalia will continue to look for funding and opportunities in order to make it increasingly possible to easily publish native Mathematics on the web. You can help us keep this work going, and close gaps more rapidly, but supporting our work directly via donation (one time or recurring).
What we did in 2024, specifically…
Chromium
- Uploaded [mathml] Remove
element - Landed CHECK failure with MathML + ::first-letter
- Reviewed Fix offset mapping from a DOM text to a rendered text with text-transform:math-auto
- Add non-regressions tests for bugs with stretchy fence
- mathml minsize/maxsize
- 5924353: Account for spacing around
mo
in WPT test width-height-001.html - 5941615 Update legacy-mrow-like-elements-001.html to expect display `block math’
WebKit
- Reviewed Sync and add ‘padding-inline’ UA stylehseet rules for mfrac in mathml.css
- Reviewed mfrac default padding-inline test case
- Reviewed Sync munder & mover (font-size: inherit) UA stylesheet rule as per MathML Spec
- Layout invalid markup as an mrow
- mfrac with out-of-flow numerator/denominator produces unexpected result
- Adopt more smart pointers in mathml
- Adopt more smart pointers in rendering/mathml
- Remove legacy MathML pixel test roots.xhtml
- MathML mroot: clamp RadicalKernBefore/AfterDegree
- Support padding/border/margin on RenderMathMLToken
- Support border/padding/margin on RenderMathMLOperator
- margin and preferred width calculation for MathML elements
- Remove legacy padding/margin rules from MathML UA stylesheet
- Support border/margin/padding on msub/msup/msubsup
- Support border/margin/padding on munderover/munder/mover
- Support border/padding/margin on RenderMathMLRow and subclasses
- Support border/margin/padding on mfrac and mspace elements
- Support CSS width/height properties on MathML elements #35031
- Sync mathml/ from WPT upstream #34921
- Sync mathml/relations/css-styling from WPT upstream #34828
- Use RenderBoxModelObject::borderAndPadding*() functions in various places #34351
- Refactor MathML padding/border handling #34159
- Remove always disabled DEBUG_MATH_LAYOUT define #34155
- Remove legacy MathML pixel test roots.xhtml #30895
- MathML mroot: clamp RadicalKernBefore/AfterDegree #30651
- Support padding/border/margin on RenderMathMLToken #30640
- Support border/padding/margin on RenderMathMLOperator #30635
- margin and preferred width calculation for MathML elements #30604
- Remove legacy padding/margin rules from MathML UA stylesheet #30599
- Support border/margin/padding on msub/msup/msubsup #30565
- Support border/margin/padding on munderover/munder/mover #30560
- Support border/padding/margin on RenderMathMLRow and subclasses #30517
- Support border/margin/padding on mfrac and mspace elements #30485
- Fix scriptlevel multipler (font-size) MathML #34974
- [Gardening] Amend test expectations for 2x imported/w3c/web-platform-tests/mathml/presentation-markup/operators/* WPT tests #34769
- Sync mathml/relations/html5-tree from WPT upstream MathML #34695
- Sync mathml/crashtests from WPT upstream MathML #34447
- REGRESSION (282319@main):[ wk1 and iOS] 3 tests in imported/w3c/web-platform-tests/mathml/presentation-markup are consistent failures. New Bugs #33049
- Make all elements in MathML namespace to be display: block and few other updates MathML #32243
- Import new mathml/presentation-markup WPT tests #31762
- Consistent handling of out-of-flow children in MathML layout functions MathML #31676
- Import new presentation-markup/mrow WPT tests MathML #30954
- Layout invalid markup as an
mrow
MathML #30705
Firefox
- Resolved as invalid default space around mo:
- Resolved as wontfix Export layout/reftests/radicalbar*.html to WPT
- Landed Update comment regarding radicalbar*.html reftests
- Landed Export more MathML reftests to WPT
- Landed Remove font-family: monospace from some mpadded reftests
- Landed Remove
random-if(gtkWidget)
for mo-glph-size.html - Resolve as fixed MathML maction statusline - status bar text doesn’t accurately reflect the target of the link
- Analyzed and reduced height of
munderover
- Landed Export some MathML mpadded reftests to WPT.
- Landed Export link-001.html as a tentative WPT.
- Landed Convert operator-1.xhtml to internal WPT test.
- Landed Export some dynamic reftests to WPT.
- Landed Convert mo@accent tests to internal WPT tests.
- Landed Export MathML dir-* tests to WPT.
- Landed Export mo-invisibleoperators-*.html reftests to WPT.
- Landed Export mspace-1.html reftests to WPT.
- Landed Export mfrac-* reftests to WPT.
- Analyzed stats for Remove support for the deprecated STIXGeneral set
- Analyzed width of empty
mo
- Export some MathML mpadded reftests to WPT.
- Export link-001.html as a tentative WPT.
- Convert operator-1.xhtml to internal WPT test.
- Export some dynamic reftests to WPT.
- Convert mo@accent tests to internal WPT tests.
- Export MathML dir– tests to WPT.
- Export mo-invisibleoperators–.html reftests to WPT.
- Export mspace-1.html reftests to WPT.
- Export mfrac– reftests to WPT.
- Remove layout.css.math-style.enabled and layout.css.math-depth.enabled prefs
- Convert subscript-italic-correction.html to internal testharness test.
- Convert scriptlevel-movablelimits-1.html reftest to internal WPT test.
- Export reftests for empty scripts to internal WPT tests.
- Export munderover-align-accent– tests to WPT.
- Remove unintentionally landed largeop-1 files.
- Move reftests for underbar/overbar stretching to internal WPT.
- Convert reftests for stretching by scaling to internal WPT tests.
- Convert reftest for stretchy equal sign to an internal WPT.
- Export stretchy-largeop– reftests as WPT testharness.js tests.
- Export a crashtest for bigotimes to WPT.
- Export mo-glyph-size.html to WPT.
- Export some mmultiscripts reftests to WPT.
- Export remaining internal semantics reftests to WPT.
- Export remaining internal mstyle reftests to WPT.
- Move remaining mpadded reftests to internal WPT tests.
- Convert MathML mirror-op tests to WPT
- Add warnings for MathML regarding new tests
- Export more MathML crashtests to WPT
- Export layout/reftests/radicalbar-.html to WPT
- Export test_math_tabindex_focus.html mochitest to WPT
- Remove dead code for MathML invalid markup
- Run infrastructure/reftest-zoom WPT tests with layout.css.zoom.enabled=true
- Landed: Bug 1890523 - Remove extra space above/below stretchy operators.
- Landed: Bug 1890531 - Remove automatic adjustment for “centered operators”
- Landed: Bug 1890958 - Remove android + fission OK/TIMEOUT annotations for MathML.
- Under review: Bug 1908069 - Introduce PlaceFlags parameter to MathML layout methods.
- Under review: Bug 1908069 - Add border/padding/margin support to mfrac
- Under review: Bug 1908069 - Extend and tweak MathML padding/border/margin tests.
- Under review: Bug 1908069 - Add border/padding/margin support to mrow-like elements.
- Under review: Bug 1908069 - Add border/padding/margin support to MathML token elements.
- Under review: Bug 1908069 - Add border/padding/margin support to scripted elements.
- Under review: Bug 1908069 - Add border/padding/margin support to msqrt, mroot and menclose.
- WIP: Bug 1890525: Align handling of minsize/maxsize with MathML Core.
- Bug 1912870 - Disable mathml.stixgeneral_operator_stretching by default (note: this is about operator stretching via the obsolete STIX General font).
- Bug 1890531 - Remove automatic adjustment for “centered operators”.
- Bug 1904220 - Fix MathML regression with HYPHEN-MINUS not rendered as MINUS SIGN.
- Bug 1907082 - Clamp radical kern degrees for mroot.
- Bug 1908069 - Add border/padding/margin support to msqrt, mroot and menclose.
- Bug 1908069 - Add border/padding/margin support to scripted elements.
- Bug 1908069 - Add border/padding/margin support to MathML token elements.
- Bug 1908069 - Add border/padding/margin support to mrow-like elements.
- Bug 1908069 - Add border/padding/margin support to mfrac.
- Bug 1908069 - Extend and tweak MathML padding/border/margin tests.
- Bug 1908069 - Introduce PlaceFlags parameter to MathML layout methods.
- Bug 1909417 - Position mprescripts at per MathML Core.
- Bug 1912435 - Make MathML boolean attributes ASCII case-insensitive.
- Bug 1916988 - Support CSS width/height properties on MathML elements.
- Bug 1916988 - Set vertical offset of mfrac denominator from the baseline.
- Bug 1917763 - Do not override MeasureForWidth/Reflow for mroot.
- Bug 1917763 - Do not override MeasureForWidth/Reflow for mspace.
- Bug 1917763 - Remove eCSSUnit_Number handling from nsMathMLFrame::ParseNumericValue.
- Bug 1917763 - Do not override MeasureForWidth/Reflow for mpadded.
- Bug 1917763 - Refactor parsing of mpadded attributes.
- Bug 1917763 - More consistent handling of MathML’s AttributeChanged().
- Bug 1917763 - Remove PlaceInternal methods from MathML layout classes.
- Bug 1918308 - Don’t always force a reflow in nsMathMLContainerFrame::AttributeChanged.
- Bug 1918308 - Add WPT test for dynamic change of the MathML href attribute.
- Bug 1918308 - Add dynamic tests for mtable@align/frame/width attributes.
- Bug 1918308 - Remove dead code for legacy MathML color/background attributes.
- Bug 1918310 - Remove class nsMathMLmsqrtFrame.
- Bug 1918310 - Make mroot and msqrt should share their implementation.
- Bug 1918989 - Remove disabled SHOW_BOUNDING_BOX MathML code.
Spec & tests
- Reported Make ::first-letter and ::first-line pseudo-elements not applied to elements with display: math
- Edited spec Make ::first-letter and ::first-line pseudo-elements not applied to elements with display: math
- Edited spec Rewrite section for SVG/HTML
- Opened Add tests for ::first-letter and ::first-line with MathML
- Reported Interpretation of spaceAfterScript for mmultiscripts’s prescripts
- Landed Add tests for Selection.toString() and text-transform
- Opened Idea: Consider introducing CSS math-leading-space / math-trailing-space properties
- Open MathML support in the HTML Sanitizer API
- Analyzed Incorrect test added for text-transform, but the test seems correct per the spec.
- Provided detail analysis of menclose
- Work on mo minsize/maxsize
- MathML-Core Friday May 24, 2024
- MathML-Core April 29, 2024
- MathML-Core March 25, 2024 Agenda
There have also been many other various changes by us and others to:
Misc
- Reviewed Update remaining web area to use latest rgb() and hsl() syntax
- Reviewed [ot-math-table] fix a bug in MathKern::get_value()
- Reviewed Feat add example to MathML mtd page using example given in w3c mathml core
- Format block MathML
- Format and clean up MathML
- Add three missing MathML elements
- fix: typo in MathML/mfenced
- Spelling/grammar fixes