Repository navigation
Commit 1bee03c
A block-level aspect-ratio box inside a float grows when its content changes
<div style="float: left">
<div style="aspect-ratio: 1">
<div style="height: 100%; aspect-ratio: 2">
<div style="width: 20px; height: 5px"></div>
</div>
</div>
</div>
The aspect-ratio box should stay 20px wide when its content changes. Instead it doubled on every change.
availableLogicalHeightForPercentageComputation() derives the box's height from logicalWidth(), which still holds the previous layout's width while the box measures its own intrinsic widths.
It uses dirty bits to signal intrinsic width computation, and only for grid and shrink-to-fit boxes, so the float's measurement of this block-level box feeds the old width back in.
Let's mark the box while it measures its own intrinsic widths instead, with IntrinsicLogicalWidthComputationScope (the inline-axis counterpart of IntrinsicLogicalHeightComputationScope), and bail out only inside that scope.
WebKit-Bug: https://bugs.webkit.org/show_bug.cgi?id=325890
WebKit-Canonical-Link: https://commits.webkit.org/322742@main1 parent 4882c7a commit 1bee03c
2 files changed
Lines changed: 77 additions & 0 deletions
File tree
- css/css-sizing/aspect-ratio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments