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
parent 293bce7b4b
commit cc558e3fbb
4 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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
}
}
}

View File

@ -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)

View File

@ -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