#399: M1249913 M1310403 M1260515

This commit is contained in:
Cameron Kaiser
2017-12-17 15:32:39 -08:00
parent 82f1d5895c
commit fbde989ca7
4 changed files with 9 additions and 80 deletions

View File

@@ -311,69 +311,6 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
}
break;
case eMouseDown:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (mouseEvent->button == WidgetMouseEvent::eLeftButton) {
if (mouseEvent->mFlags.mIsTrusted) {
EventStateManager* esm =
aVisitor.mPresContext->EventStateManager();
EventStateManager::SetActiveManager(
static_cast<EventStateManager*>(esm), this);
}
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm) {
uint32_t flags = nsIFocusManager::FLAG_BYMOUSE |
nsIFocusManager::FLAG_NOSCROLL;
// If this was a touch-generated event, pass that information:
if (mouseEvent->inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
flags |= nsIFocusManager::FLAG_BYTOUCH;
}
fm->SetFocus(this, flags);
}
mouseEvent->mFlags.mMultipleActionsPrevented = true;
} else if (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
mouseEvent->button == WidgetMouseEvent::eRightButton) {
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
if (aVisitor.mDOMEvent) {
aVisitor.mDOMEvent->StopPropagation();
}
}
}
break;
// cancel all of these events for buttons
//XXXsmaug What to do with these events? Why these should be cancelled?
case eMouseUp:
case eMouseDoubleClick:
{
WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
if (aVisitor.mDOMEvent &&
(mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
mouseEvent->button == WidgetMouseEvent::eRightButton)) {
aVisitor.mDOMEvent->StopPropagation();
}
}
break;
case eMouseOver:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(this, NS_EVENT_STATE_HOVER);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
break;
// XXX this doesn't seem to do anything yet
case eMouseOut:
{
aVisitor.mPresContext->EventStateManager()->
SetContentState(nullptr, NS_EVENT_STATE_HOVER);
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
}
break;
default:
break;
}