NEW 115708
select element’s default selection is affected by CSS rules
https://bugs.webkit.org/show_bug.cgi?id=115708
Summary select element’s default selection is affected by CSS rules
Ryosuke Niwa
Reported 2013-05-06 21:21:17 PDT
We should consider merging https://chromium.googlesource.com/chromium/blink/+/938d5b4ad28b364346bc8c182b4a71b13d20975d <select> default selection is affected by CSS styling. If we have option:checked selectors, HTMLOptionElement::selected is called even when its owner option list is incomplete. It makes the default selection incorrect. To avoid this issue, we introduce isParsingInProgress flag, and HTMLOptionElement::selected doesn't call HTMLSelectELement::updateListItemSelectedStates if the flag is true. Because this patch reduces the number of calls to RenderMenuList::updateFromElement, a bug of RenderText is unveiled. A change of RenderMenuList::setText avoids the bug. Also, this change and accessibility/add-to-menu-list-crashes.html test unveiled a bug that HTMLSelectElement::selectedOption didn't update selection status. Tests: * fast/forms/select/menulist-disabled-option.html is udpated. This patch updates some option text so that expectations are easy to understand. * fast/forms/HTMLOptinElement_selected3.html: Update description, and make this work on IE10. The new behavior is compatible with IE10.
Attachments
Ahmad Saleem
Comment 1 2022-08-22 13:39:35 PDT
I changed the test cases from Chromium Patch: JSFiddle - menulist-disabled-option.html - https://jsfiddle.net/825ab7jp/show Safari 15.6.1 still fail last one while all other browsers (Chrome Canary 106 and Firefox Nightly 105) pass all tests. In other test - HTMLOptionElement_selected3 - https://jsfiddle.net/oLrs30tk/show Both Safari 15.6 and Chrome Canary 106 show "O" ([theSelect].selectedIndex = 0), while Firefox Nightly 105 show "-1".
Ahmad Saleem
Comment 2 2023-05-23 02:11:29 PDT
(In reply to Ahmad Saleem from comment #1) > I changed the test cases from Chromium Patch: > > JSFiddle - menulist-disabled-option.html - https://jsfiddle.net/825ab7jp/show > > Safari 15.6.1 still fail last one while all other browsers (Chrome Canary > 106 and Firefox Nightly 105) pass all tests. > > In other test - HTMLOptionElement_selected3 - > https://jsfiddle.net/oLrs30tk/show > > Both Safari 15.6 and Chrome Canary 106 show "O" ([theSelect].selectedIndex = > 0), while Firefox Nightly 105 show "-1". Safari 16.5 passes both and matches with Chrome Canary 115. Firefox Nightly 115 is still different in this - https://jsfiddle.net/oLrs30tk/show Can we close this now? Or we need to still get this patch in?
Note You need to log in before you can comment on or make changes to this bug.