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 18995 - Snippet: "The tabIndex IDL attribute must reflect the value of the tabindex content attribute. Its default value is 0 for elements that are focusable and −1 for elements that are not focusable." Comment: Default value of -1 for the tabIndex IDL attribute
Summary: Snippet: "The tabIndex IDL attribute must reflect the value of the tabindex c...
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 22:58 UTC by contributor
Modified: 2012-10-12 20:06 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-09-24 22:58:23 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html
Multipage: http://www.whatwg.org/C#negative-tabindex
Complete: http://www.whatwg.org/c#negative-tabindex

Comment:
Snippet: "The tabIndex IDL attribute must reflect the value of the tabindex
content attribute. Its default value is 0 for elements that are focusable and
−1 for elements that are not focusable." Comment: Default value of -1 for
the tabIndex IDL attribute of non-focussable elements appears wrong because a
-1 value of the content-attribute (per the spec.) causes the tabindex focus
flag to be set which should cause the element to be focussable if it was being
rendered. In this situation the IDL value would have to reflect the
content-attribute -1 even while the element was focussable.

Posted from: 24.4.130.88
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Comment 1 Ian 'Hixie' Hickson 2012-10-12 17:44:17 UTC
What would you suggest it return instead? What do browsers do?
Comment 2 Sumeet 2012-10-12 20:06:38 UTC
Hello Ian,
   Ah, I realize that you are trying to document what is actually happening the browsers and not necessarily how things should be. After your comment I checked the value of tabIndex on div elements (I verified that they didn't have a tabIndex attribute on them) on the 4 browsers and here's what I found:

1. Chrome (22) : tabIndex = -1.
2. Safari (5.15): tabIndex = -1
3. Firefox (12.0): tabindex = -1
4. IE (19): tabIndex = 0 !!

So except for IE 9 the other three do what the spec. says. I am assuming that IE 10 will fix that. In any case, this just corroborates the issue that I was alluded to earlier, that there is no way for a script to tell whether the -1 value means that the element is non-focussable or whether it is focussable but not tabbable (this situation would occur if the tabindex content-attribute was set to value -1). This is an API design issue - I'm not sure whether this is the right place to bring it up. My apologies if it isn't.

Best Regards,
Sumeet Singh