From e3f71a6d6d505c851ae81f9e3e2695bfc13ecbd8 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 24 Jan 2002 02:54:18 +0000 Subject: [PATCH] Ignore anchors without href attrs in contentAreaClick. Bug 120973, r=caillon, sr=blake --- .../resources/content/contentAreaClick.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/xpfe/communicator/resources/content/contentAreaClick.js b/xpfe/communicator/resources/content/contentAreaClick.js index a4b6714ae887..9aa87dd862f7 100644 --- a/xpfe/communicator/resources/content/contentAreaClick.js +++ b/xpfe/communicator/resources/content/contentAreaClick.js @@ -127,14 +127,9 @@ switch (local_name) { case "a": - linkNode = target; - break; case "area": - if (target.href) - linkNode = target; - break; case "link": - if (target.href) + if (target.hasAttribute("href")) linkNode = target; break; case "input": @@ -147,6 +142,10 @@ break; default: linkNode = findParentNode(event.originalTarget, "a"); + // cannot be nested. So if we find an anchor without an + // href, there is no useful around the target + if (linkNode && !linkNode.hasAttribute("href")) + linkNode = null; break; } if (linkNode) {