Re: [w3c/webcomponents] Algorithms in 6.3. Sequential Focus Navigation are too complex (#496)

Am I correct in thinking that the spec says that *only* assigned nodes of a slot (not descendants, i.e. fallback content) are within a new scope? (See 6.3 Sequential Focus Navigation, Step 2, 2.1.4. "4. If CURRENT is a slot element and ..." for the section that I think defines this.)

I don't know if this is really a concern or not, but it seems odd that slot fallback content doesn't also get put into a separate scope. Particularly, this means that elements can be 'inserted' into the surrounding sequential focus order when a slot doesn't have fallback content.

For example, if all `x-custom` elements host a ShadowRoot containing:
```html
<input id="shadow-input-A" tabindex="1">
<input id="shadow-input-B" tabindex="3">
<slot tabindex="4">
  <input id="shadow-slot-input-A" tabindex="2">
  <input id="shadow-slot-input-B" tabindex="6">
</slot>
<input id="shadow-input-C" tabindex="5">
<input id="shadow-input-D" tabindex="7">
```

And two `x-custom` elements exist with this structure:
```html
<x-custom id="x-custom-A">
  <input id="light-input">
</x-custom>
<x-custom id="x-custom-B"></x-custom>
```

Then the sequential focus order of `#x-custom-A` and all descendants will be:

`#shadow-input-A`, `#shadow-input-B`, **`#light-input`**, `#shadow-input-C`, `#shadow-input-D`

And the sequential focus order of `#x-custom-B` and all descendants will be:

`#shadow-input-A`, **`#shadow-slot-input-A`**, `#shadow-input-B`, `#shadow-input-C`, **`#shadow-input-slot-B`**, `#shadow-input-D`

I don't have a real use case in favor of or against either behavior but this feels inconsistent at first glance. (Although, it does reduce the number of things that create focus scopes.) If anyone has any corrections to what I've written here / opinions on this behavior / if this is a known and intended side effect, I'd be interested to hear.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/496#issuecomment-228180483

Received on Thursday, 23 June 2016 20:54:26 UTC