[whatwg] accesskey attribute with display:none elements

Olli Pettay Olli.Pettay at helsinki.fi
Tue Nov 25 11:57:25 PST 2008


Hi all,

currently it isn't specified anywhere (AFAIK) what should happen
if the element which has an accesskey attribute is hidden using
display:none.

HTML4 says the following:
"Pressing an access key assigned to an element gives focus to the element. The action that occurs when an element 
receives focus depends on the element. For example, when a user activates a link defined by the A element, the user 
agent generally follows the link..."
The problem is that focusing and activating isn't the same thing.

FF2, Safari 3.x and Opera 9.6 can activate display:none accesskey targets.
FF3 changed the behavior to require visible and focusable element.
IE7 doesn't seem to activate, only focus (at least <a> elements), and
because hidden element isn't really focusable, it doesn't seem to do anything
with elements with display:none.

A simple testcase https://bugzilla.mozilla.org/attachment.cgi?id=339588

I think allowing hidden elements to be activated is useful for web apps,
especially because there isn't any API to add listeners for accesskey activation.
(Key event listeners could do something similar, but they'd need to handle all the different
browsers and OSes.)
So I prefer what FF2, Safari and Opera do, and would like to change FF3.1 to work
the same way.

Anyway, I hope some behavior could be standardized.

Comments?

br,

-Olli



More information about the whatwg mailing list