Open Bug 603200 Opened 10 years ago Updated 2 years ago

make accesskey works on all activable elements and keyboard click simulation with enter button

Categories

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

x86
Windows 7
defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: giorgio.liscio, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101009 Firefox/4.0b8pre
Build Identifier: 

hi, i think accesskey should works in all activable elements... its important to make html5 custom-widgets accessible...

but i don't know what newest specs says but in this example the <b> element do not receive the activation ("click" event dispatch) by

1 - accesskey, alt + maiusc + b
2 - enter keyboard button when focused

<b accesskey="b" onclick="alert('hi');" tabindex="0">hi</b>

but these works good:

<button accesskey="c" onclick="alert('hi');" tabindex="0">hi</button>
<a accesskey="d" onclick="alert('hi');" tabindex="0">hi</a>



Reproducible: Always
> but i don't know what newest specs says

For elements that don't "define a command" (such as this case) it says:

  1)  If the element is focusable, run the focusing steps for the element.
  2)  If the element has a defined activation behavior, run synthetic click
      activation steps on the element.
  3)  Otherwise, if the element does not have a defined activation behavior, fire
      a click event at the element.
hi boris,

"element has a defined activation behavior" == element has a "click" event listener 

?

what is the meaning of "activation behavior" according to the spec?
As per the below spec
https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
https://html.spec.whatwg.org/multipage/interaction.html#activation-behaviour

the elements having tab index attribute are focusable and if it does not otherwise have an activation behavior defined has an activation behavior that does nothing. 
This means that an element that is only focusable because of its tabindex attribute will fire a click event in response to a non-mouse activation (e.g. hitting the "enter" key while the element is focused).

From the spec it looks like even if the element has empty activation behavior, if it if focusable because of tab index attribute click event is fired on pressing enter key.
Can someone please update whether firefox is interested in implementing this behavior? (Sending simulated click on keypress of enter key)
Component: Keyboard: Navigation → User events and focus handling
You need to log in before you can comment on or make changes to this bug.