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

SVGT 1.2: no way to traverse children of non-SVG elements

From: Maciej Stachowiak <mjs@apple.com>
Date: Mon, 26 Dec 2005 22:44:16 -0700
Message-Id: <5F940045-0D27-49F1-A477-314CB3909F48@apple.com>
To: www-svg@w3c.org


Because the uDOM Element interface does not include firstChild,  
lastChild, nextSibling and previousSibling, and because the  
ElementTraversal interface is only implemented by SVGElement, the  
uDOM does not provide a way to traverse the children of non-SVG  
elements. This seems like a major limitation.

The ElementTraversal interface duplicates these four properties, with  
apparently the main purpose of avoiding exposure of Text nodes. This  
too is problematic since this interface is useless in a full DOM  
implementation.

I see the following possibilities:

1) Leave things alone, and allow the uDOM to contain subtrees that  
cannot be traversed using its API.

2) Add ElementTraversal to the Element interface, not just SVGElement.

3) Add previousSibling/nextSibling to the Nodeinterface , and  
firstChild/lastChild to the Element interface (not necessarily to  
Node or Document, however). Make non-element nodes present only the  
Node interface.

4) Add previousSibling/nextSibling to the Nodeinterface , and  
firstChild/lastChild to the Element interface (not necessarily to  
Node or Document, however). Make non-element nodes present only the  
Node interface, except for Text nodes which also present some minimal  
Text interface (this would allow removal of alternate ways to get  
text contents).

I would say #1 is untenable, it seems wrong to make some subtrees of  
the uDOM non-traversible.

I think #2 is problematic, as it would add four near-duplicate  
attributes to a core interface.

I think either 3 or 4 is acceptable and surely not too heavy an  
implementation burden. I hope to send a separate follow-on message  
about text access.

Regards,
Maciej
Received on Tuesday, 27 December 2005 05:50:43 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:32 GMT