Bug 48105 - mathml in html sometimes incorrectly parsed
mathml in html sometimes incorrectly parsed
 Status: RESOLVED FIXED None WebKit Unclassified DOM (show other bugs) 528+ (Nightly build) All All P2 Normal Nobody HTML5

 Reported: 2010-10-21 18:30 PDT by Sean Hogan 2010-11-02 20:57 PDT (History) 6 users (show) abarth commit-queue davidc eric shogun70 simonjam

Attachments
html5 test file with badly parsed mathml (2.39 KB, text/html)
2010-11-01 16:57 PDT, David Carlisle
no flags Details
file showing problem descibed in comment #2 (342 bytes, text/html)
2010-11-02 13:23 PDT, David Carlisle
no flags Details
Patch (2.72 KB, patch)
2010-11-02 14:03 PDT, James Simonsen
no flags Details | Formatted Diff | Diff

 Note You need to log in before you can comment on or make changes to this bug.
 Sean Hogan 2010-10-21 18:30:11 PDT 1. visit https://eyeasme.com/Joe/MathML/HTML5_MathML_browser_test.html - there are several rendering errors 2. Look at Webkit's rendering of the Quadratic Formula - the denominator of the fraction is inline with the equation. 3. right-click on Webkit's rendering and then Inspect Element 4. the DOM for the Quadratic Formula (the output of Webkit's mathml parser) doesn't match the markup in the page (though it does seem to match what gets rendered). I've observed this in Webkit nightlies and the latest Chrome release (Vista and OS-X). This effects MathJax which can over-ride the mathml rendering, but relies on the parser being correct. David Carlisle 2010-11-01 16:57:37 PDT Created attachment 72600 [details] html5 test file with badly parsed mathml David Carlisle 2010-11-01 16:58:35 PDT I also see this in webkit nightlies (affecting native mathml rendering) and chrome 7 affecting generated DOM, thus further processing. I attach a smaller test case, nested mrows apparently being the main culprit. The first div in the attached file has $1 a$ but the innerHTML of that div, as inserted into the second, is $1 a$ and the a has moved out of its correct location in the tree. Eric Seidel (no email) 2010-11-02 12:20:03 PDT I don't see a single in the attached example. Can you be more clear as to what is wrong with the DOM in webkit in the attached example? David Carlisle 2010-11-02 13:17:44 PDT (In reply to comment #3) > I don't see a single in the attached example. Can you be more clear as to what is wrong with the DOM in webkit in the attached example? ??? the full mathml expression (and the incorrect parse tree produced) is shown in comment #2. the attached example just wraps that in a complete html5 document for ease of testing. there are two mrows one inside the other but the parser apparently terminates both mrows when the inner one ends, this is not related to the mrow element, it appears that you get the same effect with any nested elements in foreign content (ie within math or svg) David David Carlisle 2010-11-02 13:23:00 PDT Created attachment 72726 [details] file showing problem descibed in comment #2 sorry! wrong file attached previously this s file intended in comment #2 and #4 James Simonsen 2010-11-02 14:03:44 PDT Created attachment 72732 [details] Patch Adam Barth 2010-11-02 14:35:17 PDT Comment on attachment 72732 [details] Patch Thanks. David Carlisle 2010-11-02 14:58:46 PDT (In reply to comment #7) > (From update of attachment 72732 [details]) > Thanks. thanks WebKit Commit Bot 2010-11-02 20:57:05 PDT Comment on attachment 72732 [details] Patch Clearing flags on attachment: 72732 Committed r71209:  WebKit Commit Bot 2010-11-02 20:57:11 PDT All reviewed patches have been landed. Closing bug.