Bug 123348

Summary: [MathML] Display <merror> state when markup is invalid
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: MathMLAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: alex, fred.wang, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 153991    
Bug Blocks:    
Description Flags
testcase none

Description Brent Fulgham 2013-10-25 11:04:59 PDT
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."
Comment 1 Martin Robinson 2013-10-25 13:55:49 PDT
I looked at the torture tests in WebKitGTK+ and they seem fine.
Comment 2 Brent Fulgham 2013-10-25 16:32:06 PDT
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."
Comment 3 Frédéric Wang (:fredw) 2013-10-27 05:25:03 PDT
Created attachment 215269 [details]
Comment 4 Brent Fulgham 2013-10-28 09:34:34 PDT
(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. :-)
Comment 5 Frédéric Wang (:fredw) 2016-03-14 03:58:56 PDT
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...)