Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default tab index of object should be -1 #4841

Closed
rniwa opened this issue Aug 16, 2019 · 5 comments
Closed

The default tab index of object should be -1 #4841

rniwa opened this issue Aug 16, 2019 · 5 comments
Assignees
Labels
interop Implementations are not interoperable with each other topic: focus

Comments

@rniwa
Copy link

rniwa commented Aug 16, 2019

#4759 made object element's default tab index 0 on the basis that both Firefox & Chrome do this.

However, this isn't true. Only Chrome uses the default tab index of 0 on object elements. Both WebKit and Firefox use the default tab index of -1 on object elements.

Given this, we'd like to keep WebKit's current behavior of not having a special case for object elements.

@rniwa
Copy link
Author

rniwa commented Aug 16, 2019

@rakina @domenic @annevk

@annevk annevk added interop Implementations are not interoperable with each other topic: focus labels Aug 16, 2019
@domenic
Copy link
Member

domenic commented Aug 19, 2019

In https://boom-bath.glitch.me/tabindex.html the object columns are 0 in both Chrome and Safari.

@rniwa
Copy link
Author

rniwa commented Aug 19, 2019

@domenic : That's because the object element in the document and therefore considered as focusable. That's akin to how an element ends up getting tabIndex of 0 if it's an editing host because it's considered focusable in WebKit. A better test of the default tab index is to create an element and don't insert it into anywhere in the document and check the value of tabIndex as in: document.createElement('object').tabIndex. This expression would return -1 in WebKit and Firefox and 0 in Chrome.

Since the goal of #1786 is to make tabIndex IDL attribute reflect tabindex content attribute, we shouldn't be taking such an effect (whether an element is focusable or not) into account when computing the value of tabIndex IDL attribute.

@domenic
Copy link
Member

domenic commented Aug 19, 2019

I agree we shouldn't be taking such things into effect.

However, when determining what the default is, I'm not sure whether we should be governed by the out-of-document case, or the in-document case. It seems like web developers are more likely to encounter the in-document case, so if we were to align with "the majority of behaviors web developers encounter" during our simplification, 0 seems like a better choice.

@rniwa
Copy link
Author

rniwa commented Aug 20, 2019

Fair enough. Also see #4855

@rniwa rniwa closed this as completed Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: focus
Development

No branches or pull requests

3 participants