rem: var child = [document.getElementById(node)]; var item = document.createElement("treeitem"); item.setAttribute("id", idfier + "0"); item.setAttribute("container", "true"); item.setAttribute("open", "true"); var items = [item]; var rows = [document.createElement("treerow")]; var cell = document.createElement("treecell"); cell.setAttribute("class", "treecell-indent"); cell.setAttribute("label", chain[0]); var cells = [cell]; for (var i=1; i<chain.length; i++) { child[i] = items[i-1]; item = document.createElement("treeitem"); item.setAttribute("id", idfier + i); item.setAttribute("container", "true"); items[i] = item; rows[i] = document.createElement("treerow"); cell = document.createElement("treecell"); cell.setAttribute("class", "treecell-indent"); cell.setAttribute("label", chain[i]); cells[i] = cell; } for (i=chain.length-1; i>=0; i--) { rows[i].appendChild(cells[i]); items[i].appendChild(rows[i]); child[i].appendChild(items[i]); 
add: var child = document.getElementById(node); var numCerts = chain.Count(); var currCert; var displayVal; var addTwistie; for (var i=numCerts-1; i>=0; i--) { currCert = chain.GetElementAt(i); currCert = currCert.QueryInterface(nsIX509Cert); if (currCert.commonName) { displayVal = currCert.commonName; } else { displayVal = currCert.windowTitle; } if (0 == i) { addTwistie = false; } else { addTwistie = true; } child = addChildrenToTree(child, displayVal, null,addTwistie); 
context: function AddCertChain(node, chain, idPrefix){  var idfier = idPrefix+"chain_";  var child = [document.getElementById(node)];  var item = document.createElement("treeitem");  item.setAttribute("id", idfier + "0");  item.setAttribute("container", "true");  item.setAttribute("open", "true");  var items = [item];  var rows = [document.createElement("treerow")];  var cell = document.createElement("treecell");  cell.setAttribute("class", "treecell-indent");  cell.setAttribute("label", chain[0]);  var cells = [cell];  for (var i=1; i<chain.length; i++) {    child[i] = items[i-1];    item = document.createElement("treeitem");    item.setAttribute("id", idfier + i);    item.setAttribute("container", "true");    items[i] = item;    rows[i] = document.createElement("treerow");    cell = document.createElement("treecell");    cell.setAttribute("class", "treecell-indent");    cell.setAttribute("label", chain[i]);    cells[i] = cell;  }  for (i=chain.length-1; i>=0; i--) {    rows[i].appendChild(cells[i]);    items[i].appendChild(rows[i]);    child[i].appendChild(items[i]);  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/d41928522e534dd9a0996236faf1a714b84070a7/viewCertDetails.js/clean/security/manager/pki/resources/content/viewCertDetails.js