Files
ladybird/Tests/LibWeb/Text/input/get-bounding-client-rect.html
Aliaksandr Kalenik e464d484c4 LibWeb: Implement getBoundingClientRect() for inline paintables
This fixes the issue that occurred when, after clicking an inline
paintable page would always scroll to the top. The problem was that
`scroll_an_element_into_view()` relies on `get_bounding_client_rect()`
to produce the correct scroll position and for inline paintables we
were always returning zero rect before this change.
2023-12-14 16:25:27 +01:00

25 lines
583 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 rect = document.getElementById("box").getBoundingClientRect();
println(JSON.stringify(rect));
});
test(() => {
const rect = document.getElementById("inline").getBoundingClientRect();
println(JSON.stringify(rect));
});
</script>