ISSUE-2261: SVGXXXList interfaces perhaps should not throw SVGException(SVG_WRONG_TYPE_ERR)

using-wrong-type-err

SVGXXXList interfaces perhaps should not throw SVGException(SVG_WRONG_TYPE_ERR)

State:
CLOSED
Product:
SVG Full 1.1
Raised by:
Cameron McCormack
Opened on:
2009-04-13
Description:
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.
Related Actions Items:
Related emails:
  1. SVG/profiles/1.1F2/master changes.html,1.22,1.23 svg.idl,1.42,1.43 (from cvsmail@w3.org on 2009-06-02)
  2. SVG/profiles/1.1F2/publish access.html,1.32,1.33 animate.html,1.38,1.39 attindex.html,1.29,1.30 backward.html,1.32,1.33 changes.html,1.26,1.27 color.html,1.36,1.37 concepts.html,1.40,1.41 conform.html,1.34,1.35 coords.html,1.42,1.43 eltindex.html,1.29,1.3 (from cvsmail@w3.org on 2009-06-02)
  3. Minutes, April 29 2009 telcon (from cam@mcc.id.au on 2009-04-29)
  4. Agenda, April 29 2009 telcon (from ed@opera.com on 2009-04-28)
  5. Re: Agenda, Monday 27 April 2009 SVG WG telcon (from schepers@w3.org on 2009-04-26)
  6. Agenda, Monday 27 April 2009 SVG WG telcon (from cam@mcc.id.au on 2009-04-26)
  7. Agenda, Monday 20 April 2009 SVG WG telcon (from cam@mcc.id.au on 2009-04-19)
  8. ISSUE-2261 (using-wrong-type-err): SVGXXXList interfaces perhaps should not throw SVGException(SVG_WRONG_TYPE_ERR) [SVG Full 1.1] (from sysbot+tracker@w3.org on 2009-04-13)

Related notes:

No additional notes.

Display change log ATOM feed


Dirk Schulze <dschulze@adobe.com>, Chair, Chris Lilley <chris@w3.org>, Staff Contact
Tracker: documentation, (configuration for this group), originally developed by Dean Jackson, is developed and maintained by the Systems Team <w3t-sys@w3.org>.
$Id: index.php,v 1.326 2018/10/13 17:29:51 vivien Exp $