mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb: Use caption content width for inline layout in table captions
Previously, `run_caption_layout()` passed the table's border-box width as the available space to the caption's formatting context. The BFC then used this width directly for inline line breaking, causing text to overflow the caption's content box by the size of the caption's own border and padding.
This commit is contained in:
committed by
Sam Atkins
parent
6f3833e857
commit
d8825c89af
Notes:
github-actions[bot]
2026-04-22 14:36:15 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d8825c89afc Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8797 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: 'Ahem';
|
||||
src: url('../../../Ref/data/fonts/Ahem.ttf');
|
||||
}
|
||||
table {
|
||||
border: 1px solid black;
|
||||
font: 10px/1 Ahem;
|
||||
}
|
||||
caption {
|
||||
padding: 0 6px;
|
||||
border: 1px solid gray;
|
||||
}
|
||||
</style>
|
||||
<table>
|
||||
<!-- The text should not overflow the table border -->
|
||||
<caption>AAAAAAAAAA BBBBBBBBB CCCC</caption>
|
||||
<tr><td style="width: 200px">x</td></tr>
|
||||
</table>
|
||||
Reference in New Issue
Block a user