We intend to turn “Render unknown MathML elements as an mrow” on by default. A combined intent to prototype and ship follows.
Summary:
The MathML Core specification indicates that “Unknown
MathML elements behave the same as the mrow element”.
This means any element not explicitly defined within the
specification should be rendered as an mrow
.
Example:
In general, the use case is to allow web developers to write
polyfills for MathML3 (e.g. <mfenced>
)
or for future elements (e.g. <a>
).
In
this example there are clickable links within mathematical
expressions. With this change, the <a>
elements act as an mrow
since they are unknown to the MathML Core specification,
ensuring the fraction displays correctly.
<math display="block">
<a href="https://en.wikipedia.org/wiki/Momentum">
<msub>
<mi>p</mi>
<mi>k</mi>
</msub>
</a>
<mo>=</mo>
<mfrac>
<a href="https://en.wikipedia.org/wiki/Lagrangian_mechanics">
<mo>∂</mo>
<mi>L</mi>
</a>
<a href="https://en.wikipedia.org/wiki/Generalized_coordinates">
<mo>∂</mo>
<mover>
<msub>
<mi>q</mi>
<mi>k</mi>
</msub>
<mo >˙</mo>
</mover>
</a>
</mfrac>
</math>
Before:
After:
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1958853.
Specification: MathML Core, https://w3c.github.io/mathml-core/#ref-for-dfn-unknown-mathml-element-2.
Standards Body: W3C, relevant discussion at https://github.com/w3c/mathml-core/issues/71.
Platform coverage: All platforms.
Preference:
mathml.unknown-mrow
.
Other browsers:
web-platform-tests:
mfenced
and a
in:
mathml/presentation-markup/mrow/dynamic-mrow-like-001.html
mathml/presentation-markup/mrow/inferred-mrow-baseline.html
mathml/presentation-markup/mrow/inferred-mrow-stretchy.html
mathml/presentation-markup/mrow/mrow-preferred-width.html
mathml/presentation-markup/mrow/spacing.html
mathml/presentation-markup/operators/embellished-operator-001.html
mlabeledtr
and menclose
.
The latter already has tests, but a new internal one was added
for mlabeledtr
:
mathml/tables/mtable-mlabeledtr-ref.html