Bug 115708
| Summary: | select element’s default selection is affected by CSS rules | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | adele, ahmad.saleem792, darin, jonlee, michelangelo, tkent |
| Priority: | P2 | Keywords: | BlinkMergeCandidate |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ryosuke Niwa
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
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
(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?