W3C home > Mailing lists > Public > www-svg@w3.org > June 2010

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

From: Erik Dahlstrom <ed@opera.com>
Date: Mon, 28 Jun 2010 11:23:19 +0200
To: www-svg@w3.org
Message-ID: <op.vez602v0geuyw5@localhost>
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:45 GMT