From 810a9820adec6ff2b43767c6b9e04276a69ebedb Mon Sep 17 00:00:00 2001 From: "anthonyd%netscape.com" Date: Sat, 3 Feb 2001 07:07:15 +0000 Subject: [PATCH] fix for bug #55921 - Clicking to the right of a link doesn't clear selection sr/r=joki, sfraser git-svn-id: svn://10.0.0.236/trunk@86148 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 13 +++++++++++++ mozilla/layout/html/base/src/nsFrame.cpp | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 700166a4303..a8fccde9862 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -1033,7 +1033,20 @@ nsFrame::HandlePress(nsIPresContext* aPresContext, // in the presence of an href with a value! nsAutoString href; if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href)) + {// fix for bug #55921 + nsIView *dummyView = 0; + nsRect frameRect = mRect; + nsPoint offsetPoint; + + GetOffsetFromView(aPresContext, offsetPoint, &dummyView); + + frameRect.x = offsetPoint.x; + frameRect.y = offsetPoint.y; + + if (frameRect.x <= aEvent->point.x && (frameRect.x + frameRect.width >= aEvent->point.x) && + frameRect.y <= aEvent->point.y && (frameRect.y + frameRect.height >= aEvent->point.y)) return NS_OK; + } } // now try the parent diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 700166a4303..a8fccde9862 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -1033,7 +1033,20 @@ nsFrame::HandlePress(nsIPresContext* aPresContext, // in the presence of an href with a value! nsAutoString href; if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href)) + {// fix for bug #55921 + nsIView *dummyView = 0; + nsRect frameRect = mRect; + nsPoint offsetPoint; + + GetOffsetFromView(aPresContext, offsetPoint, &dummyView); + + frameRect.x = offsetPoint.x; + frameRect.y = offsetPoint.y; + + if (frameRect.x <= aEvent->point.x && (frameRect.x + frameRect.width >= aEvent->point.x) && + frameRect.y <= aEvent->point.y && (frameRect.y + frameRect.height >= aEvent->point.y)) return NS_OK; + } } // now try the parent