forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Account for CSS transform in Element::getClientRects()
- Loading branch information
1 parent
da6c685
commit a484497
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/element-get-bounding-client-rect-css-transform.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"x":68,"y":118,"width":100,"height":100,"top":118,"right":168,"bottom":218,"left":68} |
30 changes: 30 additions & 0 deletions
30
Tests/LibWeb/Text/input/element-get-bounding-client-rect-css-transform.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters