W3C home > Mailing lists > Public > www-style@w3.org > February 2015

[css3-ui][selectors] :focus and nav-* interaction

From: Florian Rivoal <florian@rivoal.net>
Date: Fri, 13 Feb 2015 16:18:16 +0900
Message-Id: <4BB26872-D5F2-4F76-B741-E5087FBFD6EA@rivoal.net>
Cc: Tantek Çelik <tantek@cs.stanford.edu>
To: www-style list <www-style@w3.org>
(Logged as issue 78 against CSS3-UI)

Selectors 4 states:

  There may be document language or implementation specific
  limits on which elements can acquire :focus. For example,
  [HTML5] defines a list of activatable elements.

Selectors 3 has similar language:

  There may be document language or implementation specific
  limits on which elements can become :active or acquire :focus.

Using the 'nav-up', 'nav-down', 'nav-left' and 'nav-right' properties defined in css3-ui, it is possible for elements which would otherwise be excluded by this limits to become focusable.

It seems reasonable that if such an element is made focusable by the nav-* properties, and is actually focused, the :focus selector should match. This is what Presto does, as you can check here (use opera 12, and use shift + arrows to control spatial navigation):

http://jsbin.com/newage/1/watch?html,css,output

I don't think this is in contradiction with current specs, but there are many levels of indirection and definitions to follow through in both CSS and the HTML specs to determine this, so a clarification in css3-ui would be useful.

I propose adding this to css3-ui:

"If an element that is otherwise not focusable becomes focusable through the use of the directional focus navigation properties, the :focus pseudo-class matches this element when it is focused."

If anyone thinks this is actually incorrect, please let me know.

 - Florian
Received on Friday, 13 February 2015 07:18:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC