Bug 961363 - Don't try to handle multiple-select commands in single-select lists. r=bz

This commit is contained in:
Mats Palmgren 2014-01-25 10:03:54 +00:00
Родитель e65b13f7bf
Коммит 3a6f7fb1b0
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -2102,11 +2102,19 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
int32_t newIndex = kNothingSelected;
bool isControlOrMeta = (keyEvent->IsControl() || keyEvent->IsMeta());
// Don't try to handle multiple-select pgUp/pgDown in single-select lists.
if (isControlOrMeta && !GetMultiple() &&
(keyEvent->keyCode == NS_VK_PAGE_UP ||
keyEvent->keyCode == NS_VK_PAGE_DOWN)) {
return NS_OK;
}
if (isControlOrMeta && (keyEvent->keyCode == NS_VK_UP ||
keyEvent->keyCode == NS_VK_LEFT ||
keyEvent->keyCode == NS_VK_DOWN ||
keyEvent->keyCode == NS_VK_RIGHT)) {
// Don't go into multiple select mode unless this list can handle it
keyEvent->keyCode == NS_VK_RIGHT ||
keyEvent->keyCode == NS_VK_HOME ||
keyEvent->keyCode == NS_VK_END)) {
// Don't go into multiple-select mode unless this list can handle it.
isControlOrMeta = mControlSelectMode = GetMultiple();
} else if (keyEvent->keyCode != NS_VK_SPACE) {
mControlSelectMode = false;