Bug 258862

Summary: <option> label attribute updates are not shown until focus is moved
Product: WebKit Reporter: bugzilla.krzysdz
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, cdumez, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Problem demonstration none

Description bugzilla.krzysdz 2023-07-04 18:51:37 PDT
Created attachment 466927 [details]
Problem demonstration

Changes made from JS to label of a selected <option> in <select> are not rendered unless the focus changes. If the new value is assigned using textContent (and there is no label attribute), the text of the <option> will be updated. If label of a selected <option> is changed, re-selecting it may help, but changing textContent of another <option> works too.

If the label was changed in a <button> "click" event listener, it will be rendered only if the focus moves to the <select>. If the change happened as a result of <select> "change" event, the change will be reflected on the list of options, but the <select> will render it as its selected value when the focus moves to another element.

The behaviour is present in Safari 16.5.1, Safari TP 173 and Epiphany TP 45.alpha-5-g2486bfbdf+.

The problem is similar to bug 255230 (and the demo is based on it), but affects label updates, not innerText or textContent.
Comment 1 bugzilla.krzysdz 2023-07-06 16:18:40 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15615
Comment 2 EWS 2023-07-11 03:04:31 PDT
Committed 265942@main (06461c59e1c1): <https://commits.webkit.org/265942@main>

Reviewed commits have been landed. Closing PR #15615 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-07-11 03:05:18 PDT
<rdar://problem/112069033>