зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1008244 Don't consume Enter key at keypress event when <select size=1> has focus but its dropdown list is closed r=smaug
This commit is contained in:
Родитель
2a02941977
Коммит
c73fb6d886
|
@ -2131,12 +2131,11 @@ nsListControlFrame::KeyDown(nsIDOMEvent* aKeyEvent)
|
|||
break;
|
||||
case NS_VK_RETURN:
|
||||
if (IsInDropDownMode()) {
|
||||
// If the select element is a dropdown style, Enter key should be
|
||||
// consumed everytime since Enter key may be pressed accidentally after
|
||||
// the dropdown is closed by Enter key press.
|
||||
aKeyEvent->PreventDefault();
|
||||
|
||||
if (mComboboxFrame->IsDroppedDown()) {
|
||||
// If the select element is a dropdown style, Enter key should be
|
||||
// consumed while the dropdown is open for security.
|
||||
aKeyEvent->PreventDefault();
|
||||
|
||||
nsWeakFrame weakFrame(this);
|
||||
ComboboxFinish(mEndSelectionIndex);
|
||||
if (!weakFrame.IsAlive()) {
|
||||
|
|
|
@ -321,7 +321,7 @@ function runTests()
|
|||
|
||||
reset()
|
||||
synthesizeKey("VK_RETURN", {});
|
||||
check(true, "Enter key on combobox");
|
||||
check(false, "Enter key on combobox");
|
||||
|
||||
reset()
|
||||
synthesizeKey("VK_ESCAPE", {});
|
||||
|
|
Загрузка…
Ссылка в новой задаче