|
Re: getElementById method on SVGSVGElement: msg#00037web.svg
Robin Berjon wrote:
No. So, you would consider my example code to be in error? If so there is no way to reuse an id and keep the document consistent in the process, at some point the id which may be referenced must be undefined. This introduces all sorts of interesting issues about how/when an SVG document can be "invalid". In fact, if I read DOM 3 Core correctly, the attachement of the node to the tree appears to be irrelevant. If you look at the spec, the isId field on Attr says "when it is [of type ID] and its value is unique, the ownerElement of this attribute can be retrieved using the method Document.getElementById"[0]. So it does... Based on that, I would expect that given element 'el' not attached to the tree but belonging to document 'doc' But I see no requirement on the ownerElement belonging to 'doc', or that ownerElement be in the same processes or even on the same machine, so following your logic a DOM implementation must search every machine in existence for an element with that id. I knew id's had to be unique but I didn't realize they had to GUIDs ;) and having an attribute 'foo' of value 'bar', if I did el.setIdAttribute('foo', true) it appears to be expected that doc.getElementById('bar') would return el. Clearly there is some subset of the DOM universe that is expected to be searched, I don't see a clear indication of that that universe is from the DOM spec. I personally find it quite a stretch to extend the search to all nodes ever created by a document (does it hold 'hard' references to them?). It is probably time to request a clarification from the DOM WG. [0]http://www.w3.org/TR/DOM-Level-3-Core/core.html#Attr-isId |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: getElementById method on SVGSVGElement: 00037, Cameron McCormack |
|---|---|
| Next by Date: | Re: getElementById method on SVGSVGElement: 00037, Robin Berjon |
| Previous by Thread: | Re: getElementById method on SVGSVGElementi: 00037, Robin Berjon |
| Next by Thread: | Re: getElementById method on SVGSVGElement: 00037, Robin Berjon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |