W3C home > Mailing lists > Public > public-svg-wg@w3.org > April to June 2009

ISSUE-2261 (using-wrong-type-err): SVGXXXList interfaces perhaps should not throw SVGException(SVG_WRONG_TYPE_ERR) [SVG Full 1.1]

From: SVG Working Group Issue Tracker <sysbot+tracker@w3.org>
Date: Mon, 13 Apr 2009 13:14:10 +0000 (GMT)
To: public-svg-wg@w3.org
Message-Id: <20090413131410.EF9F7C6DB0@barney.w3.org>

ISSUE-2261 (using-wrong-type-err): SVGXXXList interfaces perhaps should not throw SVGException(SVG_WRONG_TYPE_ERR) [SVG Full 1.1]

http://www.w3.org/Graphics/SVG/WG/track/issues/2261

Raised by: Cameron McCormack
On product: SVG Full 1.1

The various SVGXXXList interfaces in SVG 1.1 say that an SVGException with code SVG_WRONG_TYPE_ERR is to be thrown if an item of an inappropriate type is passed into the methods.  This won't be possible in strongly typed languages (since the code wouldn't compile, or the language runtime would catch it).  In ECMAScript it would be customary to throw a TypeError in this situation.

Passing objects of inappropriate types is a general problem, and exceptions aren't declared on all methods to handle this case.  For example, you could try to pass an SVGLength object to Node::appendChild(), but Node::appendChild() doesn't say that a particular exception should be thrown in this case.

Recent Firefoxes and Operas do throw an exception with those SVGXXXList methods, but not an SVGException.  (Opera has an InternalException, and Firefox throws some XPCOM-specific excpetion.)  WebKit erroneously allows the method to succeed.

I think we should consider dropping the SVGException from these methods.
Received on Monday, 13 April 2009 13:14:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 13 April 2009 13:14:20 GMT