xul:menuitem/@acceltext doesn't reflect corresponding xul:key/@modifiers[contains(.,"any")] properly

UNCONFIRMED
Unassigned

Status

()

Core
XUL
UNCONFIRMED
8 years ago
4 years ago

People

(Reporter: satyr, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100503 Firefox/3.6.4
Build Identifier: 

menuitem/@acceltext becomes unintuitive when menuitem/@key points to a key whose @modifiers contains "any".

Example:

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <key id="K" key="K" modifiers="shift any alt"/>
 <menu><menuitem key="K"/></menu>
</window>

Reproducible: Always

Steps to Reproduce:
1. Save the example above as a .xul file. 
2. Open it.

Actual Results:  
"Shift++Alt+K"

Expected Results:  
Something like "(Shift+)Alt+K"

Comment 1

4 years ago
I've had this problem with FF version 28.0. The code with the problem is in
  nsMenuFrame::BuildAcceleratorText()
It fails to check for the "any" modifier.

I would have thought that the "any" modifier would erase the previous
modifier names from the accelerator text since these modifiers are
optional. This would parallel the code in 
nsXBLPrototypeHandler::ConstructPrototype().

What I would like to do is have "*" as an accelerator. The
code in nsXBLPrototypeHandler::ModifiersMatchMask() seems to require that I list
"shift" as a modifier but it looks silly if the accelerator appears as "Shift+*"
on a menu item.
You need to log in before you can comment on or make changes to this bug.