Currently, certain invalid MathML documents (such as a MathML document containing arbitrary HTML markup) is rendered improperly. According to the MathML specification, we should be providing better error information.
From http://www.w3.org/TR/MathML3/chapter6.html), Section 6.4 Combining MathML and Other Formats:
"In the standard schema, elements from other namespaces are not allowed, but attributes from other namespaces are permitted. MathML processors that encounter unknown XML markup should behave as follows:
An attribute from a non-MathML namespace should be silently ignored.
An element from a non-MathML namespace should be treated as an error, except in an annotation-xml element. If the element is a child of a presentation element, it should be handled as described in Section 3.3.5 Error Message <merror>. If the element is a child of a content element, it should be handled as described in Section 4.2.9 Error Markup <cerror>.
For example, if the second child of an mfrac element is an unknown element, the fraction should be rendered with a denominator that indicates the error."
I looked at the torture tests in WebKitGTK+ and they seem fine.
See also http://www.whatwg.org/specs/web-apps/current-work/multipage/the-map-element.html#mathml:
"User agents must act as if any MathML element whose contents does not match the element's content model was replaced, for the purposes of MathML layout and rendering, by an merror element in the MathML namespace containing some appropriate error message."
Created attachment 215269 [details]
(In reply to comment #1)
> I looked at the torture tests in WebKitGTK+ and they seem fine.
I think this comment was intended for Bug 121728. :-)
At the moment, the choice in the in-progress MathML refactoring is just to not display anything for invalid markup. However, we may do something as in Gecko and the refactoring will make that much easier. So I'm making this depends on bug 153991.
(That said, I suspect we want to spend more time on supporting valid markup than on deciding a fallback rendering for invalid markup...)