This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27965 - [Shadow]: Shadow host with tabindex=-1, all descendent tree should be ignored for tab navigation
Summary: [Shadow]: Shadow host with tabindex=-1, all descendent tree should be ignored...
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords: a11y_focus
Depends on:
Blocks: 28552
  Show dependency treegraph
 
Reported: 2015-02-05 07:51 UTC by Takayoshi Kochi
Modified: 2015-05-27 03:06 UTC (History)
5 users (show)

See Also:


Attachments

Description Takayoshi Kochi 2015-02-05 07:51:29 UTC
In the current Shadow DOM spec, basically focusable nodes in a shadow tree are inserted after their shadow host in the tab navigation order.

This means that when shadow host has "tabindex=-1", the host itself is skipped in the order, but right after the host the descendant nodes in its shadow tree will be visited.

This is probably not the behavior that a component author or user would expect.
Comment 1 Charles McCathieNevile 2015-02-19 06:00:33 UTC
I'm not immediately clear why this would be unexpected...

A couple of scenarios:

- A date picker should have a tabindex at its root, so this doesn't arise.

- A sound mixer may well begin with a bunch of non-interactive material, and be the main component on a page. So it seem logical that it doesn't have a tabindex at the root (although it might well be a landmark, in screen reader navigation terms).

Am I missing something obvious? (That seems quite possible)
Comment 2 Takayoshi Kochi 2015-02-26 06:10:12 UTC
Let me explain an example.

Suppose I have an component (which is out of control of mine)
2 focusables contained in a shadow.

<login-extras>
 |#shadow-root
 | <input type=checkbox> save cookie
 | <a href="http://example.com/help">Help</a>
</login-extras>

I put it in some form:

<form>
 Name: <input>
 Password: <input type=password>
 <login-extras></login-extras>
 <input type=submit value="login">
</form>

And want to skip <login-extra> for typical cases, only require
name and password then user can hit login button.
So I put tabindex=-1 in <login-extras>

<form>
 Name: <input>
 Password: <input type=password>
 <login-extras tabindex=-1></login-extras>
 <input type=submit value="login">
</form>

Actually, this doesn't skip the checkbox and help link.
Demo: http://jsfiddle.net/4y3xntx8/
Comment 3 Charles McCathieNevile 2015-02-26 10:43:04 UTC
Thanks for the example.

I *think* the general idea makes sense - changing the shadow root's tabindex should apply to whatever is in the component.

There is an analagous situation in aria. I'll have a look what they say, but I suspect their answer will be "build JS that manages this", which doesn't really help in this caseā€¦

(There is a problem with the example: the functionality inaccessible for keyboard. The normal interaction pattern would be to fill in the things you want, then hit enter to submit the form.)
Comment 4 Hayato Ito 2015-05-27 03:06:43 UTC
Moved to https://github.com/w3c/webcomponents/issues/86