Fix null handling of HTMLSelectElement.value attribute: https://html.spec.whatwg.org/multipage/forms.html#htmlselectelement We currently treat null as the null String which ends up setting selectedIndex to -1. However, we should treat null as the String "null" which would set the selectedIndex to the Index of the <option> element whose value is "null". Firefox and Chrome match the specification.
Created attachment 284019 [details] Patch
Comment on attachment 284019 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=284019&action=review > LayoutTests/fast/dom/HTMLSelectElement/value-null-handling.html:19 > +evalAndLog("select.value = null"); > +shouldBeEqualToString("select.value", "null"); > +shouldBe("select.selectedIndex", "1"); You are missing a case. Setting the value to null and not having a value==="null" in the select element.
Committed r203456: <http://trac.webkit.org/changeset/203456>
(In reply to comment #2) > Comment on attachment 284019 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=284019&action=review > > > LayoutTests/fast/dom/HTMLSelectElement/value-null-handling.html:19 > > +evalAndLog("select.value = null"); > > +shouldBeEqualToString("select.value", "null"); > > +shouldBe("select.selectedIndex", "1"); > > You are missing a case. Setting the value to null and not having a > value==="null" in the select element. I added it before landing, thanks.