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:
hwaara%gmail.com 2006-05-17 08:54:27 +00:00
Родитель dc6c135b58
Коммит bb4d9466c0
4 изменённых файлов: 11 добавлений и 5 удалений

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

@ -174,10 +174,12 @@ function commonDialogOnLoad()
{ {
var dlgButtons = ['accept', 'cancel', 'extra1', 'extra2']; 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)]; var dButton = dlgButtons[gCommonDialogParam.GetInt(5)];
document.documentElement.defaultButton = dButton; document.documentElement.defaultButton = dButton;
#ifndef XP_MACOSX
document.documentElement.getButton(dButton).focus(); document.documentElement.getButton(dButton).focus();
#endif
} }
if (gCommonDialogParam.GetInt(6) != 0) // delay button enable if (gCommonDialogParam.GetInt(6) != 0) // delay button enable

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

@ -171,12 +171,15 @@
// so return focus to the tab itself // so return focus to the tab itself
focusedElt.focus(); focusedElt.focus();
} }
} else { }
#ifndef XP_MACOSX
else {
const dialog = document.documentElement; const dialog = document.documentElement;
const defaultButton = dialog.getButton(dialog.defaultButton); const defaultButton = dialog.getButton(dialog.defaultButton);
if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton)
defaultButton.focus(); defaultButton.focus();
} }
#endif
} }
} }
} }

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

@ -159,7 +159,7 @@
// so return focus to the tab itself // so return focus to the tab itself
focusedElt.focus(); focusedElt.focus();
} }
} else { } else if (!/Mac/.test(navigator.platform)) {
const dialog = document.documentElement; const dialog = document.documentElement;
const defaultButton = dialog.getButton(dialog.defaultButton); const defaultButton = dialog.getButton(dialog.defaultButton);
if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) if (focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton)

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

@ -179,10 +179,11 @@ function commonDialogOnLoad()
{ {
var dlgButtons = ['accept', 'cancel', 'extra1', 'extra2']; var dlgButtons = ['accept', 'cancel', 'extra1', 'extra2'];
// Set the default button and focus it // Set the default button
var dButton = dlgButtons[gCommonDialogParam.GetInt(5)]; var dButton = dlgButtons[gCommonDialogParam.GetInt(5)];
document.documentElement.defaultButton = dButton; 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 if (gCommonDialogParam.GetInt(6) != 0) // delay button enable