I am currently driving an effort to enable MathML-in-HTML (apart from MathML-in-XHTML that we already support). I have a patch that serves the dual purpose of showing where things are going and the issues to ponder about.

Here is a
[screenshot] https://bugzilla.mozilla.org/attachment.cgi?id=239771
which is a _live_ rendering of this testcase:
[mathml-in-html] https://bugzilla.mozilla.org/attachment.cgi?id=239769

Those interested in following this up can see bug 353926:
https://bugzilla.mozilla.org/show_bug.cgi?id=353926

Quick background:
=================

At the Firefox engineering meeting in Mountain Views (last December 2005), I pleaded that we enable MathML in HTML5 to advance the cause of MathML, which is so far locked in a XHTML/XML world that does not seem to be going anywhere in terms of display content as opposed to data (witness the WHATWG effort -- http://www.whatwg.org). Those to whom I spoke included dbaron, hixie and sicking, and they welcomed the suggestion, asking for a broader discussion. Hixie raised the caveat that MathML elements should still remain in the MathML namespace. He e-mailed me a while ago about a discussion on this matter in the WHATWG mailing list, which can be seen here
http://listserver.dreamhost.com/pipermail/whatwg-whatwg.org/2006-June/thread.html.

That discussion is however too broad and involves tangential issues such as
inventing another syntax, etc. My original take was simply to enable
MathML+HTML, in the same vein as we have MathML+XHTML. I think MathML is suffering from having to fight the battle for adoption of XHTML as well. As a niche technology, it does not have the means to be engaging a fight. What it simply needs is MathML-in-HTML. W3C failed to recognise that it could retrofit MathML in HTML -- see this archived post for some insight:
http://groups.google.com/group/netscape.public.mozilla.mathml/msg/4d58c35217afcb54?dmode=source
But HTML5 being shepherded by WHATWG could provide the right framework from this to happen now.

I have finally been able to code this up (while keeping MathML elements in the MathML namespace). I attached the patch I had so far in bug 353926.

Design & Technical issues:
==========================

How does MathML-in-HTML5 work?

We support MathML-in-HTML5 when these two conditions are met:

 1. The DOCTYPE of the document says so. If yes, we enable
    MathML entities (TODO) and flag mMayHaveMathML in the HTML content sink.

 2. And either a) OR b) is met:

    a) <html> has the MathML namespace as the value of an attribute with a
       prefix, e.g., <html xmlns:m="http://www.w3.org/1998/Math/MathML";>.

       In this case, we cache the prefix "m" in mMathMLNameSpacePrefix,
       and we intercept all <m:tag> in the document and create
       MathML content nodes for them.

    b) MathML fragments are in the document as
       <math xmlns="http://www.w3.org/1998/Math/MathML";>
         ...
       </math>

       In this case, we intercept all non-HTML elements inside the <math> tag
       and create MathML content nodes for them.

Issues:
 1. Tag soup: we understand that we are exposing ourselves to this.

 2. a) What about CSS matching rules? From the Style System point of view,
       the document is still HTML, but <m:math> is in the MathML namespace. We
       might have to special case MathML-in-HTML5 in the Style System as well.

    b) The second option raises an issue with HTML-in-MathML, e.g.,
       <math xmlns="http://www.w3.org/1998/Math/MathML";>
         <b>bold</b>
       </math>
       We don't intercept the <b> in this case. Hence, even though it is
HTML-in-MathML without an explicit XHTML namespace for <b>, the HTML sink
       will give <b> a HTML content node. This is not really XHTML friendly.
       On the other hand, we don't want to be an XML parser either... These
       are conflicting objectives. We need to decide what to do. We may agree
       to only support tags with prefixes as in a), or also keep b) knowing
       that it has this XHTML unfriendly behavior.
---
RBS

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to