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 16018 - Exclude disabled form controls from specially focusable elements.
Summary: Exclude disabled form controls from specially focusable elements.
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
Depends on:
Reported: 2012-02-17 17:36 UTC by contributor
Modified: 2012-11-01 23:07 UTC (History)
5 users (show)

See Also:


Description contributor 2012-02-17 17:36:44 UTC

Exclude disabled form controls from specially focusable elements.

Posted from: by
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22
Comment 1 Kang-Hao (Kenny) Lu 2012-02-17 17:46:05 UTC
This paragraph doesn't exclude disabled form controls that have tabindex specified. In the following test case "onfocus" doesn't appear in IE9, Firefox 10, Safari 5 and Chromium 18

data:text/html,<!DOCTYPE html><textarea tabindex="0" disabled onfocus='document.write("onfocus");'>CLICK</textarea><script>document.querySelector('textarea').focus()</script>

(Opera12alpha is a bit special but that has nothing to do with 'tabindex'. It fires the 'focus' event for disabled form controls when focus() is called, which is not following the spec.)

I think in general this paragraph should exclude all elements :disabled matches. Test case:

data:text/html,<!DOCTYPE html><fieldset disabled><textarea tabindex="0" onfocus='document.write("onfocus");'>CLICK</textarea></fieldset><script>document.querySelector('textarea').focus()</script>

Firefox follows my expectable but IE9 and WebKit browsers don't. That's because they don't implement 'disabled' on <fieldset>.
Comment 2 contributor 2012-07-18 16:20:00 UTC
This bug was cloned to create bug 18065 as part of operation convergence.
Comment 3 Ian 'Hixie' Hickson 2012-08-29 03:33:19 UTC
So what I need to do here is factor out the :disabled list into a reusable term "disabled element", label the current list of what makes something by-default focusable the "suggested focusable elements", remove all the stuff about "disabled" in the current definition of the "suggested focusable elements", then in the definition of "focusable" refer to the "suggested focusable elements" instead of the platform conventions, and then add an explicit filter to remove the "disabled elements".
Comment 4 contributor 2012-11-01 23:07:09 UTC
Checked in as WHATWG revision r7498.
Check-in comment: Another attempt at defining tabindex, :disabled, what can be focused, etc.