### MathML in Safari

So Dave Hyatt wants to hear where we’d like Safari to go.

I’d like to see MathML support come to Safari (WebCore, really). I realize that ain’t exactly mass-market, but then neither is the demographic of Safari’s early-adopters. And MathML in WebCore would open up a bunch of nifty possibilities for other applications (Keynote, spreadsheets, …) which would like to render mathematical formulas.

Anyway, how does one get from here to there?

- An XML parser (supposedly working in WebCore now).
- Really good CSS-handling (from Dave’s posts, it sounds like WebCore has pretty much arrived).
- A converter to translate the MathML box model to CSS frames.

That’s the approach the Mozilla MathML Project took for their implementation:

A mathematical expression can be represented as an aggregate set of boxes. These are the bounding boxes that would enclose mathematical entities (literal symbol, operator, delimiter, etc). With rules governing the positioning of these entities (subscript, superscript, fraction, etc), it is possible to construct the box-model in a recursive manner by traversing the parsing tree of the expression.

With the object-oriented paradigm, each box can be viewed as an object that has its own specific properties and shares a common set of properties with other objects. With the CSS paradigm, each box can be viewed as a CSS frame that possibly embeds other CSS frames. Hence there is a direct correspondence between the two paradigms.

MathML offers two formats for representing an equation: presentational tags and semantic/content tags. Given an equation in either format, the MathML project will ultimately aim at constructing a lump of CSS frames that can then be passed onto Gecko for layout and display.

[Currently, they support only MathML Presentational Tags.]

Substitute “KHTML” for “Gecko” above, and one has the semblance of a plan.

Posted by distler at February 7, 2003 10:54 PM
## Re: MathML in Safari

GtkMathView provides a highly adaptable, high quality rendering engine for MathML markup. It can be interfaced with different frontends (= ways of retrieving the markup) and different backends (= ways of displaying the markup). The Gtk in the name is just because of historical reasons, in fact the latest version can be compiled without Gtk and the main engine is pure C++ code.

I’ve been wondering for a while what would be the right approach to seek collaboration for integrating gtkmathview and safari somehow, but the world of apple developers is totally unknown to me. So, if you have any feeling that an integration is at all possible, I’d be more than glad to hear about it.

More information about gtkmathview here:

http://helm.cs.unibo.it/software/mml-widget/