mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/HTML: Iterate over select options in tree order
This also saves us from iterating twice over the children, and instead do it in a single pass.
This commit is contained in:
parent
4f80c7a5f3
commit
802529bafc
Notes:
github-actions[bot]
2025-01-27 00:11:13 +00:00
Author: https://github.com/shannonbooth
Commit: 802529bafc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3368
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 29 additions and 11 deletions
|
@ -0,0 +1,16 @@
|
|||
<select id="test-select">
|
||||
<option value="0" selected>Option 0</option>
|
||||
<optgroup label="Group 1">
|
||||
<option value="1">Option 1</option>
|
||||
<option value="2">Option 2</option>
|
||||
</optgroup>
|
||||
<option value="3" selected>Option 3</option>
|
||||
<option value="4">Option 4</option>
|
||||
</select>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const selectElement = document.getElementById('test-select');
|
||||
println(selectElement.selectedIndex);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue