Skip to content

Commit

Permalink
selectlist: Make <selectedoption> cloneNode all contents
Browse files Browse the repository at this point in the history
This patch makes <selectedoption> replace its child contents with not
just the textContent of the selected <option>, but instead the selected
<option>'s entire child content via cloneNode(). This use case has been
discussed here: openui/open-ui#571

We aren't sure yet if this will be the path forward, but prototyping it
and getting feedback will help move this issue forward.

Bug: 1121840
Change-Id: Ia7c007b2193a8a0777295e299b57704d72832056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4810996
Commit-Queue: Joey Arhar <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1192051}
  • Loading branch information
josepharhar authored and chromium-wpt-export-bot committed Sep 4, 2023
1 parent ef2fcae commit 0f9adfb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<button>
<span style="color:red">red</span> one
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<link rel=author href="mailto:[email protected]">
<link rel=help href="https://github.com/openui/open-ui/issues/571">
<link rel=match href="selectlist-selectedoption-element-cloning-ref.html">

<selectlist>
<button type=selectlist>
<selectedoption></selectedoption>
</button>
<option><span style="color:red">red</span> one</option>
</selectlist>

0 comments on commit 0f9adfb

Please sign in to comment.