Skip to content

Conversation

josepharhar
Copy link
Contributor

@josepharhar josepharhar commented Aug 5, 2024

This defines several concepts related to customizable <select>:

  • Relaxing the HTML parser to allow more tags inside <select>
  • Updating the content model to allow more elements inside <select> and related elements.
  • Defines rendering and some interactions for base appearance for <select>
  • Adds the <selectedcontent> HTML element
  • Adds a UA stylesheet for <select> with base appearance

Closes #9799
Closes #10557
Closes #10310
Closes #10586
Closes #10317
Closes #10629
Closes #10633
Closes #10520
Closes #10670
Closes #10520
Closes #10762


/dom.html ( diff )
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/grouping-content.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/interactive-elements.html ( diff )
/parsing.html ( diff )
/references.html ( diff )
/rendering.html ( diff )
/scripting.html ( diff )
/text-level-semantics.html ( diff )

@josepharhar josepharhar force-pushed the selectcomplete branch 2 times, most recently from 4691e13 to bef9083 Compare August 7, 2024 22:31
@josepharhar
Copy link
Contributor Author

FYI: I am likely going to remove the author-provided datalist and fallback UA button in this PR soon based on recent discussions, which will likely reduce the number of changes and complexity.

@josepharhar josepharhar force-pushed the selectcomplete branch 5 times, most recently from 50bf192 to 12edc88 Compare September 12, 2024 22:06
@mfreed7
Copy link
Collaborator

mfreed7 commented Oct 23, 2024

Should this PR be closed, to avoid confusion? I believe it's been completely superseded by the list at the top of #9799, right?

@josepharhar
Copy link
Contributor Author

Yes I'm not keeping this up to date anymore since I decided to split out the PRs and have slight redundancies

@domenic
Copy link
Member

domenic commented Jul 18, 2025

I did a review here to try to finish this off.

I pushed several editorial commits. @josepharhar, please review them.

The conformance requirements look reasonable to me.

However, one issue makes me think this is not ready. There are multiple definitions for option HTML element insertion/removing steps, one in the select element section, and one in the option element section. I cannot tell if they are both supposed to run, or if one has become obsolete, or what.

Please update this by merging them, or deleting the obsolete one.

Also, please moving the HTML element insertion/removing/moving steps, for both option and optgroup, into the sections for those elements, instead of keeping them in the select element's section. That can help prevent this sort of problem in the future.

@domenic
Copy link
Member

domenic commented Jul 18, 2025

An additional non-blocking note (a followup PR would be fine) is that it would be good to add more examples to the spec that use the new, more complicated forms of select.

@josepharhar
Copy link
Contributor Author

Thanks Domenic! I fixed the duplicate insertion/removal steps. I also started a PR for examples: #11465

@domenic
Copy link
Member

domenic commented Jul 19, 2025

Great, thank you! Can you also move the optgroup steps to the optgroup element section, instead of having them in the select element section?

@josepharhar
Copy link
Contributor Author

Great, thank you! Can you also move the optgroup steps to the optgroup element section, instead of having them in the select element section?

done

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I will merge this now!

@dmsnell
Copy link
Contributor

dmsnell commented Sep 10, 2025

Please pardon me if this is spelled out already and I‘m missing something, but it reads to me in the changes that we only run maybe clone an option into selectedcontent when the parser encounters an end tag whose name is OPTION. However, Chrome seems to be running this even when no end tag exists whose name is OPTION, as if running it on the event of the closing of an open OPTION element.

Should there be some mention in generate implied end tags, or even in the stack of open elements section indicating that when popping an OPTION element, the maybe clone an option into selectedcontent algorithm should run?

@annevk
Copy link
Member

annevk commented Sep 11, 2025

@dmsnell can you please file a new issue on that?

lexborisov added a commit to lexbor/lexbor that referenced this pull request Sep 26, 2025
Synchronization with specifications:
whatwg/html#10548

html5lib-tests updated.

Unfortunately, we had to add the <search> tag in this patch, rather than in a
separate one.
Also in this patch, foreign content parsing has been changed. Brought into line
with the specification.

This related #256 issue on GitHub.
annevk added a commit to annevk/WebKit that referenced this pull request Oct 1, 2025
https://bugs.webkit.org/show_bug.cgi?id=299959

Reviewed by NOBODY (OOPS!).

This implements the parser aspects of
whatwg/html#10548 behind a flag. The old code
path continues to be tested through our legacy HTML parser test suite.

This does not yet implement new logic for the <select>, <optgroup>,
<option>, and <hr> classes to account for the fact that <optgroup>,
<option>, and <hr> can now appear as descendants and as such this is
only useful for testing.

(Until this <select> changes were made the legacy HTML parser test
suite was synchronized with the WPT test suite and we'll remove it once
it's easier to add tests HTML parser tests on the WPT side.)
annevk added a commit to annevk/WebKit that referenced this pull request Oct 2, 2025
https://bugs.webkit.org/show_bug.cgi?id=299959

Reviewed by NOBODY (OOPS!).

This implements the parser aspects of
whatwg/html#10548 behind a flag. The old code
path continues to be tested through our legacy HTML parser test suite.

This does not yet implement new logic for the <select>, <optgroup>,
<option>, and <hr> classes to account for the fact that <optgroup>,
<option>, and <hr> can now appear as descendants and as such this is
only useful for testing.

Remove fast/parser/input-textarea-inside-select-element.html test as it
was duplicative of both the legacy HTML parser test suite and WPT
coverage.

(Until these recent <select> changes were made the legacy HTML parser
test suite was synchronized with the WPT test suite and we'll remove it
once it's easier to add tests HTML parser tests on the WPT side.)
annevk added a commit to annevk/WebKit that referenced this pull request Oct 4, 2025
https://bugs.webkit.org/show_bug.cgi?id=299959
rdar://140875257

Reviewed by NOBODY (OOPS!).

This implements the parser aspects of
whatwg/html#10548 behind a flag. The old code
path continues to be tested through our legacy HTML parser test suite.

This does not yet implement new logic for the <select>, <optgroup>,
<option>, and <hr> classes to account for the fact that <optgroup>,
<option>, and <hr> can now appear as descendants and as such this is
only useful for testing.

Remove fast/parser/input-textarea-inside-select-element.html test as it
was duplicative of both the legacy HTML parser test suite and WPT
coverage.

(Until these recent <select> changes were made the legacy HTML parser
test suite was synchronized with the WPT test suite. We'll remove it
once it's easier to add HTML parser tests on the WPT side.)
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request Oct 4, 2025
https://bugs.webkit.org/show_bug.cgi?id=299959
rdar://140875257

Reviewed by Ryosuke Niwa.

This implements the parser aspects of
whatwg/html#10548 behind a flag. The old code
path continues to be tested through our legacy HTML parser test suite.

This does not yet implement new logic for the <select>, <optgroup>,
<option>, and <hr> classes to account for the fact that <optgroup>,
<option>, and <hr> can now appear as descendants and as such this is
only useful for testing.

Remove fast/parser/input-textarea-inside-select-element.html test as it
was duplicative of both the legacy HTML parser test suite and WPT
coverage.

(Until these recent <select> changes were made the legacy HTML parser
test suite was synchronized with the WPT test suite. We'll remove it
once it's easier to add HTML parser tests on the WPT side.)

Canonical link: https://commits.webkit.org/300998@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition/proposal New features or enhancements agenda+ To be discussed at a triage meeting topic: forms topic: select The <select> element

7 participants