[Webkit-unassigned] [Bug 280682] New: Support standalone MathML files in MML format
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Oct 1 08:38:15 PDT 2024
https://bugs.webkit.org/show_bug.cgi?id=280682
Bug ID: 280682
Summary: Support standalone MathML files in MML format
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: MathML
Assignee: webkit-unassigned at lists.webkit.org
Reporter: hi at pepelsbey.dev
Created attachment 472751
--> https://bugs.webkit.org/attachment.cgi?id=472751&action=review
Standalone MathML file
There’s a .mml file extension [mentioned in the MathML 4.0 spec](https://w3c.github.io/mathml/#encoding-names) for standalone MathML files, just like .svg for SVG. And just like SVG, it’s an XML-based format that requires the `xmlns` attribute with a certain value to work and doesn’t need the `xmlns` when inlined in HTML.
```xml
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mi>y</mi>
</mrow>
</math>
```
```xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
<rect width="20" height="20" fill="green" />
</svg>
```
Today, all browsers support rendering MathML inlined into HTML, but currently, only Firefox supports rendering MML files.
```html
<p>
<math>
<mrow>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>+</mo>
<mi>y</mi>
</mrow>
</math>
</p>
```
```html
<p>
<svg width="20" height="20" viewBox="0 0 20 20">
<rect width="20" height="20" fill="green" />
</svg>
</p>
```
The MML rendering in Firefox looks very similar to SVG: it takes the whole page, there’s XML in the view source and DOM in the DevTools, and it shows parsing error when the MML file is not well-formed. MML files also work when loaded in an iframe, but doesn’t work in `<img>`.
Both Safari and Chrome show MML as plain text. See the attached MML file example.
It’s not common to share MathML as standalone files. Still, it might be convenient/useful to store formulas in external files to reuse them in multiple content locations (inlined during build time, for example), just like SVG.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241001/8ed87e69/attachment.htm>
More information about the webkit-unassigned
mailing list