diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index 8bd7ab2ec69a..91fac883c66a 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -170,7 +170,8 @@
+ modifiers="accel"
+ internal="true"/>
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
-
+
@@ -310,7 +314,9 @@
# On OS X, dark voodoo magic invokes the quit code for this key.
# So we're not adding the attribute on OSX because of backwards/add-on compat.
# See bug 1369909 for background on this.
-#ifndef XP_MACOSX
+#ifdef XP_MACOSX
+ internal="true"
+#else
command="cmd_quitApplication"
#endif
reserved="true"/>
@@ -361,20 +367,25 @@
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel"
+ internal="true"/>
+ modifiers="accel,alt"
+ internal="true"/>
#endif
diff --git a/browser/components/downloads/content/contentAreaDownloadsView.xhtml b/browser/components/downloads/content/contentAreaDownloadsView.xhtml
index f6e88122a717..bf92e570ee07 100644
--- a/browser/components/downloads/content/contentAreaDownloadsView.xhtml
+++ b/browser/components/downloads/content/contentAreaDownloadsView.xhtml
@@ -15,10 +15,6 @@
%editMenuDTD;
]>
-
GetAttr(nsGkAtoms::oncommand, value);
- return !value.IsEmpty();
+ // Internal keys are defined as elements so that the menu label
+ // and disabled state can be updated properly, but the command is executed
+ // by some other means. This will typically be because the key is defined
+ // as a shortcut defined in ShortcutKeyDefinitions.cpp instead, or on Mac,
+ // some special system defined keys.
+ return !aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::internal,
+ nsGkAtoms::_true, eCaseMatters);
}
already_AddRefed XULKeySetGlobalKeyListener::GetHandlerTarget(
diff --git a/toolkit/content/editMenuOverlay.js b/toolkit/content/editMenuOverlay.js
index 8edcc31b1f8a..57bd52caadf4 100644
--- a/toolkit/content/editMenuOverlay.js
+++ b/toolkit/content/editMenuOverlay.js
@@ -40,9 +40,6 @@ function goUpdatePasteMenuItems() {
window.addEventListener(
"DOMContentLoaded",
() => {
- // Bug 371900: Remove useless oncommand attribute once bug 371900 is fixed
- // If you remove/update the oncommand attribute for any of the cmd_*, please
- // also remove/update the sha512 hash in the CSP within about:downloads
let container =
document.querySelector("commandset") || document.documentElement;
let fragment = MozXULElement.parseXULToFragment(`
@@ -50,14 +47,14 @@ window.addEventListener(
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
`);
diff --git a/toolkit/content/tests/chrome/window_keys.xhtml b/toolkit/content/tests/chrome/window_keys.xhtml
index e72c790947e6..d85f8e8c3ea8 100644
--- a/toolkit/content/tests/chrome/window_keys.xhtml
+++ b/toolkit/content/tests/chrome/window_keys.xhtml
@@ -55,12 +55,21 @@ var keysToTest = [
["k-g-co", "G", { ctrlKey: true, osKey: true } ],
["scommand", "Y", { } ],
["", "U", { } ],
+ ["k-z-c", "Z", { ctrlKey: true } ],
];
function runTest()
{
+ let nonInlineKeyFired = false;
+ document.getElementById("k-z-c").addEventListener("command", event => {
+ nonInlineKeyFired = true;
+ checkKey(event);
+ });
+
iterateKeys(true, "normal");
+ ok(nonInlineKeyFired, "non-inline command listener fired");
+
var keyset = document.getElementById("keyset");
keyset.setAttribute("disabled", "true");
iterateKeys(false, "disabled");
@@ -174,6 +183,7 @@ SimpleTest.waitForFocus(runTest);
+
diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py
index 3b3587e5cbdd..50f0b8930932 100644
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -554,6 +554,7 @@ STATIC_ATOMS = [
Atom("insertion", "insertion"),
Atom("integer", "integer"),
Atom("integrity", "integrity"),
+ Atom("internal", "internal"),
Atom("internals", "internals"),
Atom("intersection", "intersection"),
Atom("intersectionobserverlist", "intersectionobserverlist"),