W3C home > Mailing lists > Public > www-svg@w3.org > July 2003

SVG 1.2 - RCC

From: Kevin Lindsey <kevin@kevlindev.com>
Date: Sun, 20 Jul 2003 13:24:34 -0500
Message-ID: <002f01c34eec$2bbeaa70$6401a8c0@monkey>
To: <www-svg@w3.org>
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.

KevLinDev - http://www.kevlindev.com
Received on Sunday, 20 July 2003 14:24:20 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:56 UTC