зеркало из https://github.com/mozilla/pjs.git
bug 335089, shouldn't auto-focus things in dialogs/sheets on OS X (esp. not with full keyboard access off). r=mano, a181=neil, mano. xpfe patch by Neil
This commit is contained in:
Родитель
dc6c135b58
Коммит
bb4d9466c0
|
@ -174,10 +174,12 @@ function commonDialogOnLoad()
|
|||
{
|
||||
var dlgButtons = ['accept', 'cancel', 'extra1', 'extra2'];
|
||||
|
||||
// Set the default button and focus it
|
||||
// Set the default button and focus it on non-OS X systems
|
||||
var dButton = dlgButtons[gCommonDialogParam.GetInt(5)];
|
||||
document.documentElement.defaultButton = dButton;
|
||||
#ifndef XP_MACOSX
|
||||
document.documentElement.getButton(dButton).focus();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (gCommonDialogParam.GetInt(6) != 0) // delay button enable
|
||||
|
|
|
@ -171,12 +171,15 @@
|
|||
// so return focus to the tab itself
|
||||
focusedElt.focus();
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#ifndef XP_MACOSX
|
||||
else {
|
||||
const dialog = document.documentElement;
|
||||
const defaultButton = dialog.getButton(dialog.defaultButton);
|
||||
if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton)
|
||||
defaultButton.focus();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
// so return focus to the tab itself
|
||||
focusedElt.focus();
|
||||
}
|
||||
} else {
|
||||
} else if (!/Mac/.test(navigator.platform)) {
|
||||
const dialog = document.documentElement;
|
||||
const defaultButton = dialog.getButton(dialog.defaultButton);
|
||||
if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton)
|
||||
|
|
|
@ -179,10 +179,11 @@ function commonDialogOnLoad()
|
|||
{
|
||||
var dlgButtons = ['accept', 'cancel', 'extra1', 'extra2'];
|
||||
|
||||
// Set the default button and focus it
|
||||
// Set the default button
|
||||
var dButton = dlgButtons[gCommonDialogParam.GetInt(5)];
|
||||
document.documentElement.defaultButton = dButton;
|
||||
document.documentElement.getButton(dButton).focus();
|
||||
if (!/Mac/.test(navigator.platform))
|
||||
document.documentElement.getButton(dButton).focus();
|
||||
}
|
||||
|
||||
if (gCommonDialogParam.GetInt(6) != 0) // delay button enable
|
||||
|
|
Загрузка…
Ссылка в новой задаче