ladybird/Tests/LibWeb/Text/input/HTML/form-image-submission.html
Sam Atkins 08253d6aee Tests/LibWeb: Move assets used by multiple test types into Assets/
Having to go through multiple levels of .. is not ideal, but less odd
than reaching into another test type's data files.
2024-11-05 14:02:07 +00:00

36 lines
1,009 B
HTML

<head>
<!--
These style rules ensure the (x,y) coordinates clicked below are the same as the resulting
coordinates in the form submission event.
-->
<style type="text/css">
dialog {
margin: 0;
padding: 0;
}
</style>
</head>
<dialog id="dialog" open>
<form id="form" method="dialog">
<input value="well hello friends!" />
<input id="image" type="image" src="../../../Assets/120.png" />
</form>
</dialog>
<script src="../include.js"></script>
<script>
asyncTest(done => {
let dialog = document.getElementById("dialog");
let image = document.getElementById("image");
dialog.addEventListener("close", e => {
println(dialog.returnValue);
done();
});
window.addEventListener("load", () => {
const imageRect = image.getBoundingClientRect();
internals.click(imageRect.x + 10, imageRect.y + 20);
});
});
</script>