Summary: | WebKit does not render namespaced MathML | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | James Craig <jcraig> | ||||||
Component: | MathML | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED INVALID | ||||||||
Severity: | Normal | CC: | ap, fred.wang, jcraig, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
James Craig
2014-01-30 12:05:26 PST
Created attachment 222706 [details]
test case
Created attachment 222711 [details]
screen shot
In the meantime, Pearson could work around this pretty easily by converting their tagnames to ditch the namespaces. Another workaround would be to serve an XML MIME type. I don't think that this test case is valid - one must use namespaces in XML, but must not use them in HTML. (In reply to comment #6) > Another workaround would be to serve an XML MIME type. That works, but seems like an overly academic distinction. WebKit clearly knows that this is MathML and how to render this. We should just render it. Throw an error in the console or in a validator, but don't prevent the content from rendering. > I don't think that this test case is valid - one must use namespaces in XML, but must not use them in HTML. Possibly not, but that's a new distinction in HTML5. I can change the DOCTYPE of the test case to XHTML and make it valid. Most of the Web is invalid tag soup and WebKit renders that fine. Namespaced MathML in HTML is a pretty clear case where we can improve the output even if the input isn't exactly what was anticipated. (In reply to comment #7) > I can change the DOCTYPE of the test case to XHTML and make it valid. Before someone calls me on this claim, it would take a few more changes to make *this* particular example valid XHTML, but I believe my general point stands. WebKit knows that this is MathML and how to render this, so it should just render it. Throw an error in the console or in a validator, but don't prevent the content from rendering. > Possibly not, but that's a new distinction in HTML5. This is not accurate, HTML5 codified existing behavior that all browsers had. There are some minor aspects that were new in HTML5, but certainly not anything that drastic. > WebKit knows that this is MathML and how to render this, so it should just render it. Throw an error in the console or in a validator, but don't prevent the content from rendering. This is not an argument that is likely to convince many people at this point. Browser engines were thinking like this for many years, and the amount of pain that caused is exactly why we need well defined parsing and error handling. Adding knowledge of XML namespace syntax to HTML parser is certain to cause extreme pain, such as compatibility and security bugs unique to WebKit, and inability to implement future standard features. Thinking about this more, this is not something we should even keep open as a bug. Please raise this as an issue with HTML5 if you'd like this changed. For what it's worth, I'm not suggesting we adopt all XML parsing rules in HTML. I'm just stating that certain XML languages (MathML and SVG in particular) are valid natively inside HTML, so it seems like an easy win to allow them to render in either their XML or HTML form. I have too many issues with HTML5 to fight this one though, so I'll drop it. FYI, the testcase does not work in Gecko either. The reference of the MathML2 you give is for XML documents. I agree with Alexey that the point of HTML5 is to define clear behaviors and the spec says that in the HTML syntax, prefixes and namespace declarations do *not* have the same effect as in XML: http://www.w3.org/TR/html5/infrastructure.html#mathml-namespace. I don't think the authors are likely to change that, since one of the reason for integrating MathML/SVG in HTML5 was to eliminate the XML syntax... |