Re: SVG12: DOMObject portability

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"?

-Boris

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