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:
parent
96d5f555e1
commit
fb2166f19c
3 changed files with 45 additions and 3 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue