Files
ladybird/Tests/LibWeb/Text/input/svg-abspos.html
Aliaksandr Kalenik 65704e57fb LibWeb: Fix abspos replaced element constraint equations
The constraint equations for absolutely positioned replaced elements
only subtracted content width/height from the containing block size,
omitting padding and border.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/7820
2026-02-19 12:56:40 +01:00

20 lines
635 B
HTML

<!DOCTYPE html>
<style>
.right { position: absolute; top: 0; right: 0; padding: 15%; background-color: green; }
.bottom { position: absolute; bottom: 0; left: 0; padding: 15%; background-color: blue; }
</style>
<svg class="right"></svg>
<svg class="bottom"></svg>
<script src="include.js"></script>
<script>
test(() => {
for (const svg of document.querySelectorAll("svg")) {
const rect = svg.getBoundingClientRect();
println(`x: ${rect.x}`);
println(`y: ${rect.y}`);
println(`width: ${rect.width}`);
println(`height: ${rect.height}`);
}
});
</script>