Bug 1253284 - Allow reserved attribute without command attribute draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 06 May 2016 18:38:44 +0900
changeset 364256 98917dc7d06f90f28023bcf60b3d20a5552ff4e4
parent 363870 e5a10bc7dac4ee2453d8319165c1f6578203eac7
child 520223 a71363509f9ecc8cf744f3ac81f8122573bb374f
push id17399
push userm_kato@ga2.so-net.ne.jp
push dateFri, 06 May 2016 09:40:46 +0000
bugs1253284
milestone49.0a1
Bug 1253284 - Allow reserved attribute without command attribute MozReview-Commit-ID: A2aEOgTx5Jz
browser/base/content/browser-sets.inc
dom/xbl/nsXBLWindowKeyHandler.cpp
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -352,17 +352,17 @@
     <key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
 
     <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
 
     <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
     <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
 #ifdef XP_MACOSX
     <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
-    <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" modifiers="accel"/>
+    <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" modifiers="accel" reserved="true"/>
 #elifdef XP_UNIX
     <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" command="cmd_quitApplication" modifiers="accel"/>
 #endif
 
 #ifdef FULL_BROWSER_WINDOW
     <key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
 #endif
     <key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -703,17 +703,17 @@ nsXBLWindowKeyHandler::WalkHandlersAndEx
     // <command> is non-empty).
     nsCOMPtr<Element> commandElement;
     if (!GetElementForHandler(handler, getter_AddRefs(commandElement))) {
       continue;
     }
 
     bool isReserved = false;
     if (commandElement) {
-      if (!IsExecutableElement(commandElement)) {
+      if (aExecute && !IsExecutableElement(commandElement)) {
         continue;
       }
 
       isReserved =
         commandElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::reserved,
                                     nsGkAtoms::_true, eCaseMatters);
       if (aOutReservedForChrome) {
         *aOutReservedForChrome = isReserved;