Changeset 57714 in webkit
- Timestamp:
- Apr 15, 2010 10:59:15 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57709 r57714 1 2010-04-15 Luiz Agostini <luiz.agostini@openbossa.org> 2 3 Reviewed by Antti Koivisto. 4 5 No default selection for <select multiple> menu lists. 6 https://bugs.webkit.org/show_bug.cgi?id=37530 7 8 Manual test: manual-tests/no-listbox-rendering.html 9 10 For menu lists, if the selection is not indicated by the html file, the first <option> will be 11 selected after loading the page or reseting the form. On the other hand listboxes may have no 12 element selected after loading the page or reseting the form. 13 14 When NO_LISTBOX_RENDERING is enabled listboxes becomes menu lists. Those <select multiple> 15 that did not have selected elements, now being menu lists, will have the first <option> 16 selected. That is the behavior difference that this patch corrects. 17 18 When NO_LISTBOX_RENDERING is enabled usesMenuList() always returns true then usesMenuList() cannot 19 be used to decide about initial selection of the elements. This patch replaces (usesMenuLists()) 20 by (!multiple && size <= 1) where initial selection is considered. 21 22 * dom/SelectElement.cpp: 23 (WebCore::SelectElement::recalcListItems): 24 (WebCore::SelectElement::reset): 25 * manual-tests/no-listbox-rendering.html: Added. 26 1 27 2010-04-15 Zhenyao Mo <zmo@google.com> 2 28 -
trunk/WebCore/dom/SelectElement.cpp
r56180 r57714 271 271 listItems.append(current); 272 272 273 if (updateSelectedStates ) {274 if (!foundSelected && (data. usesMenuList() || (!data.multiple() && optionElement->selected()))) {273 if (updateSelectedStates && !data.multiple()) { 274 if (!foundSelected && (data.size() <= 1 || optionElement->selected())) { 275 275 foundSelected = optionElement; 276 276 foundSelected->setSelectedState(true); 277 } else if (foundSelected && !data.multiple() &&optionElement->selected()) {277 } else if (foundSelected && optionElement->selected()) { 278 278 foundSelected->setSelectedState(false); 279 279 foundSelected = optionElement; … … 500 500 } 501 501 502 if (!selectedOption && firstOption && data.usesMenuList())502 if (!selectedOption && firstOption && !data.multiple() && data.size() <= 1) 503 503 firstOption->setSelectedState(true); 504 504
Note: See TracChangeset
for help on using the changeset viewer.