rem: * if user has started typing into the zero-length textfield 
add: * if user has started typing into the zero-length textbox 
context:   function Append(thisMenuList) {    /* Note: we always want a zero-length textfield so the user     * can start typing in a new value.  So we need to determine     * if user has started typing into the zero-length textfield     * in which case it's time to create yet another zero-length     * one.  We also need to determine if user has removed all     * text in a textfield in which case that textfield needs to     * be removed     */    /* transfer value from menu list to the selected menu item */    var thisMenuItem = thisMenuList.selectedItem;    if (!thisMenuItem) {      return;    }    thisMenuItem.setAttribute('value',thisMenuList.value);    /* determine previous size of textfield */    var len = Number(thisMenuItem.getAttribute("len"));    /* update previous size */    var newLen = thisMenuItem.getAttribute("value").length;    thisMenuItem.setAttribute("len", newLen);    /* obtain parent element */    var thisMenuPopup = thisMenuItem.parentNode;    if (!thisMenuPopup) {      return;    }    /* determine if it's time to remove menuItem */    if (newLen == 0) {      /* no characters left in text field */      if (len) {        /* previously there were some characters, time to remove */        thisMenuPopup.parentNode.selectedItem = thisMenuPopup.lastChild;        thisMenuPopup.removeChild(thisMenuItem);      }      return;    }    /* currently modified entry is not null so put it at head of list */    if (thisMenuPopup.childNodes.length > 1) {      thisMenuPopup.removeChild(thisMenuItem);      thisMenuPopup.insertBefore(thisMenuItem, thisMenuPopup.firstChild);    }    /* determine if it's time to add menuItem */    if (len) {      /* previously there were some characters and there still are so it's not time to add */      return;    }    /* add menu item */    var menuItem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem");    if (!menuItem) {      return;    }    menuItem.setAttribute("value", "");    menuItem.setAttribute("len", "0");    thisMenuPopup.appendChild(menuItem);    return;  }
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/1e7ee6f0f96dbc0326edd55283ca67952efda4df/WalletViewer.js/buggy/extensions/wallet/editor/resources/content/WalletViewer.js