ladybird/Tests/LibWeb/Text/input/get-bounding-client-rect.html
Sam Atkins 1e6cd19b28 LibWeb: Prevent calling test() twice
Calling test() multiple times in the same test file is not actually
valid, and can cause the following test to hang forever. So let's stop
doing that in the one test that did so, and also prevent the same
mistake happening again. :^)

Throwing an exception on subsequent test() calls means that we don't
hang, the test will fail with missing output, and we get a log message
explaining why.
2023-12-22 16:49:06 +01:00

22 lines
580 B
HTML

<!DOCTYPE html>
<style type="text/css">
#box {
margin-top: 500px;
padding-top: 100px;
background-color: navy;
width: 100%;
height: 50px;
}
</style>
<div id="box"></div>
<a id="inline">inline</a>
<script src="include.js"></script>
<script>
test(() => {
const box_rect = document.getElementById("box").getBoundingClientRect();
println(JSON.stringify(box_rect));
const inline_rect = document.getElementById("inline").getBoundingClientRect();
println(JSON.stringify(inline_rect));
});
</script>