Bug 1446711 part 4. Get rid of nsIDOMMouseEvent::GetCtrl/Shift/Alt/MetaKey. r=qdot

MozReview-Commit-ID: 1H2FzUHf55n
This commit is contained in:
Boris Zbarsky
2018-03-20 00:16:06 -04:00
parent 4f6f714fcf
commit 038b06c23d
3 changed files with 8 additions and 46 deletions

View File

@@ -846,15 +846,14 @@ bool
nsListControlFrame::HandleListSelection(nsIDOMEvent* aEvent,
int32_t aClickedIndex)
{
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
bool isShift;
MouseEvent* mouseEvent = aEvent->InternalDOMEvent()->AsMouseEvent();
bool isControl;
#ifdef XP_MACOSX
mouseEvent->GetMetaKey(&isControl);
isControl = mouseEvent->MetaKey();
#else
mouseEvent->GetCtrlKey(&isControl);
isControl = mouseEvent->CtrlKey();
#endif
mouseEvent->GetShiftKey(&isShift);
bool isShift = mouseEvent->ShiftKey();
return PerformSelection(aClickedIndex, isShift, isControl); // might destroy us
}
@@ -1931,13 +1930,13 @@ nsListControlFrame::DragMove(nsIDOMEvent* aMouseEvent)
if (selectedIndex == mEndSelectionIndex) {
return NS_OK;
}
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
NS_ASSERTION(mouseEvent, "aMouseEvent is not an nsIDOMMouseEvent!");
MouseEvent* mouseEvent = aMouseEvent->InternalDOMEvent()->AsMouseEvent();
NS_ASSERTION(mouseEvent, "aMouseEvent is not a MouseEvent!");
bool isControl;
#ifdef XP_MACOSX
mouseEvent->GetMetaKey(&isControl);
isControl = mouseEvent->MetaKey();
#else
mouseEvent->GetCtrlKey(&isControl);
isControl = mouseEvent->CtrlKey();
#endif
AutoWeakFrame weakFrame(this);
// Turn SHIFT on when you are dragging, unless control is on.