mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Inline formatting contexts in vertical writing modes were measuring intrinsic width from the line box width. That width still tracks the line-height-sized horizontal span, so shrink-to-fit abspos sizing could stay at 50px even when the text fragments only covered 25px. Measure the physical horizontal extent from the line box fragments instead, including the float-aware block formatting context path. This makes orthogonal inline content report the correct intrinsic width.
47 lines
995 B
HTML
47 lines
995 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<link rel="stylesheet" href="../../../Ref/data/fonts/ahem.css">
|
|
<style>
|
|
#grid {
|
|
display: grid;
|
|
grid-template-columns: 200px 300px;
|
|
grid-template-rows: 150px 100px;
|
|
width: 550px;
|
|
height: 400px;
|
|
margin: 1px 2px 3px 4px;
|
|
padding: 20px 15px 10px 5px;
|
|
border-width: 9px 3px 12px 6px;
|
|
border-style: solid;
|
|
position: relative;
|
|
font: 25px/1 Ahem;
|
|
}
|
|
|
|
#item {
|
|
grid-area: 1 / 1;
|
|
}
|
|
|
|
#abspos {
|
|
position: absolute;
|
|
display: inline;
|
|
writing-mode: vertical-lr;
|
|
grid-area: auto / auto / 1 / 1;
|
|
inset: auto;
|
|
}
|
|
</style>
|
|
<div id="grid">
|
|
<div id="item">
|
|
X<br>XX<div id="abspos">XX</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
asyncTest(async done => {
|
|
await document.fonts.ready;
|
|
await animationFrame();
|
|
|
|
let abspos = document.getElementById("abspos");
|
|
println(`${abspos.offsetLeft},${abspos.offsetTop} ${abspos.offsetWidth}x${abspos.offsetHeight}`);
|
|
|
|
done();
|
|
});
|
|
</script>
|