Bug 39723: Send only one request to the server when clicking on an image map. r=joki

git-svn-id: svn://10.0.0.236/trunk@72225 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pollmann%netscape.com 2000-06-14 15:02:18 +00:00
parent 8f2c21ff8e
commit 1826a073a2
2 changed files with 20 additions and 0 deletions

View File

@ -582,6 +582,16 @@ nsHTMLImageElement::HandleDOMEvent(nsIPresContext* aPresContext,
PRUint32 aFlags,
nsEventStatus* aEventStatus)
{
// If we are a map and get a mouse click, don't let it be handled by the
// Generic Element as this could cause a click event to fire twice, once by
// the image frame for the map and once by the Anchor element. (bug 39723)
if (NS_MOUSE_LEFT_CLICK == aEvent->message) {
PRBool isMap = PR_FALSE;
GetIsMap(&isMap);
if (isMap) {
*aEventStatus = nsEventStatus_eConsumeNoDefault;
}
}
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
aFlags, aEventStatus);
}

View File

@ -582,6 +582,16 @@ nsHTMLImageElement::HandleDOMEvent(nsIPresContext* aPresContext,
PRUint32 aFlags,
nsEventStatus* aEventStatus)
{
// If we are a map and get a mouse click, don't let it be handled by the
// Generic Element as this could cause a click event to fire twice, once by
// the image frame for the map and once by the Anchor element. (bug 39723)
if (NS_MOUSE_LEFT_CLICK == aEvent->message) {
PRBool isMap = PR_FALSE;
GetIsMap(&isMap);
if (isMap) {
*aEventStatus = nsEventStatus_eConsumeNoDefault;
}
}
return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent,
aFlags, aEventStatus);
}