Re: Should an element with display="none" take focus?

On Thu, 24 Jun 2010 12:01:51 +0200, Jonathan Chetwynd  
<j.chetwynd@btinternet.com> wrote:

> Should an element with display="none" take focus?
>
> It had been my assumption that whether using script to addEventListener  
> or as in the
> the attached testcase, if display is set to none then the  element  
> should not be focusable.
>
> is this correct?

Yes, "The SVG user agent must not navigate to an element which has  
display="none". (An element which has display="none" is not focusable.)"  
[1].

> To test, open the file in a recent build of Opera and use tabkey to  
> navigate.

Yes, there's a difference between tab navigation and spatial navigation  
(shift + arrowkeys). The latter doesn't go to the display-none element,  
while the former does (that's a bug, thanks for reporting it).

...
> after more than a decade one might  have hoped that more than one UA had  
> an implementation  for focus.

The spec you need to be able to test this reliably is SVG Tiny 1.2, which  
became a recommendation in December 2008. The SVG 1.1 specification is  
rather unspecific when it comes to focus events handling, e.g focusin  
"Occurs when an element receives focus, such as when a ‘text’ becomes  
selected." and in particular says nothing about what display="none" means  
for focusability or even what elements can receive focus.

Cheers
/Erik

[1] http://www.w3.org/TR/SVGTiny12/interact.html#navigationbehaviour

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Monday, 28 June 2010 09:23:54 UTC