W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2008

Node.isEqualNode

From: Joćo Eiras <joao.eiras@gmail.com>
Date: Tue, 08 Jan 2008 20:35:47 -0000
To: "www-dom@w3.org" <www-dom@w3.org>
Message-ID: <op.t4motxyxjz3wb9@foobar.wag54gs>


Hi, there's some wording in the DOM 3 Core spec, about Node.isEqualNode  
which left me with doubts:

	The childNodes NodeLists are equal.
	This is: they are both null, or they have the same length and contain  
equal nodes at the same index.
	Note that normalization can affect equality; to avoid this, nodes should  
be normalized before being compared.

The problem is this sentence:

	Note that normalization can affect equality; to avoid this, nodes should  
be normalized before being compared.

My doubt is: is this a requirement of the function behavior, or just a  
recommendation to users of this API?

If it's the former, then after reading this, the first impression I have  
is that the 2 nodes, the object over which is method is called, and its  
parameter, are normalized, and therefore can change their state after that  
method is called. I doubt that's the intended behavior.
I propose for the sentence to be rewritten to: Note that normalization can  
affect equality; to avoid this, nodes should be compared as if they were  
normalized.
Else, just leave it clear that's a small non-normative note to authors.

Thank you.
Received on Tuesday, 8 January 2008 20:36:06 GMT

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