Art of browser sniffing at W3C
Wednesday, February 15, 2006 9:17:15 AM
if(MicroSoft) {run-around-pool('110m')}
else {swim('100m')}
Browser sniffers can hardly surprise Opera user. But the kind of browser sniffing that I encountered today is something new. It is interesting because web page is not usual web site, it is test suite maintatined by W3C and intended to test user agent conformance 'to help insure uniformity and interoperability between MathML implementations'.
Each test page from test suite is shipped with XSLT style sheet that determines whether user uses MSIE and if so transforms tests to make them compatible with that browser (proprietary JScript/ActriveX are used).
Style sheet causes XSLT processing errors in Opera so to test UserJS that renders MathML in Opera I had to save it locally and delete XSLT sniffer.
Quoted from http://www.w3.org/Math/testsuite/style/pmathml.xsl
<xsl:param name="activex">
<xsl:choose>
<xsl:when test="$docpref='techexplorer-plugin'">techexplorer-plugin</xsl:when>
<xsl:when test="system-property('xsl:vendor')!='Microsoft'"/>
<xsl:when test="$docpref='mathplayer-dl'">mathplayer-dl</xsl:when>
<xsl:when test="$docpref and fns:isinstalled(string($docpref/@o))='true'">
<xsl:copy-of select="$docpref/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="(document('')/*/fns:x[fns:isinstalled(string(@o))='true'])[1]/node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>


rminer # Thursday, February 16, 2006 3:42:47 PM
Of course, the sniffing that is there is badly outdated now. Firefox/Mozilla, Opera with UserJS, and Internet Explorer with MathPlayer will now all render a completely standard XHTML + MathML document served with MIME type application/xhtml+xml. Clearly the test suite should be updated to reflect this. I'll try to find resources to make this happen, since your work on UserJS is valuable, and should not be placed at an artificial disadvantage by old, outdated workarounds.
Robert Miner
Design Science, Inc.
W3C Math Interest Group co-chair
George ChavchanidzeWhite Lynx # Friday, February 17, 2006 9:31:16 AM
Browser sniffing is not the only issue, we often encounter bootstrap approach in namespace declarations
with entity being defined in external DTD or undefined at all (sometimes causes well formedness error), often content is served as text/html (sometimes content negotiation is combined with browser sniffing). All this causes artificial compatibility issues that could be avoided in relatively young and small MathML community.
Regarding UserJS for Opera it could be good toy to play with, but in overall I would not consider it seriously. One can provide basic functionality via UserJS, but it is unlikely to achieve full compatibility with existing MathML content.