SVG 1.2 - RCC

Hello again,

Reading Erik Arvidsson's post regarding XBL reminded me of another wish list item I have for RCC.  Just for clarity, I'm coming from an ECMAScritp perspective.  It would be useful to be able to associate an object with a custom element.  Even better would be the ability to extend an existing SVG DOM interface.

Currently, I associate a single object with each custom element (or widget) to collect all event handlers and associated functionality for that element into one place.  The object has a reference to the element and shadow tree so it knows what elements it is supposed to manage.  However, if I access my custom element via a DOM method, getElementById for example, then I do not know which object is associated with that element.  To solve this, I apply a unique id to the element and then use that id in a global hash that associates id's with elements.  This solves the problem, but you end up with two objects that you have to use when manipaluting your custom element; the one returned by the DOM call and the one created to manage the element.

It would be nice to be able to declaratively extend objects returned by the DOM (XBL shows a possible method).  That way when I call getElementById (or whatever), I get my object which would really appear to be an extension of SVGCustomElement.  I avoid the id hack and I have one object for the SVG DOM stuff and for my functionality for the custom element.

This is certainly not a critical feature and may be a bit challenging to implement, but hey, I figure it's better to suggest it than not.

Kevin
KevLinDev - http://www.kevlindev.com

Received on Sunday, 20 July 2003 14:24:20 UTC