Re: getElementById method on SVGSVGElement

Boris Zbarsky wrote:
> I have two question about the getElementById method on SVGSVGElement:
> 
> 1)  Why does this function exist?  Since IDs must be unique in the 
> document,
>     getElementById on the document should be sufficient, no?  Is this 
> method
>     meant as a convenience for SVG implementors or for SVG authors?

I *think* that the original intent was to deal with the case where 
different implementations may be dealing with different parts of the 
same tree (eg a plugin handling a subtree embedded in another document). 
This would have allowed that implementation to know that the id 
attribute on an element in the SVG namespace is an ID (as the DOM 
allows). In retrospect I'm unsure how useful this turned out to be.

> 2)  The "Behavior is not defined if more than one element has this id" 
> wording
>     is not clear to me.  Is that "more than one element in the 
> document", or
>     "more than one element in the subtree"?  The former makes more sense 
> to it,
>     and I'd like to request a formal erratum to that effect.

It's the former AFAIK, and indeed should be clarified with an erratum.

-- 
Robin Berjon
   Research Scientist
   Expway, http://expway.com/

Received on Thursday, 3 February 2005 13:40:24 UTC