mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 11:09:18 +00:00
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:
parent
653f41336b
commit
1fbf1bc4ac
Notes:
sideshowbarker
2024-07-16 18:03:21 +09:00
Author: https://github.com/trflynn89
Commit: 1fbf1bc4ac
Pull-request: https://github.com/SerenityOS/serenity/pull/24271
1 changed files with 4 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue