summaryrefslogtreecommitdiffstats
path: root/toolkit/components
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-19 16:29:19 -0400
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-24 10:35:09 +0200
commitb6a703907e7e349213fac466d5665e91966cbcaa (patch)
treefe1e1db4b452623608e9784c81ef3340e52d1225 /toolkit/components
parentda42871b0e0d05487c27a1fc20095f9954d93eba (diff)
downloadUXP-b6a703907e7e349213fac466d5665e91966cbcaa.tar
UXP-b6a703907e7e349213fac466d5665e91966cbcaa.tar.gz
UXP-b6a703907e7e349213fac466d5665e91966cbcaa.tar.lz
UXP-b6a703907e7e349213fac466d5665e91966cbcaa.tar.xz
UXP-b6a703907e7e349213fac466d5665e91966cbcaa.zip
Issue #65 - Remove AppConstants from toolkit/prompts/content/tabprompts.xml
This file not only somehow escaped my pass through here but was also mocking me by using AppConstants in a preprocessed file BUT ALSO right AFTER a preprocessor directive.
Diffstat (limited to 'toolkit/components')
-rw-r--r--toolkit/components/prompts/content/tabprompts.xml28
1 files changed, 13 insertions, 15 deletions
diff --git a/toolkit/components/prompts/content/tabprompts.xml b/toolkit/components/prompts/content/tabprompts.xml
index 07c6c8efb..0ce13203c 100644
--- a/toolkit/components/prompts/content/tabprompts.xml
+++ b/toolkit/components/prompts/content/tabprompts.xml
@@ -323,21 +323,19 @@
let bnum = this.args.defaultButtonNum || 0;
let defaultButton = this.ui["button" + bnum];
- let { AppConstants } =
- Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
- if (AppConstants.platform == "macosx") {
- // On OS X, the default button always stays marked as such (until
- // the entire prompt blurs).
- defaultButton.setAttribute("default", true);
- } else {
- // On other platforms, the default button is only marked as such
- // when no other button has focus. XUL buttons on not-OSX will
- // react to pressing enter as a command, so you can't trigger the
- // default without tabbing to it or something that isn't a button.
- let focusedDefault = (event.originalTarget == defaultButton);
- let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
- defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
- }
+#ifdef XP_MACOSX
+ // On OS X, the default button always stays marked as such (until
+ // the entire prompt blurs).
+ defaultButton.setAttribute("default", true);
+#else
+ // On other platforms, the default button is only marked as such
+ // when no other button has focus. XUL buttons on not-OSX will
+ // react to pressing enter as a command, so you can't trigger the
+ // default without tabbing to it or something that isn't a button.
+ let focusedDefault = (event.originalTarget == defaultButton);
+ let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
+ defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
+#endif
</handler>
<handler event="blur">
// If focus shifted to somewhere else in the browser, don't make