RESOLVED FIXED Bug 48105
mathml in html sometimes incorrectly parsed
https://bugs.webkit.org/show_bug.cgi?id=48105
Summary mathml in html sometimes incorrectly parsed
Sean Hogan
Reported 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.
Attachments
html5 test file with badly parsed mathml (2.39 KB, text/html)
2010-11-01 16:57 PDT, David Carlisle
no flags
file showing problem descibed in comment #2 (342 bytes, text/html)
2010-11-02 13:23 PDT, David Carlisle
no flags
Patch (2.72 KB, patch)
2010-11-02 14:03 PDT, James Simonsen
no flags
David Carlisle
Comment 1 2010-11-01 16:57:37 PDT
Created attachment 72600 [details] html5 test file with badly parsed mathml
David Carlisle
Comment 2 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 <math> <mrow> <mrow><mn>1</mn></mrow> <mi>a</mi> </mrow> </math> but the innerHTML of that div, as inserted into the second, is <math> <mrow> <mrow><mn>1</mn></mrow></mrow> <mi>a</mi> </math> and the <mi>a</mi> has moved out of its correct location in the tree.
Eric Seidel (no email)
Comment 3 2010-11-02 12:20:03 PDT
I don't see a single <mrow> 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
Comment 4 2010-11-02 13:17:44 PDT
(In reply to comment #3) > I don't see a single <mrow> 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
Comment 5 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
Comment 6 2010-11-02 14:03:44 PDT
Adam Barth
Comment 7 2010-11-02 14:35:17 PDT
Comment on attachment 72732 [details] Patch Thanks.
David Carlisle
Comment 8 2010-11-02 14:58:46 PDT
(In reply to comment #7) > (From update of attachment 72732 [details]) > Thanks. thanks
WebKit Commit Bot
Comment 9 2010-11-02 20:57:05 PDT
Comment on attachment 72732 [details] Patch Clearing flags on attachment: 72732 Committed r71209: <http://trac.webkit.org/changeset/71209>
WebKit Commit Bot
Comment 10 2010-11-02 20:57:11 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.