Re: request for comments HTML WG comments to MathML WG

On 11/5/09 4:29 AM, Simon Pieters wrote:
> "To fully integrate MathML into XHTML, it should be possible not only to
> embed MathML in XHTML, as described in Section 6.2.1 Recognizing MathML
> in XML, but also to embed XHTML in MathML. However, the problem of
> supporting XHTML in MathML presents many difficulties. Therefore, at
> present, the MathML specification does not allow XHTML elements within a
> MathML expression, although this situation may be subject to change in a
> future revision of MathML."
>
> What are the difficulties?

A pretty basic one offhand is that MathML uses its own layout model 
(just like SVG does).  So the complete interaction of the CSS layout 
model with the MathML one needs to be defined.  When putting a MathML 
chunk inside HTML, this is easy: it's a replaced element from the CSS 
point of view, effectively (just like SVG).  The other direction is 
handled in SVG by foreignObject which on the outside looks like SVG to 
the SVG renderer and on the inside looks like a CSS block to the CSS 
renderer (or at least so it's implemented in Gecko).  But MathML has no 
such provision; the interaction is completely undefined.  Defining it is 
not that easy (e.g. in Gecko we tried and gave up for the time being; we 
just disable significant chunks of the CSS layout model in subtrees 
rooted at mathml elements).

> The HTML5 parser supports HTML and SVG in <mi>, <mo>, <mn>, <ms>,
> <mtext> and SVG in <annotation-xml>. XHTML and SVG in MathML in these
> places works fine in Firefox and Opera today when using
> application/xhtml+xml.

XHTML doesn't actually work all that fine.  Try floating or positioning 
HTML content that's a descendant of <math:mi> in Gecko, for example.

-Boris

Received on Thursday, 5 November 2009 16:54:09 UTC