Bugzilla – Bug 917
<svg><font/></svg> causes NullPointerException
Last modified: 2012-04-13 10:38:30 CEST
The following test has an instance of <svg><font/></svg> that causes a NullPointerException to be thrown from a java.lang.String.compareTo call http://w3c-test.org/html/tests/submission/Ms2ger/apis-in-html-documents/Document.getElementsByTagName-foreign-02.html Can be minimally reproduced just with <!DOCTYPE html> <title></title> <svg><font/></svg>
Fix for this appears to be: diff -r 9d445b55306e schema/svg11/svg-font.rnc --- a/schema/svg11/svg-font.rnc Fri Apr 06 06:47:15 2012 +0900 +++ b/schema/svg11/svg-font.rnc Mon Apr 09 14:22:31 2012 +0900 @@ -24,13 +24,14 @@ ## [ xml:lang = "en" ] grammar { - include "svg-basic-font.rnc" + include "svg-basic-font.rnc" { + SVG.font-face.extra.class &= definition-src? + } a:documentation [ "\x{a}" ~ " font-face: Font Face Element\x{a}" ~ " " ] - SVG.font-face.extra.class &= definition-src? a:documentation [ "\x{a}" ~ " glyph: Glyph Element\x{a}" ~ " " ] SVG.glyph.class |= SVG.Animation.class
https://bitbucket.org/validator/validator/changeset/d6e8991f4c34
How can a schema change fix an NPE? Doesn't that suggest a bug in Jing?
Yeah, it does seem to be a bug in jing, but I'm not sure what kind of bug -- whether the bug is that the schema is actually not valid but jing is parsing it incorrectly (failing to catch the error) or whether the schema is valid but Jing is running into a bug when it hits this particular markup instance. I guess I will test with rnv and see what it does (whether it finds the schema valid or finds any problem when actually validating the document).
I filed a jing bug http://code.google.com/p/jing-trang/issues/detail?id=156 and I also posted a message to the rng-users list: http://tech.groups.yahoo.com/group/rng-users/message/1444
Thank you.