Bug 1193637 - Use IsMap() in HTMLImageElement::PreHandleEvent; r=mrbkap

This commit is contained in:
Ms2ger
2015-09-10 13:49:19 +02:00
parent 138dafd78e
commit 8251e83cfd

View File

@@ -469,12 +469,8 @@ HTMLImageElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
// twice, once by the image frame for the map and once by the Anchor
// element. (bug 39723)
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent && mouseEvent->IsLeftClickEvent()) {
bool isMap = false;
GetIsMap(&isMap);
if (isMap) {
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
if (mouseEvent && mouseEvent->IsLeftClickEvent() && IsMap()) {
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
return nsGenericHTMLElement::PreHandleEvent(aVisitor);
}