Bug 257172 - HTMLOptionElement text setter should not throw
Summary: HTMLOptionElement text setter should not throw
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2023-05-22 17:21 PDT by Ahmad Saleem
Modified: 2023-05-23 14:59 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>