Bug 159682

Summary: <label>'s dont care about disabled widgets
Product: [Applications] konqueror Reporter: Emil Sedgh <emilsedgh>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Severity: normal CC: andresbajotierra, maksim, vasko_dinkov
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Emil Sedgh 2008-03-22 11:46:57 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

I have a disabled text input:
<input id='foo' disabled='disabled' type='text' name='bar'>

and a label for it:
<label for='foo'>Foo</label>

when i click on the text box, it will refuse to get the focus and its not writable(as expected).But if you click on its label, the text input will get the focus and you could write in it, which is bad because the textbox should be disabled and readonly.
(first i thought its a oxygen style bug, but i tried id with plastique widget style too)
Comment 1 Dario Andres 2008-08-01 03:54:29 UTC
Using KDE 4.1.00 (KDE 4.1.0) (KDEmod) in ArchLinux i686:
I can reproduce this bug with the "text" input and with the "textarea" tag.
Comment 2 Dario Andres 2008-08-19 18:29:44 UTC
I can also reproduce this bug using:
Version 4.1.62 (KDE 4.1.62 (KDE 4.2 >= 20080814))
kdelibs4.2 svn rev.849324
kdebase4.2 svn rev.849337
ArchLinux 2.6.25-zen2-20080814 i686 
Comment 3 Maksim Orlovich 2008-08-22 19:00:19 UTC
This is actually a little more generic then that, since one can .focus() 
disabled things:

function test() {
  var inp = document.getElementById("inp");


<body onload="test()">
<input id='inp' disabled='disabled' type='text'>

... so that needs fixing as well. I bet click() of a disabled button 
does something similar, too.

Comment 4 Maksim Orlovich 2008-08-22 19:19:26 UTC
Oy, that's actually worse than I thought, since one can disable a focused element, etc. Needs further thought.
Comment 6 Dario Andres 2008-12-13 13:38:05 UTC
Look at bug 177668 for another steps(testcase) to reproduce bugs using disabled controls and labels (3.5.10 and 4.1.80) 
Comment 7 Dario Andres 2009-02-06 23:44:14 UTC
*** Bug 177668 has been marked as a duplicate of this bug. ***
Comment 8 Stas Verberkt 2009-02-15 01:28:50 UTC
SVN commit 926297 by sverberkt:

Don't let labels fire click events on disabled objects.

 M  +1 -1      html_formimpl.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=926297
Comment 9 Maksim Orlovich 2009-03-21 16:16:11 UTC
SVN commit 942329 by orlovich:

Merged revision 926297:r926297 | sverberkt | 2009-02-14 19:28:49 -0500 (Sat, 14 Feb 2009) | 3 lines

Don't let labels fire click events on disabled objects.

 M  +1 -1      html_formimpl.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=942329
Comment 10 David Faure 2009-10-08 17:11:50 UTC
SVN commit 1032808 by dfaure:

Allow to focus readonly form elements (like other browsers do, partial revert of the commits for 159682),
which makes it possible to copy their text, too (for tomj on irc).
On the other hand, don't allow Ctrl+X and Ctrl+V to work in such widgets.
Will backport for 4.3.3.
BUG: 203069
CCBUG: 159682

 M  +1 -1      html/html_formimpl.cpp  
 M  +18 -12    khtml_ext.cpp  
 M  +2 -2      rendering/render_form.cpp  

WebSVN link: http://websvn.kde.org/?view=rev&revision=1032808