W3C home > Mailing lists > Public > www-svg@w3.org > October 2005

Re: SVG12: DOMObject portability

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Tue, 25 Oct 2005 09:50:11 -0500
Message-ID: <435E4623.101@mit.edu>
To: Andrew Shellshear <Andrew.Shellshear@cisra.canon.com.au>
CC: www-svg@w3.org, SVG WG <w3c-svg-wg@w3.org>

Andrew Shellshear wrote:
> We have added the following explanitary text to the description of 
> getCurrentFocusedObject in
> http://www.w3.org/TR/2005/WD-SVGMobile12-20050413/svgudom.html#svg::SVGSVGElement 
> -
> Returns a reference to the object which has the focus.  This returns a 
> DOMObject because the currently focused object may be an object outside 
> the SVG namespace.  If the currently focused object is in the SVG 
> namespace, it should be cast to events::EventTarget.

I'm trying to figure out how this would work in a strongly typed language (C++, 
say).  Who's doing the casting?

For example, the C++ binding in Gecko for the IDL involved would look like 
(unrolling some typedefs):

   int GetCurrentFocusedObject(ISupports **);

Now how is the suggested explanatory text supposed to be implemented in this 
situation, exactly?

Is there a reason not to just return a Node to start with?  Then the caller 
could actually check for the SVG namespace and cast to events::EventTarget or 
EventTarget or whatever is appropriate as needed.  Or are there cases when the 
"focused object" is not a Node?  If so, what does it mean for it to be "in the 
SVG namespace"?

Received on Tuesday, 25 October 2005 14:50:56 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:04 UTC