Open Bug 438306 Opened 16 years ago Updated 2 years ago

Accesskey doesn't work when put on both label and its checkbox or radio button

Categories

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

defect

Tracking

()

People

(Reporter: 326374, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: regression)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; sv-SE; rv:1.9) Gecko/2008053008 Firefox/3.0
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; sv-SE; rv:1.9) Gecko/2008053008 Firefox/3.0

If you put an accesskey on both a label and its corresponding checkbox or radio button it isn't triggered (given that it's the same accesskey).

If you only have one accesskey (i.e. only on the label or only on the form element) tt works as expected if you just have one accesskey.

Reproducible: Always

Steps to Reproduce:
Go to the example page (http://internetvision.se/dan/projekt/firefox/fx-bug.htm) and try it.



I'm listing this as a major feature broken since some (minor) functionality in sites like wikipedia.org is gone because of it.

I'm using Firefox 3 RC2 on Mac OS X.
Dan, can you give us an example where in the real world this breaks stuff? Also, is this at all valid HTML since accesskeys, by definition, should not be the same on two elements?
You'd need to log in to wikipedia.org, and then go to http://en.wikipedia.org/w/index.php?title=ASDF&action=edit. Labels for "minor edit" and "watch page" are broken (accesskeys are "i" and "w").
I'd be surprised if it's not fairly common to have two accesskeys – it feels like it would be safer to have two accesskeys than one – and it worked in Fx 2, so I don't see why you'd remove that functionality.

Intuitively I think it ought to work.

W3C on accesskeys: http://www.w3.org/TR/html401/interact/forms.html#h-17.11.2
As far as I can tell they don't say anything about *not* supporting it.

Furthermore Firefox 3 already supports multiple accesskeys in one aspect: http://en.wikipedia.org/wiki/Main_Page
There are two links for the access key "z", and Firefox handles it just great.
The last paragraph of that section contains the sentence "We recommend that authors include the access key in label text or wherever the access key is to
apply." I read this as putting it on the label if there is one, and on the input type if there's no associated label (e. g. a button). To avoid disambiguity, I would always want to avoid double access keys on a single page.

I also tried your example in IE: The access keys for a and d are completely omitted in IE 7.

The most important factor for me is that this worked in Firefox 2 and broken in 3. Nominating it for blocking a maintenance release based on that.
Flags: blocking1.9.0.1?
Status: UNCONFIRMED → NEW
Ever confirmed: true
The W3C paragraph isn't very clear. The word "include" doesn't imply that you must exclude it somewhere else, even if you may (is my interpretation).

Not that it's particularly important, but... a reason to include the accesskey on both is that e.g. Opera (9.20) doesn't understand accesskeys on labels. Camino (1.5) handles all three, and so does Safari (3.1).
Keywords: regression
Testing on Linux (Ubuntu) I notice that the bug is there too, so I'm changing hardware/OS to all.
OS: Mac OS X → All
Hardware: Macintosh → All
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.1?
Flags: blocking1.9.0.1-
Component: Keyboard Navigation → Keyboard: Navigation
Product: Firefox → Core
QA Contact: keyboard.navigation → keyboard.navigation
Component: Keyboard: Navigation → User events and focus handling

Hi Dan
Would you be so kind to let us know if this problem keeps happening? I was trying to access the link in the description but it was removed.
Thanks!

Flags: needinfo?(326374)
Attached file Example HTML

I've attached an HTML file to reproduce the issue.

The Firefox bug is still there. It's not an issue on Wikipedia, since they removed the duplicate accesskey many years ago.

Flags: needinfo?(326374)

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --

This is still an issue. It works as expected in comment 0 in both Chrome and Safari.

The test case works as expected if either element have accesskey, but not if both do.

Severity: -- → S3

The relevant code are in https://searchfox.org/mozilla-central/rev/2809416b216b498ec3d8b0e65c25a135f4f5f37d/dom/events/EventStateManager.cpp#1152. If there are multiple elements have same accesskey, we allow user to cycle between them, instead of activation one of them. Chrome and Safari activate the last or first, AFAIK, https://github.com/whatwg/html/issues/4385. Maybe we could do some optimization for the case that the label and its labeled control has the same accesskey.

Blocks: 1797214
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: