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

xblChildNodes property returning the same value as childNodes

From: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Date: Thu, 13 Oct 2005 14:18:25 +1000
To: www-svg@w3.org
Message-ID: <20051013041825.GA4613@port.mcc.id.au>


I was just thinking about the behaviour of the NodeXBL.xblChildNodes
property when an element isn't bound.  The prose for the property says:

  The attribute's value is the same as childNodes if the node is not

I take that to mean the implementation must do something like this:

  NodeList getXblChildNodes() {
  	if (isBound) {
		// return a NodeList that follows the flattened tree
	} else {
		return getChildNodes();

and that's what I do currently.  Maybe though this shouldn't be what's
specified though, and in fact it should say something like:

  The returned NodeList will contain the same nodes as the childNodes
  property if the node is not bound.

because otherwise you might get this sort of unexpected behaviour:

  // assume elt is currently not bound

  var nl = elt.xblChildNodes;

  // do something to make elt bound

  if (nl.item(0) !== elt.xblFirstChild) {
  	window.alert("well that was unexpected");

  e-mail : cam (at) mcc.id.au    	icq : 26955922
     web : http://mcc.id.au/	        msn : cam-msn (at) aka.mcc.id.au
  office : +61399055779		     jabber : heycam (at) jabber.org
Received on Thursday, 13 October 2005 04:18:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:04 UTC