xblChildNodes property returning the same value as childNodes

Hi.

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
  bound.

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