rem: var target = event.target; var linkNode;  var local_name = target.localName;  if (local_name) { local_name = local_name.toLowerCase(); }  
context:   function contentAreaClick(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          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 = linkNode.href;    } else {      // Try simple XLink      linkNode = target;      while (linkNode) {        if (linkNode.nodeType == Node.ELEMENT_NODE) {          href = linkNode.getAttributeNS("http://www.w3.org/1999/xlink", "href");          break;        }        linkNode = linkNode.parentNode;      }      if (href && href != "") {        href = makeURLAbsolute(target.baseURI,href);      }    }    if (href) {      if (isKeyPress) {        openNewTabWith(href, true, event.shiftKey);        event.preventBubble();      }      else {        handleLinkClick(event, href, null);      }      return true;    }    if (pref && !isKeyPress && event.button == 1 &&        !findParentNode(event.originalTarget, "scrollbar") &&        pref.getBoolPref("middlemouse.contentLoadURL")) {      if (middleMousePaste(event)) {        event.preventBubble();      }    }    return true;  }
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/7a96ed6b1bfec088b00a7a46863d5578feb3e151/contentAreaClick.js/buggy/suite/common/contentAreaClick.js