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

This commit is contained in:
pollmann%netscape.com 2000-06-14 15:02:18 +00:00
parent d974f01a10
commit a40225584e
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);
}