Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select: define corner case behavior for <selectedoption> #1120

Open
sorvell opened this issue Oct 25, 2024 · 1 comment
Open

select: define corner case behavior for <selectedoption> #1120

sorvell opened this issue Oct 25, 2024 · 1 comment
Labels
select These are issues that relate to the select component

Comments

@sorvell
Copy link

sorvell commented Oct 25, 2024

There are a lot of weird things you can do with the <selectedoption> element. These should at least all have well-defined behavior and not produce unexpected errors or hang the browser.

Some cases to consider, definitely not an exhaustive list:

  1. Child content, especially when there is no select.selectedOption
<selectedoption>some stuff</selectedoption>
  1. As descendant of itself
<selectedoption>
  <selectedoption></selectedoption>
</selectedoption>
  1. As descendant of <option>
<option>
  1 <selectedoption></selectedoption>
</option>
  1. When targeted by multiple select's
<selectedoption id="shared"></selectedoption>
<select selectedoptionelement="shared">...</select>
<select selectedoptionelement="shared">...</select>

or

<select selectedoptionelement="shared">...</select>
<select>
  <selectedoption id="shared"></selectedoption>
</select>
@josepharhar
Copy link
Collaborator

  1. Child content, especially when there is no select.selectedOption

You mean if the author puts stuff in there? It's well defined - when the next clone happens due to select.value being assigned to or the user chooses a different option, then the contents will be replaced by the browser.

  1. As descendant of itself

If a selectedoption has an ancestor selectedoption, then it will become disabled. It will also be removed by the browser whenever cloning occurs in the ancestor selectedoption.

  1. As descendant of option

If a selectedoption has an ancestor option, then it will become disabled - I haven't implemented this yet, it currently hangs the browser :)

  1. When targeted by multiple select's

Each select will clone into that selectedoption whenever either one of them decides to do a clone. This seems intuitive to me in the odd case that you decide to do this.

@josepharhar josepharhar added the select These are issues that relate to the select component label Oct 29, 2024
aarongable pushed a commit to chromium/chromium that referenced this issue Oct 30, 2024
This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 30, 2024
This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 30, 2024
This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 31, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Nov 1, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <jarharchromium.org>
Reviewed-by: Traian Captan <tcaptanchromium.org>
Cr-Commit-Position: refs/heads/main{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887

UltraBlame original commit: 17d95f3373bf1c72fe9c5b5c337c4534f0e6f421
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Nov 1, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <jarharchromium.org>
Reviewed-by: Traian Captan <tcaptanchromium.org>
Cr-Commit-Position: refs/heads/main{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887

UltraBlame original commit: 17d95f3373bf1c72fe9c5b5c337c4534f0e6f421
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Nov 1, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <jarharchromium.org>
Reviewed-by: Traian Captan <tcaptanchromium.org>
Cr-Commit-Position: refs/heads/main{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887

UltraBlame original commit: 17d95f3373bf1c72fe9c5b5c337c4534f0e6f421
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Nov 1, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Nov 5, 2024
…testonly

Automatic update from web-platform-tests
Disable selectedoption inside option

This patch prevents an infinite loop due to putting a selectedoption
inside of an option element. This case was pointed out here:
openui/open-ui#1120

Change-Id: I794e49b5c5d28773ce4684fc3a829365667fe138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5975638
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Traian Captan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1375889}

--

wpt-commits: 77665be0abf23117db6596f618be29dc416fdd13
wpt-pr: 48887
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
select These are issues that relate to the select component
Projects
None yet
Development

No branches or pull requests

2 participants