rem: switch (local_name) { case "a": case "area": case "link": if (target.hasAttribute("href")) linkNode = target; break; case "input": if ((event.target.type == "text") 
add: if ( target instanceof HTMLAnchorElement || target instanceof HTMLAreaElement   || target instanceof HTMLLinkElement ) { if (target.hasAttribute("href")) linkNode = target; } else if ( target instanceof HTMLInputElement && (event.target.type == "text") 
context:   function hrefForClickEvent(event)  {    var target = event.target;    var linkNode;    var local_name = target.localName;    if (local_name) {      local_name = local_name.toLowerCase();    }        var isKeyPress = (event.type == "keypress");    switch (local_name) {      case "a":      case "area":      case "link":        if (target.hasAttribute("href"))           linkNode = target;        break;      case "input":        if ((event.target.type == "text") // text field            && !isKeyPress       // not a key event            && event.detail == 2 // double click            && event.button == 0 // left mouse button            && event.target.value.length == 0 // no text has been entered            && "@mozilla.org/wallet/wallet-service;1" in Components.classes // wallet is available        ) {          prefillTextBox(target); // prefill the empty text field if possible        }        break;      default:        linkNode = findParentNode(event.originalTarget, "a");        // <a> cannot be nested.  So if we find an anchor without an        // href, there is no useful <a> around the target        if (linkNode && !linkNode.hasAttribute("href"))          linkNode = null;        break;    }    var href;    if (linkNode) {      href = new XPCNativeWrapper(linkNode, "href").href;    } else {      // Try simple XLink      linkNode = target;      while (linkNode) {        if (linkNode.nodeType == Node.ELEMENT_NODE) {          var wrapper = new XPCNativeWrapper(linkNode, "getAttributeNS()");          href = wrapper.getAttributeNS("http://www.w3.org/1999/xlink", "href");          break;        }        linkNode = linkNode.parentNode;      }      if (href && href != "") {        var baseURI = new XPCNativeWrapper(linkNode, "baseURI").baseURI;        href = makeURLAbsolute(baseURI, href);      }    }    return href;  }
meta: 5459	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5459/791d4bb5bdb38093c69a71fc2d98757908a7a3d5/contentAreaClick.js/buggy/suite/common/contentAreaClick.js