1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibWeb: Account for CSS transform in Element::getClientRects()

This commit is contained in:
Aliaksandr Kalenik 2024-01-30 12:08:53 +01:00 committed by Andreas Kling
parent 96d5f555e1
commit fb2166f19c
3 changed files with 45 additions and 3 deletions

View file

@ -0,0 +1,30 @@
<!DOCTYPE html>
<style type="text/css">
.transform-1 {
transform: translate(100px, 100px);
}
.transform-2 {
transform: translate(-50px, 0px);
}
#box {
background-color: magenta;
width: 100px;
height: 100px;
opacity: 0.1;
transform: translate(10px, 10px);
}
</style>
<div class="transform-1">
<div class="transform-2">
<div id="box"></div>
</div>
</div>
<script src="include.js"></script>
<script>
test(() => {
const transformed_box_rect = document.getElementById("box").getBoundingClientRect();
println(JSON.stringify(transformed_box_rect));
});
</script>