Closed Bug 260605 Opened 20 years ago Closed 20 years ago

Registering new accesskey should clear old entry for same element

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

References

Details

(Keywords: helpwanted)

Attachments

(1 file)

327 bytes, application/vnd.mozilla.xul+xml
Details
When an accesskey changes dynamically via JavaScript, the old accesskey for that
element should no longer work to trigger it.
Attached file Testcase
Press Alt+Q to trigger checkbox.
After that, the accesskey is changed to 'B'
Alt+B works now, but so does Alt+Q which shoudln't.

The problem is that esm:RegisterAccessKey() doesn't look for the element in the
hash table and just change that entry if it exists. It adds another entry
pointing to the same element. It would require doing a hash table lookup by key
rather than value.

UnregisterAccesskey doesn't help because it isn't called. By the time
AttributeChanged() knows to call RegisterAccessKey the old accesskey value is
gone.
Keywords: helpwanted
Isn't this a matter of having SetAttr() unregister the accesskey before setting
the attribute (the way this is done for HTML)?
Attachment #159492 - Attachment is patch: false
Attachment #159492 - Attachment mime type: text/plain → application/xul
Attachment #159492 - Attachment mime type: application/xul → application/vnd.mozilla.xul+xml
I was wrong about several things:
- Unregistering does work, just not when the accesskey is stored on an anonymous
label such as for a radio button or checkbox
- It's handled in nsXULElement::SetAttr() and nsXULElement::UnregisterAccessKey()

Patch in bug 260527 fixes this.
Depends on: 260527
Fixed by checkin to bug 260527
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: