[Forms] Default selection of select(menulist) should not be disabled
https://bugs.webkit.org/show_bug.cgi?id=74270
Patch by Yosifumi Inoue <yosin@chromium.org> on 2011-12-13
Reviewed by Kent Tamura.
Source/WebCore:
This patch changes default selection of select(menulist) element to
1. Selected option element. If there are multiple options which have
selected state, we pick the largest index option up. (same as current)
2. Non-disabled option element (new behavior)
3. The first option if all options are disabled. (new behavior)
Tests: fast/forms/select/menulist-disabled-option-expected.html
fast/forms/select/menulist-disabled-option.html
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcListItems): Implement new logic for selection.
LayoutTests:
basic-selects.html will fail because select element displays disabled
option element "foo" at index 0 as default selection. This should be
non-disabled option "bar" at index 1.
menulist-disabled-option-expected.html checks default selection of
select(menulist) with disabled option element.
* fast/forms/select/menulist-disabled-option-expected.html: Added.
* fast/forms/select/menulist-disabled-option.html: Added.
* platform/chromium/test_expectations.txt: Add fast/forms/basic-selects.html
* platform/gtk/test_expectations.txt: Add fast/forms/basic-selects.html
* platform/mac/test_expectations.txt: Add fast/forms/basic-selects.html
* platform/qt/test_expectations.txt: Add fast/forms/basic-selects.html
* platform/win/test_expectations.txt: Add fast/forms/basic-selects.html
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
10 files changed