Skip to content

Make <option> and <optgroup> share a text content algorithm - #74042

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
annevk:eng/Make-option-and-optgroup-share-a-text-content-algorithm
Sep 16, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
annevk:eng/Make-option-and-optgroup-share-a-text-content-algorithm

Conversation

@annevk

@annevk annevk commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

24d831f

Make <option> and <optgroup> share a text content algorithm
https://bugs.webkit.org/show_bug.cgi?id=324223

Reviewed by Tim Nguyen.

Implements whatwg/html#12232, which replaces
"collect option text" with "get HTML-aware text content", now shared
between <option> and <optgroup>.

Getting an <optgroup>'s label now only considers a <legend> that is the
optgroup's first element child, falling back to the label attribute and
then the empty string.

The label element has to look like a <legend>, which is the entire
reason it exists, so it now shares their user agent style rule through
an -internal-optgroup-label user agent part rather than carrying two
inline padding properties that had drifted from that rule.

fast/forms/select/optgroup-option-shadow-tree.html expected the label
element to exist only for a label attribute, so update it, and cover a
<legend> that is not the first element child while there.

The reference tests are not always passing due to the slight shift of the
picker icon as noted in TestExpectations.

Test: imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-not-first.html

Upstream: web-platform-tests/wpt#61109
Canonical link: https://commits.webkit.org/321227@main

846d8da

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe 💥 🛠 win ✅ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 💥 🧪 win-tests ✅ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ✅ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk3-gcc
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-wk2-stress ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-intel-wk2 ✅ 🧪 api-gtk
✅ 🛠 🧪 unsafe-merge ✅ 🧪 vision-wk2 ✅ 🛠 mac-safer-cpp ✅ 🛠 playstation
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@annevk annevk self-assigned this Sep 15, 2026
@annevk annevk added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Sep 15, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 15, 2026
@annevk annevk removed the merging-blocked Applied to prevent a change from being merged label Sep 15, 2026
@annevk
annevk force-pushed the eng/Make-option-and-optgroup-share-a-text-content-algorithm branch from 2c5336a to 846d8da Compare September 15, 2026 14:29
@annevk
annevk marked this pull request as ready for review September 15, 2026 17:05
@annevk
annevk requested review from cdumez and rniwa as code owners September 15, 2026 17:05
@annevk annevk added safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing labels Sep 15, 2026
https://bugs.webkit.org/show_bug.cgi?id=324223

Reviewed by Tim Nguyen.

Implements whatwg/html#12232, which replaces
"collect option text" with "get HTML-aware text content", now shared
between <option> and <optgroup>.

Getting an <optgroup>'s label now only considers a <legend> that is the
optgroup's first element child, falling back to the label attribute and
then the empty string.

The label element has to look like a <legend>, which is the entire
reason it exists, so it now shares their user agent style rule through
an -internal-optgroup-label user agent part rather than carrying two
inline padding properties that had drifted from that rule.

fast/forms/select/optgroup-option-shadow-tree.html expected the label
element to exist only for a label attribute, so update it, and cover a
<legend> that is not the first element child while there.

The reference tests are not always passing due to the slight shift of the
picker icon as noted in TestExpectations.

Test: imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-not-first.html

Upstream: web-platform-tests/wpt#61109
Canonical link: https://commits.webkit.org/321227@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/Make-option-and-optgroup-share-a-text-content-algorithm branch from 846d8da to 24d831f Compare September 16, 2026 05:09
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 321227@main (24d831f): https://commits.webkit.org/321227@main

Reviewed commits have been landed. Closing PR #74042 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit 24d831f into WebKit:main Sep 16, 2026
@webkit-commit-queue webkit-commit-queue removed unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Sep 16, 2026
@annevk
annevk deleted the eng/Make-option-and-optgroup-share-a-text-content-algorithm branch September 16, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOM For bugs specific to XML/HTML DOM elements (including parsing).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants