Bug 22202 - Would like “disabled” attribute to work on non-form elements
Summary: Would like “disabled” attribute to work on non-form elements
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 02:42 PST by Johan Lund
Modified: 2012-03-11 23:24 PDT (History)
9 users (show)

See Also:


Attachments
Simple html illustrating outline shown on disabled elements (110 bytes, text/html)
2008-11-12 02:46 PST, Johan Lund
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Lund 2008-11-12 02:42:24 PST
I have 2 divs with tabIndex=1 and one of them is disabled.
If I tab to the disabled element it displays a focus outline.
This is not the case in e.g. Firefox.
Comment 1 Johan Lund 2008-11-12 02:46:07 PST
Created attachment 25093 [details]
Simple html illustrating outline shown on disabled elements
Comment 2 Antaryami Pandia (apandia) 2012-02-13 02:45:00 PST
Adding some webkit reviewers.

The main issues is that webkit focuses element, even if its disabled. I modified the attached test case to verify it:-

<html><head>
<script type="text/javascript">
function setStyle() {
document.getElementById("div1").style.background="yellow"; }

function setStyle1() {
document.getElementById("div2").style.background="red"; }
</script></head>

<body>
<div id="div1" tabIndex="1" onfocus="setStyle()">123456</div >
<div id="div2" tabIndex="1" disabled="true" onfocus="setStyle1()">abcdefg</div >
</body></html>

Currently the disabled attribute is supported only for form control elements. It seems firefox supports "disabled" attributes for all html tags.

1. Is the current webkit behavior is inteded one?
2. Should we support "disabled" attribute for elements other than form controls?

Please provide feedback.
Comment 3 Antaryami Pandia (apandia) 2012-02-16 02:53:42 PST
Please provide some feedback.
Comment 4 Eric Seidel (no email) 2012-02-16 08:06:42 PST
http://www.whatwg.org/specs/web-apps/current-work/#attr-fe-disabled

disabled only appears to affect form elements.
Comment 5 Darin Adler 2012-02-16 09:34:17 PST
If disabling is applied to other types of elements by Firefox, then that’s an extension, not something from the current HTML standards. If we think that’s a desirable feature I suggest we bring it with other folks working on the HTML standard at W3C.

I don’t think this is a feature that’s so compelling that we’d want to do it without first discussing it with the others.
Comment 6 Antaryami Pandia (apandia) 2012-02-16 21:55:51 PST
Thanks Eric, Darin for the feedback.

I was of the same opinion, since disabled attribute affects only form control elements.

Actually the issue was logged as an outline issue, but I found that the issue is with disabled attribute being used with a non-form control element (darin has also updated the title of the issue). Thats the precise reason I asked the feedback of yours, as its not according to spec and also a feature which may not be of that much interest to a web developer.
Comment 7 Ryosuke Niwa 2012-02-16 22:42:51 PST
Also, can we instead talk with Mozilla folks and see they can drop "disabled" content attribute support on non-from-control elements?
Comment 8 Antaryami Pandia (apandia) 2012-02-16 22:59:20 PST
(In reply to comment #7)
> Also, can we instead talk with Mozilla folks and see they can drop "disabled" content attribute support on non-from-control elements?

So should I log a bug at Mozilla bugzilla or talk on Mozilla dev channel.What would you recommend.
Comment 9 Ryosuke Niwa 2012-02-16 23:04:29 PST
(In reply to comment #8)
> (In reply to comment #7)
> > Also, can we instead talk with Mozilla folks and see they can drop "disabled" content attribute support on non-from-control elements?
> 
> So should I log a bug at Mozilla bugzilla or talk on Mozilla dev channel.What would you recommend.

Asking on #developer might work.
Comment 10 Antaryami Pandia (apandia) 2012-02-22 22:28:31 PST
I had sent a mail to mozila dev forum and as suggested logged a bug in firefox.

https://bugzilla.mozilla.org/show_bug.cgi?id=729845

Also I think we can close this issue as this is the expected behavior.
Comment 11 Mounir Lamouri 2012-03-08 07:35:35 PST
(In reply to comment #0)
> I have 2 divs with tabIndex=1 and one of them is disabled.
> If I tab to the disabled element it displays a focus outline.
> This is not the case in e.g. Firefox.

This is a bug in Gecko/Firefox and we going to fix that. I guess this bug could be marked as WONTFIX.
Comment 12 Antaryami Pandia (apandia) 2012-03-11 22:49:19 PDT
It seems I can't close this issue.
Request someone with the privilege to close the issue.
Comment 13 Ryosuke Niwa 2012-03-11 23:24:13 PDT
Gecko no longer supports disabled attribute on non-form control elements. Closing the bug as wontfix.