Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#63736 assigned enhancement

HTML API: Update parsing for customizable select elements

Reported by: jonsurrell's profile jonsurrell Owned by: jonsurrell's profile jonsurrell
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: HTML API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

The HTML standard is being updated to support customizable select elements. The HTML API should be updated to account for the new changes.

WHATWG/HTML PR 10548 had landed with the updates. Several browsers already have support and MDN pages have been updated for select, selectedcontent, and a new guide on customizable select elements.

There's also an html5-lib tests PR that updates tests to account for the changes.

Change History (4)

This ticket was mentioned in PR #9298 on WordPress/wordpress-develop by @jonsurrell.


5 months ago
#1

  • Keywords has-patch has-unit-tests added

Trac ticket: #63736

The HTML standard is being updated to support customizable select elements. The HTML API should be updated to account for the new changes.

WHATWG/HTML PR 10548 had landed with the updates. Several browsers already have support and MDN pages have been updated for select, selectedcontent, and a new guide on customizable select elements.

There's also an html5-lib tests PR that updates tests to account for the changes.

Update HTML API parsing to account for changes in https://github.com/whatwg/html/pull/10548.

Apply https://github.com/html5lib/html5lib-tests/pull/178.

Todo:

  • [ ] Update the html5lib-tests README and sha when the PR lands.

@jonsurrell commented on PR #9298:


3 months ago
#3

The HTML5-lib test updates were merged: https://github.com/html5lib/html5lib-tests/pull/178

@dmsnell commented on PR #9298:


3 months ago
#4

https://github.com/user-attachments/assets/a515db9f-0eb3-487c-8d6e-49d81b8c6706

My reading on this is that when we close an OPTION element we check if we are the first element with selected and that the parent SELECT is not a multiple.

If that’s the case we should be able to infer that we are inside a SELECTEDCONTENT and fib it, should we want to. This is something we could possibly track through a boolean flag in the parser.

Interesting the spec reads like this cloning _only_ occurs when encountering an end tag whose name is OPTION. That’s not what Chrome is doing, because it clones the element when there are no closing tags. It’s like they are doing it upon the event of closing the OPTION instead of encountering the end tag.

Note: See TracTickets for help on using tickets.