Closed Bug 2073889 Opened 16 days ago Closed 1 day ago

Content area context menu items share accesskeys or lack one

Categories

(Firefox :: Menus, defect)

defect

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Found by running the check over every desktop mochitest. Duplicates: Send Link/Page to Device/Mobile and Translate Selection/Link Text share N (translations.ftl uses only d e m n r s t); Search Image with Google Lens and View Selection Source share E; Open Link in New Smart Window shares S with Search <engine> for … and Set Image as Desktop Background; Create AI Tab shares A with Select All; inside editable content, link and page items collide with edit items (Open Link in New Tab / Cut on T, Open Link in New Window / Delete on D, Open Link in New Private Window and Save Page As / Paste on P, Copy Clean Link / Undo on U, Take Screenshot / Cut on T, Reload / Redo on R). Items without an accesskey: Copy Link to Highlight, Copy Clean Link to Highlight, Remove Highlight, Add Comment to Selection, Highlight Selection, and on view-source pages Wrap Long Lines and Syntax Highlighting (viewSource.properties has no accesskey entries and initViewSourceItems sets one only for Go to Line). Spelling suggestions are handled separately in the spellchecker bug.

Bug 2073864 (Inspect Accessibility Properties) belongs here: every letter of that label is owned by an item that can show beside it, and the only free letter, Y, belongs to Copy Image, whose letters are all taken in the image context; moving Copy Image to A collides with Select All on canvases and in designMode.

The menu uses every letter a to y across its contexts, so nsContextMenu.sys.mjs's visibility conditions decide which items can show together.

Bug 2073853 adds an automation check: a menupopup or panel-list that opens with two visible items sharing an accesskey, or with items lacking one beside items that have one, logs an AccessKeyConflictError and fails the running browser-chrome test. This menu carries an accesskey-conflicts-bug attribute naming this bug so the check skips it. The fix picks unique letters for static items (a message whose accesskey changes gets a new Fluent id; no migration recipe) and removes the attribute in the same patch so the check guards the menu from then on. Items generated from data can't be given accesskeys, so a menu that mixes them with static items either drops the static items' accesskeys or moves the generated items into a submenu. Conflicts are per visible menu instance, so a letter has to be free among the items that can show together, not merely in the Fluent file.

Depends on: 2073901
Depends on: 2073864
Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

Back, Forward, Reload, Stop and Bookmark Page are icon buttons with no label to show an accesskey, and each has a window-level keyboard shortcut. Their hidden B and F collided with Bookmark Link and Full Screen.

The toolbar button messages get new ids only because they reference the renamed context menu messages.

Attachment #9649617 - Attachment description: Bug 2073889 - Don't require an accesskey on a menuitem without a label. r?#reusable-components-reviewers → Bug 2073889 - Don't require an accesskey on a menuitem without a label. r?#firefox-desktop-core-reviewers
Attachment #9649617 - Attachment description: Bug 2073889 - Don't require an accesskey on a menuitem without a label. r?#firefox-desktop-core-reviewers → Bug 2073889 - Don't require an accesskey on a menuitem without a label. r?#reusable-components-reviewers
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/25e86fd80bf7 https://hg.mozilla.org/integration/autoland/rev/f5cd3532a831 Don't require an accesskey on a menuitem without a label. r=tgiles,reusable-components-reviewers https://github.com/mozilla-firefox/firefox/commit/d599e23ea939 https://hg.mozilla.org/integration/autoland/rev/c354e669619e Drop the accesskeys of the content context menu's navigation items. r=firefox-desktop-core-reviewers ,fluent-reviewers,places-reviewers,daisuke,flod,mossop https://github.com/mozilla-firefox/firefox/commit/e15fa23b0c09 https://hg.mozilla.org/integration/autoland/rev/3f335ab3036f Skip the accesskey check on a menu that macOS shows natively. r=reusable-components-reviewers,akulyk
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: