W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2006

Special group of functions for NON-ELEMENT nodes in document

From: Master Br <master@sitesbr.net>
Date: Sat, 23 Sep 2006 23:44:03 -0300
Message-ID: <4515F0F3.6010804@sitesbr.net>
To: www-dom@w3.org
Hi, everybody
I use only Mozilla Firefox for almost 2 years, and I noticed that it's 
javascript sees more childNodes than other browsers, because it 
considers textnodes and commentnodes too...

It would be good if W3C Standards had *2 groups of methods* to deal with 
nodes:

In the Basic group, *firstChild, lastChild and childNodes[n]* as "most 
browsers do", should deal ONLY with ELEMENT NODES... ignoring the rest
In a Special group, (for instance:) *firstChildSp, lastChildSp and 
childNodesSp[n]* would return ALL TYPES OF NODES.

This way,* ONLY if a programmer is interested in all nodes, including 
the textnodes *(that in general only disturb the process) he will use 
the special functions that end with "Sp" an return ANY type of nodes.

Sp meaning Special, because it will consider textnodes, elementnodes and 
commentnodes...

In the Basic group, *firstChild, lastChild and childNodes[n]* as "most 
browsers do", should deal ONLY with ELEMENT NODES... ignoring the rest

What about ?

Sergio A.
Received on Monday, 25 September 2006 02:40:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT