LibWeb: Don't try to click a form image until it has loaded

We are often trying to click the image before it has finished loading.
This results in us trying to click a 0x0 rect. Instead, wait until the
image load event.

This fixes a flake with form-image-submission.html often seen on CI.
This commit is contained in:
Timothy Flynn 2024-05-09 09:48:06 -04:00 committed by Andreas Kling
parent 653f41336b
commit 1fbf1bc4ac
Notes: sideshowbarker 2024-07-16 18:03:21 +09:00

View File

@ -28,7 +28,9 @@
done();
});
const imageRect = image.getBoundingClientRect();
internals.click(imageRect.x + 10, imageRect.y + 20);
image.addEventListener("load", () => {
const imageRect = image.getBoundingClientRect();
internals.click(imageRect.x + 10, imageRect.y + 20);
});
});
</script>