NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 917 - <svg><font/></svg> causes NullPointerException
<svg><font/></svg> causes NullPointerException
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Michael[tm] Smith
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-09 07:30 CEST by Michael[tm] Smith
Modified: 2012-04-13 10:38 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael[tm] Smith 2012-04-09 07:30:38 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>
Comment 1 Michael[tm] Smith 2012-04-09 08:21:27 CEST
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
Comment 3 Henri Sivonen 2012-04-12 09:47:25 CEST
How can a schema change fix an NPE? Doesn't that suggest a bug in Jing?
Comment 4 Michael[tm] Smith 2012-04-12 16:28:11 CEST
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).
Comment 5 Michael[tm] Smith 2012-04-13 10:09:06 CEST
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
Comment 6 Henri Sivonen 2012-04-13 10:38:30 CEST
Thank you.