LibWeb: Add {,de}serialization steps for FileList

This commit is contained in:
Kenneth Myhra 2024-03-18 21:58:25 +01:00 committed by Andreas Kling
commit c92f556aa5
Notes: sideshowbarker 2024-07-16 20:51:53 +09:00
5 changed files with 91 additions and 1 deletions

View file

@ -0,0 +1,32 @@
<input id="input1" type="file" multiple />
<script src="../include.js"></script>
<script>
const runTest = async id => {
let input = document.getElementById(id);
return new Promise(resolve => {
input.addEventListener("input", async () => {
println(`${id}:`);
let files = structuredClone(input.files);
for (let file of input.files) {
const text = await file.text();
println(`${file.name}: ${file.type}: ${text}`);
}
resolve();
});
internals.dispatchUserActivatedEvent(input, new Event("mousedown"));
input.showPicker();
});
}
asyncTest(async done => {
await runTest("input1");
done();
});
</script>