1.81 KB,
text/html

Details  
18.42 KB,
image/png

Details  
24.74 KB,
patch

Details  Diff  Splinter Review 
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 going anywhere in terms of display content as opposed to data (witness the WHATWG effort). 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 emailed 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/whatwgwhatwg.org/2006June/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 have finally been able to code this up (with Hixie's caveat about keeping MathML elemens in the MathML namespace). I will attach the patch I have so far.
Created attachment 239769 [details]
testcase
Created attachment 239770 [details] [diff] [review] patch  v1 Summary: How does MathMLinHTML5 work? We support MathMLinHTML5 when these two conditions are met: 1. The DOCTYPE of the document says so. If yes, we load MathML entities (TODO) and flag mMayHaveMathML in the 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 nonHTML elements inside the <math> tag and create MathML content nodes for them. Issues: 1. Tag soup: we understand that we are exposing ourseleves 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 the MathML namespace. We might have to special case MathMLinHTML5 in the Style System as well. b) The second option raises an issue with HTMLinMathML, 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 HTMLinMathML 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.
Created attachment 239771 [details] screenshot  MathMLinHTML  rendering of the testcase
Comment 4•11 years ago


As noted on the newsgroups, I don't think we should do this by having namespace syntax. I think we should just automatically assume that if the HTML parser parses any of the following elements: math, mrow, mfrac, msqrt, mroot, mstyle, merror, mpadded, mphantom, mfenced, menclose, msub, msup, msubsup, munder, mover, munderover, mmultiscripts, mtable, mlabeledtr, mtr, mtd, maction ...that they get put into the DOM with the MathML namespace. (Note that this would be done while not changing the parser  these elements don't get any special processing other than changing the namespace. i.e. they are parsed just like <xyzzy>.)
Created attachment 242359 [details] [diff] [review] patch  v1b (same as v1, but sync'ed with bug 355451) I had to update to pick the changes in bug 355451 that conflicted with the earlier patch. Since the prefix approach (included in the current patch) is not going to be retained, I am just dropping this update here for the record.
Comment 6•8 years ago


I believe this is fixed by bug 487949.
Updated•8 years ago

Updated•7 years ago

Updated•7 years ago

Updated•7 years ago

Description
•