mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 57192. Alt+Down for combo boxes in HTML. r=rods, sr=waterson
This commit is contained in:
parent
96a6390760
commit
1324edad85
@ -2187,6 +2187,17 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Toggle list open and close on Alt-Down or Alt-Up
|
||||
if (aEvent->message == NS_KEY_PRESS) {
|
||||
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
|
||||
nsInputEvent *inputEvent = (nsInputEvent*)aEvent;
|
||||
if (!inputEvent->isShift && !inputEvent->isControl && !inputEvent->isMeta &&
|
||||
inputEvent->isAlt && (keyEvent->keyCode == NS_VK_DOWN || (mDroppedDown && keyEvent->keyCode == NS_VK_UP)))
|
||||
ToggleList(aPresContext);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If we have style that affects how we are selected, feed event down to
|
||||
// nsFrame::HandleEvent so that selection takes place when appropriate.
|
||||
const nsStyleUserInterface* uiStyle;
|
||||
|
@ -2187,6 +2187,17 @@ nsComboboxControlFrame::HandleEvent(nsIPresContext* aPresContext,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Toggle list open and close on Alt-Down or Alt-Up
|
||||
if (aEvent->message == NS_KEY_PRESS) {
|
||||
nsKeyEvent* keyEvent = (nsKeyEvent*)aEvent;
|
||||
nsInputEvent *inputEvent = (nsInputEvent*)aEvent;
|
||||
if (!inputEvent->isShift && !inputEvent->isControl && !inputEvent->isMeta &&
|
||||
inputEvent->isAlt && (keyEvent->keyCode == NS_VK_DOWN || (mDroppedDown && keyEvent->keyCode == NS_VK_UP)))
|
||||
ToggleList(aPresContext);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If we have style that affects how we are selected, feed event down to
|
||||
// nsFrame::HandleEvent so that selection takes place when appropriate.
|
||||
const nsStyleUserInterface* uiStyle;
|
||||
|
Loading…
Reference in New Issue
Block a user