RESOLVED FIXED 119291
HTMLOptionElement::defaultSelected should affect selection state of other option elements
https://bugs.webkit.org/show_bug.cgi?id=119291
Summary HTMLOptionElement::defaultSelected should affect selection state of other opt...
Ryosuke Niwa
Reported 2013-07-30 16:20:44 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/e8f0337fdc86554b48cf81d7ed8c286f251d2405 According to the standard, we should set selectedness to true if defaultSelected is set to true, and we should not set selectedness to false if defaultSelected is set to false because the standard says nothing about it. [1] > Whenever an option element's selected attribute is added, its selectedness > must be set to true. When the selectedness of an option is udpated, other options's selectedness should become false. [2] > If the multiple attribute is absent, whenever an option element in the select > element's list of options has its selectedness set to true, and whenever an > option element with its selectedness set to true is added to the select > element's list of options, the user agent must set the selectedness of all the > other option elements in its list of options to false. The old behavior doesn't match to the standard and any other browsers. The new behavior matches to IE10 and the standard. We need to update pseudoclass-update-checked-option.html because the expected behavior of the test was incorrect. [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#attr-option-selected [2] http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-select-element
Attachments
Ahmad Saleem
Comment 1 2023-06-14 04:56:27 PDT
We should do following rather than commit from Comment 0: https://chromium.googlesource.com/chromium/src.git/+/4288626a69e2e6426555bb174a99e555e174f755 It make us pass linked test case in URL field, where we are failing following tests: FAIL select1[2].defaultSelected = true; selectionMap(select1) should be 001. Was 101. FAIL select1[1].defaultSelected = true; selectionMap(select1) should be 010. Was 111. FAIL select1[1].defaultSelected = false; selectionMap(select1) should be 100. Was 101. FAIL select1[2].selected = true;
Ahmad Saleem
Comment 2 2023-06-14 04:59:14 PDT
(In reply to Ahmad Saleem from comment #1) > We should do following rather than commit from Comment 0: > > https://chromium.googlesource.com/chromium/src.git/+/ > 4288626a69e2e6426555bb174a99e555e174f755 > > It make us pass linked test case in URL field, where we are failing > following tests: > > FAIL select1[2].defaultSelected = true; selectionMap(select1) should be 001. > Was 101. > FAIL select1[1].defaultSelected = true; selectionMap(select1) should be 010. > Was 111. > FAIL select1[1].defaultSelected = false; selectionMap(select1) should be > 100. Was 101. > FAIL select1[2].selected = true; This needs to be done in following function (HTMLOptionElement::attributeChanged): if (oldValue.isNull() != newValue.isNull()) setSelected(!newValue.isNull());
EWS
Comment 3 2023-06-14 14:52:40 PDT
Committed 265167@main (efb64fda19d2): <https://commits.webkit.org/265167@main> Reviewed commits have been landed. Closing PR #14955 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2023-06-14 14:53:18 PDT
Note You need to log in before you can comment on or make changes to this bug.