mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
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:
parent
293bce7b4b
commit
cc558e3fbb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user