mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibWeb: Add select and options collection remove method
This commit is contained in:
parent
5decf4b33c
commit
7372c01786
Notes:
sideshowbarker
2024-07-17 14:36:19 +09:00
Author: https://github.com/bplaat
Commit: 7372c01786
Pull-request: https://github.com/SerenityOS/serenity/pull/23895
Reviewed-by: https://github.com/shannonbooth
8 changed files with 62 additions and 3 deletions
|
@ -146,5 +146,27 @@
|
|||
}
|
||||
return `${select.options.selectedIndex} ${select.selectedIndex}`;
|
||||
});
|
||||
|
||||
// 15. Remove select options
|
||||
testPart(() => {
|
||||
const select = document.createElement('select');
|
||||
for (let i = 0; i < 10; i++) {
|
||||
select.appendChild(document.createElement('option'));
|
||||
}
|
||||
select.remove(5);
|
||||
select.options.remove(6);
|
||||
return select.length;
|
||||
});
|
||||
|
||||
// 16. Remove select options invalid
|
||||
testPart(() => {
|
||||
const select = document.createElement('select');
|
||||
for (let i = 0; i < 10; i++) {
|
||||
select.appendChild(document.createElement('option'));
|
||||
}
|
||||
select.remove(-1);
|
||||
select.options.remove(11);
|
||||
return select.length;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue