Closed Bug 1484914 Opened 6 years ago Closed 6 years ago

Access key in context menu appears duplicated

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(firefox63 verified)

VERIFIED FIXED
mozilla63
Tracking Status
firefox63 --- verified

People

(Reporter: flod, Assigned: robwu)

References

Details

Attachments

(3 files)

Flags: needinfo?(rob)
This happens on Windows and Linux only (and not on macOS, where access keys aren't being displayed in the menu item).

I'll fix this by stripping " (&x)" from the end of the title, under the following conditions:
- intl.menuitems.alwaysappendaccesskeys is true
- Platform is Windows or Linux.
- "x" is the access key.

I have tried hard to write automated tests, but will not an automated regression test since the relevant logic resides at the layout/ layer, and the internal mTitle is set but not available through JS.
  https://searchfox.org/mozilla-central/rev/3fa761ade83ed0b8ab463acb057c2cf0b104689e/layout/xul/nsTextBoxFrame.cpp#833-885
- In debug builds, there exist a GetFrameName method to retrieve the internal mTitle:
  https://searchfox.org/mozilla-central/rev/3fa761ade83ed0b8ab463acb057c2cf0b104689e/layout/xul/nsTextBoxFrame.cpp#1192-1200
- That method is used by various C++ test functions, but a long shot from being exposed to JS. (And even if it were, it is a layout frame, not the XUL element itself).
Assignee: nobody → rob
Status: NEW → ASSIGNED
Flags: needinfo?(rob)
Actually, rather than trying to detect the cases where the key would be duplicated followed by stripping, I am going to check whether the suffix already exists and not duplicate it again if present.

bz seems to have reviewed some patches to nsTextBoxFrame::UpdateAccessTitle, so I'm going to push another review in his queue for when he returns from PTO.
On macOS, access keys are not visually observable.

On Linux and Windows, access keys are underlined.
Moreover, if intl.menuitems.alwaysappendaccesskeys is set, the access
key is always appended as "(X)", optionally preceded by a space, where X
is the uppercased version of the access key.

This commit updates the logic to not append a new "(X)" if this expected
suffix is already present at the end of the label.
Hi,
Is the patch requested for review?
If possible, I hope it will be fixed in Firefox 63.
Thanks.
I have asked bz for review, but I'm not sure if he sees the notification since I added the review request before the Phabricator account was re-enabled.
(In reply to Rob Wu [:robwu] from comment #6)
> I have asked bz for review, but I'm not sure if he sees the notification
> since I added the review request before the Phabricator account was
> re-enabled.
Flags: needinfo?(bzbarsky)
Comment on attachment 9003192 [details]
Bug 1484914 - Never append duplicate access key hints

Boris Zbarsky [:bzbarsky, bz on IRC] has approved the revision.
Attachment #9003192 - Flags: review+
Flags: needinfo?(bzbarsky)
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/964610ef7e3f
Never append duplicate access key hints r=bzbarsky
https://hg.mozilla.org/mozilla-central/rev/964610ef7e3f
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Attached image Bug1484914.gif
I was able to reproduce this issue on Firefox 63.0a1.ja and .en-US (20180829100131) under Win 7 64-bit and Ubuntu 14.04 LTS.

This issue is verified as fixed on Firefox 63.0a1.ja and .en-US (20180902220539) under Win 7 64-bit, Mac OS X 10.13.3 and Ubuntu 14.04 LTS.

Please see the attached video.
Status: RESOLVED → VERIFIED
See Also: → 1647373
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: