Re: getElementById method on SVGSVGElement

Hi all,

     This is a feature that has been in a specification and
implemented by viewers for over 4 years.  I think deprecation
needs to be reserved for features that introduce real
technical issues, not things that someone finds to be a
minor nuisance to implement.  This is just silly, the code is
attached for Java, are we really concerned about 8 lines of
code?

public Element getElementByID(String id) {
     Element e = getOwnerDocument().getElementByID(id);
     Node n = e;
     while (n != null) {
	if (n == this) return e;
	n = n.getParentNode();
     }
     return null;
}

Bjoern Hoehrmann wrote:

> * Thomas DeWeese wrote:
> 
>>>Would it make sense to deprecate this method in future SVG versions?
>>
>>   Given that the implementation is really not that hard I would
>>argue against it.
> 
> From http://groups.yahoo.com/group/svg-developers/message/47300 it would
> seem that this method confuses authors to believe one can re-use IDs in
> a document. 

    If you got rid of any feature that confused authors you wouldn't
be left with anything.  And BTW the confusion on re-using ID's is
not limited to this method.

> And http://www.w3.org/mid/41FD3969.2070508@mit.edu suggests
> that it confuses implementers, too. Among the not really that hard to
> implement features there seem to be more useful methods...

    This is the message that started this thread, isn't that kind
of circular?

Received on Friday, 4 February 2005 11:24:46 UTC