LibWeb: Add select and options collection remove method

This commit is contained in:
Bastiaan van der Plaat 2024-04-08 21:56:33 +02:00 committed by Andreas Kling
commit 7372c01786
Notes: sideshowbarker 2024-07-17 14:36:19 +09:00
8 changed files with 62 additions and 3 deletions

View file

@ -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>