Re: [whatwg] Should enter be mapped to click?

2008-12-16 Thread Ian Hickson
On Tue, 15 Jul 2008, Anne van Kesteren wrote:
 On Tue, 15 Jul 2008 09:50:25 +0200, Ian Hickson i...@hixie.ch wrote:
  On Mon, 14 Jul 2008, Aaron Leventhal wrote:
   
   Now that tabindex can be used on any element to make it focusable, it
   makes sense that it should be possible to trigger a click on those
   elements with the keyboard.
   
   Opera maps Enter to click. As far as I know, other browsers only do that
   for a few elements likea.
   
   What do people think? Should it be spec'd?
  
  3.4.1.7. Interactive content, paragraph 3:
  
  | When activation is performed via some method other than clicking the
  | pointing device, the default action of the event that triggers the
  | activation must, instead of being activating the element directly, be to
  | fire a click event on the same element.
 
 Last I checked that doesn't say each focusable element actually gets
 activation behavior as well. Here's an example:
 
   div tabindex=0 onclick=alert(0)TEST/div
 
 The specification states that only certain elements are interactive 
 content, not everything that's focusable.

Fixed.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] Should enter be mapped to click?

2008-07-15 Thread Ian Hickson
On Mon, 14 Jul 2008, Aaron Leventhal wrote:

 Now that tabindex can be used on any element to make it focusable, it 
 makes sense that it should be possible to trigger a click on those 
 elements with the keyboard.
 
 Opera maps Enter to click. As far as I know, other browsers only do that 
 for a few elements likea.
 
 What do people think? Should it be spec'd?

3.4.1.7. Interactive content, paragraph 3:

| When activation is performed via some method other than clicking the 
| pointing device, the default action of the event that triggers the 
| activation must, instead of being activating the element directly, be to 
| fire a click event on the same element.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] Should enter be mapped to click?

2008-07-15 Thread Aaron Leventhal



3.4.1.7. Interactive content, paragraph 3:
   

Thanks! Small typo:
instead of being activating the element directly,
Extra word being

- Aaron



Re: [whatwg] Should enter be mapped to click?

2008-07-15 Thread Anne van Kesteren

On Tue, 15 Jul 2008 09:50:25 +0200, Ian Hickson [EMAIL PROTECTED] wrote:

On Mon, 14 Jul 2008, Aaron Leventhal wrote:


Now that tabindex can be used on any element to make it focusable, it
makes sense that it should be possible to trigger a click on those
elements with the keyboard.

Opera maps Enter to click. As far as I know, other browsers only do that
for a few elements likea.

What do people think? Should it be spec'd?


3.4.1.7. Interactive content, paragraph 3:

| When activation is performed via some method other than clicking the
| pointing device, the default action of the event that triggers the
| activation must, instead of being activating the element directly, be  
to

| fire a click event on the same element.


Last I checked that doesn't say each focusable element actually gets  
activation behavior as well. Here's an example:


  div tabindex=0 onclick=alert(0)TEST/div

The specification states that only certain elements are interactive  
content, not everything that's focusable.




--
Anne van Kesteren
http://annevankesteren.nl/
http://www.opera.com/


Re: [whatwg] Should enter be mapped to click?

2008-07-14 Thread Anne van Kesteren
On Mon, 14 Jul 2008 11:03:23 +0200, Aaron Leventhal [EMAIL PROTECTED]  
wrote:
Now that tabindex can be used on any element to make it focusable, it  
makes sense that it should be possible to trigger a click on those  
elements with the keyboard.


Opera maps Enter to click. As far as I know, other browsers only do that  
for a few elements likea.


What do people think? Should it be spec'd?


Yes :angel:

Seriously though, I think it makes sense that focusable elements have  
activation behavior and that you can trigger that by both the keyboard and  
mouse.



At least the spec should say what elements map enter to click now.  
Except for perhapstextarea  and a few form controls, I don't see why  
some should and others not, though. Maybe it should be a blacklist?


I'm not sure it should go further then suggesting Enter to be the key  
for performing form submission, etc. After all, there's a lot of clients  
out there without an Enter key.



--
Anne van Kesteren
http://annevankesteren.nl/
http://www.opera.com/