Intent to ship: Render unknown MathML elements as an mrow

234 views
Skip to first unread message

Eri Pazos Pérez

unread,
Jul 1, 2025, 9:18:59 AMJul 1
to dev-pl...@mozilla.org

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>&#x2202;</mo>
      <mi>L</mi>
    </a>
    <a href="https://en.wikipedia.org/wiki/Generalized_coordinates">
      <mo>&#x2202;</mo>
      <mover>
        <msub>
          <mi>q</mi>
          <mi>k</mi>
        </msub>
        <mo >&#x02D9;</mo>
      </mover>
    </a>
  </mfrac>
</math>

Before:

Equality where the left hand side is laid out in a row

After:

Equality where the left hand side correctly displays a fraction

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:

  • Added new test cases for 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
  • There are legacy elements from the MathML3 spec that are not treated as unknown for backwards compatibility, including mlabeledtr and menclose. The latter already has tests, but a new internal one was added for mlabeledtr:
    • mathml/tables/mtable-mlabeledtr-ref.html
Reply all
Reply to author
Forward
0 new messages