Bug 1260704 - Instead of handling mouse up event, we handle mouse click event to trigger links. r=smaug
This commit is contained in:
@@ -445,17 +445,15 @@ HTMLImageElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||
aValue, aNotify);
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
HTMLImageElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
|
||||
{
|
||||
// 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)
|
||||
// We handle image element with attribute ismap in its corresponding frame
|
||||
// element. Set mMultipleActionsPrevented here to prevent the click event
|
||||
// trigger the behaviors in Element::PostHandleEventForLinks
|
||||
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
|
||||
if (mouseEvent && mouseEvent->IsLeftClickEvent() && IsMap()) {
|
||||
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
|
||||
mouseEvent->mFlags.mMultipleActionsPrevented = true;
|
||||
}
|
||||
return nsGenericHTMLElement::PreHandleEvent(aVisitor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user