Bug 76489 - [test case] OPTION element can not be disabled
Summary: [test case] OPTION element can not be disabled
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml forms (show other bugs)
Version: 3.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 93586 116109 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-01 11:25 UTC by Dominic Chambers
Modified: 2012-01-13 06:47 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test Case (80 bytes, text/html)
2004-03-01 11:26 UTC, Dominic Chambers
Details
Unfinished patch (6.51 KB, patch)
2007-01-07 17:59 UTC, Vincent Ricard
Details
Fix option and optgroup (7.07 KB, patch)
2007-05-05 22:50 UTC, Vincent Ricard
Details
Patch updated for trunk (7.28 KB, patch)
2009-02-21 23:12 UTC, Stas Verberkt
Details
Patch for trunk (7.14 KB, patch)
2009-02-22 00:22 UTC, Stas Verberkt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Chambers 2004-03-01 11:25:39 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Unlisted Binary Package
OS:          Linux

Adding the disabled property for the option element has no effect -- the option can still be selected. The HTML spec says this should not be allowed <http://www.w3.org/TR/html4/interact/forms.html#h-17.6>. For example:

  <select>
    <option>enabled</option>
    <option disabled>disabled</option>
  </select>

allows both options to be selected (see test case).

This appears to be a regression since a resolved bug #61347 talks about this previously being a problem when setting by script, yet now it doesn't work at all.
Comment 1 Dominic Chambers 2004-03-01 11:26:45 UTC
Created attachment 4955 [details]
Test Case

Only the first option should be selectable.
Comment 2 Dominic Chambers 2004-03-01 14:09:03 UTC
I just noticed that bug #61347 was not solely for javascript as I originally stated, but was the exact same bug I am reporting. I also see that it was resolved quite recently -- 2003-10-24. Is it possible that this fix is in head, but not in KDE 3.2, and this bug is therefore resolved also?
Comment 3 Stephan Kulow 2004-03-01 14:45:06 UTC
if you read #61347 exactly, it's about multiple selections. And there it indeed works
Comment 4 Stephan Kulow 2004-03-02 11:06:38 UTC
the reason it's not implemented for combo boxes is that it's simply not possible with QCombobox. And I'm not sure if this will ever be implemented ;(
Comment 5 Maksim Orlovich 2004-11-19 17:40:40 UTC
*** Bug 93586 has been marked as a duplicate of this bug. ***
Comment 6 Maksim Orlovich 2005-12-22 16:23:19 UTC
*** Bug 116109 has been marked as a duplicate of this bug. ***
Comment 7 rapsys 2006-10-05 23:47:48 UTC
Any hope to see this bug fixed (even if it need a qt patch) ?
Comment 8 Vincent Ricard 2007-01-07 17:59:55 UTC
Created attachment 19158 [details]
Unfinished patch

This is for KDE4, since it's using qt4 and its qabstractitemmodel.
This patch makes "disabled" working for the combobox. The listbox is not yet
ported, because KListBox still uses Q3ListBox, which is not qabstractitemmodel
compliant.
This patch also makes "disabled" working for optgroup (if an optgroup is
disabled, all option children are disabled too).
It's my first patch for kdelibs, and khtml in particular, so i'm not sure it's
the good way, especially about the location (the owner and the name) of the
SelectModel class.
Any comments are welcomed :-)
Comment 9 Vincent Ricard 2007-05-05 22:50:33 UTC
Created attachment 20493 [details]
Fix option and optgroup

This is a possible finished patch (for combobox and listbox). Any comments are
welcomed.
Comment 10 Maksim Orlovich 2007-05-06 02:35:17 UTC
Cool stuff. Too bad I don't know anything about the MV stuff in Qt4... 
Comment 11 Vincent Ricard 2007-05-06 15:43:11 UTC
Unfortunately, KListWidget inherits QListWidget which makes setModel() method private :-( So we can't apply the SelectModel to the listbox (which means there is some duplicated code/logic).

Will we have a kdeified QListView (then we'll be able to put a SelectModel)?
Else, i think some "if (m_useListBox)" could be removed to clean the code a bit, since a big part of updateFromElement() applied only for the listbox now.
Comment 12 Gérard Talbot (no longer involved) 2008-08-30 08:38:41 UTC
Internet Explorer 8 beta 2 which was released 2 days ago now supports option disabled.

Testcase:
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/OptionDisabledSupport.html

There is also a bug entry at bugs.webkit.org to harmonize the way disabled option work in an expanded select in modern and web-standards-compliant browsers:
https://bugs.webkit.org/show_bug.cgi?id=18358

Regards, Gérard
Comment 13 Stas Verberkt 2009-02-21 23:12:50 UTC
Created attachment 31529 [details]
Patch updated for trunk
Comment 14 Stas Verberkt 2009-02-22 00:22:40 UTC
Created attachment 31530 [details]
Patch for trunk

Updated earlier patch for trunk and applied some cosmetic changes.
Comment 15 Gérard Talbot (no longer involved) 2009-06-22 03:27:19 UTC
I have filed bug 197452 for <optgroup disabled> support and requested to have it marked as dependent of this bug.

regards, Gérard
Comment 16 Maksim Orlovich 2010-04-05 00:30:28 UTC
SVN commit 1111139 by orlovich:

- Fix inheritance of disabled from optgroup
- Actually show stuff as properly disabled in listbox mode

... Let's see if combos can be convinced w/o going nuts

BUG: 197452
CCBUG: 76489


 M  +18 -5     render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1111139
Comment 17 Maksim Orlovich 2010-04-05 02:12:53 UTC
SVN commit 1111163 by orlovich:

Fix disabling of optgroups/options in combobx mode as well (also making it unselectable in that mode).

Seems to be nearly perfect, except for not skipping the disabled items when chosing defaults.

CCBUG: 76489


 M  +34 -34    render_form.cpp  
 M  +2 -0      render_form.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1111163
Comment 18 Gérard Talbot (no longer involved) 2010-11-05 15:00:28 UTC
When I try 
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/OptionDisabledSupport.html
and
http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/optgroup-disabled.html
I get expected results with Konqueror 4.5.1 and Konqueror 4.5.3 (Qt: 4.7.0). Thank you Maksim! :)

Dominic, I can not resolve as FIXED this bug report... but you can!

regards, Gérard
Comment 19 Gérard Talbot (no longer involved) 2012-01-13 06:47:34 UTC
Resolving as FIXED