Bug 257172

Summary: HTMLOptionElement text setter should not throw
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, annevk, cdumez, karlcow, rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-05-22 17:21:23 PDT
Hi Team,

This is another WPT Test case progression:

WPT Test Case - https://wpt.fyi/results/html/semantics/forms/the-option-element/option-text-setter.html?label=master&label=experimental&aligned&q=forms

WPT Test Case Link - http://wpt.live/html/semantics/forms/the-option-element/option-text-setter.html

Blink Commit - https://chromium-review.googlesource.com/c/chromium/src/+/721610

WebKit Source (only need to changes in HTMLOptionElement.cpp):

Delete from L126 to L133 - https://github.com/WebKit/WebKit/blob/21a4b1c5559f6ddda3f3c4166e5ab33cab2c475d/Source/WebCore/html/HTMLOptionElement.cpp#L126

and then add this line:

 setTextContent(WTFMove(text));

______

This will fix another failing WPT test case and matching Chromium and Web-Spec:

Web-Spec: https://html.spec.whatwg.org/#dom-option-text

"The text attribute's setter must string replace all with the given value within this element.."

Chrome / Blink mention this spec line:
"On setting, the text attribute must act as if the textContent IDL
attribute on the element had been set to the new value"

Which I was not able to find.

____

Just wanted to raise.

Thanks!
Comment 1 EWS 2023-05-23 14:58:41 PDT
Committed 264442@main (8b8e722170c2): <https://commits.webkit.org/264442@main>

Reviewed commits have been landed. Closing PR #14238 and removing active labels.
Comment 2 Radar WebKit Bug Importer 2023-05-23 14:59:24 PDT
<rdar://problem/109740566>