mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
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.
25 lines
583 B
HTML
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>
|