Summary: | disabled property not honored for option tag (testcase) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | michael |
Component: | khtml forms | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
michael
2003-07-17 08:09:43 UTC
we can't gray it out, but we can make it not selectable. Dirk, would you consider the following patch? --- rendering/render_form.cpp 20 Oct 2003 23:42:24 -0000 1.244 +++ rendering/render_form.cpp 22 Oct 2003 11:54:21 -0000 @@ -1015,8 +1015,13 @@ void RenderSelect::updateFromElement() text = QString::fromLatin1(" ")+text; } - if(m_useListBox) - static_cast<KListBox*>(m_widget)->insertItem(text, listIndex); + if(m_useListBox) { + KListBox *l = static_cast<KListBox*>(m_widget); + l->insertItem(text, listIndex); + DOMString disabled = optElem->getAttribute(ATTR_DISABLED); + if (!disabled.isEmpty() && l->item( listIndex )) + l->item( listIndex )->setSelectable( false ); + } else static_cast<KComboBox*>(m_widget)->insertItem(text, listIndex); } Subject: kdelibs/khtml CVS commit by coolo: fixing rendering of disabled select options CCMAIL: 61347-done@bugs.kde.org M +5 -0 ChangeLog 1.51 M +8 -4 rendering/render_form.cpp 1.245 --- kdelibs/khtml/ChangeLog #1.50:1.51 @@ -1,2 +1,7 @@ +2003-10-24 Stephan Kulow <coolo@kde.org> + + * rendering/render_form.cpp (updateFromElement): support disabled attribute + select option (#61347) + 2003-10-24 Lars Knoll <knoll@kde.org> * Make the <button> element work correctly --- kdelibs/khtml/rendering/render_form.cpp #1.244:1.245 @@ -1016,7 +1016,11 @@ void RenderSelect::updateFromElement() } - if(m_useListBox) - static_cast<KListBox*>(m_widget)->insertItem(text, listIndex); - else + if(m_useListBox) { + KListBox *l = static_cast<KListBox*>(m_widget); + l->insertItem(text, listIndex); + DOMString disabled = optElem->getAttribute(ATTR_DISABLED); + if (!disabled.isEmpty() && l->item( listIndex )) + l->item( listIndex )->setSelectable( false ); + } else static_cast<KComboBox*>(m_widget)->insertItem(text, listIndex); } |