aboutsummaryrefslogtreecommitdiffstats
path: root/src/css
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-15 20:54:47 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-15 21:02:21 +0100
commit1718e2a7c1852a1bc3722d1a42a18b7a6ab2d879 (patch)
treec200c3264d516619c743e77c96eddeec6d25ccd7 /src/css
parentd9a296775d43d3132a0a4b7eef64bdc4287acf90 (diff)
downloadchawan-1718e2a7c1852a1bc3722d1a42a18b7a6ab2d879.tar.gz
layout: set table intrinsic min width to specified width
Diffstat (limited to 'src/css')
-rw-r--r--src/css/layout.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim
index 3372d9da..1539e5c1 100644
--- a/src/css/layout.nim
+++ b/src/css/layout.nim
@@ -2191,6 +2191,8 @@ proc layoutCaption(tctx: TableContext; parent, box: BlockBox) =
# cell's width to min_width, then re-do the distribution.
proc layoutTable(tctx: var TableContext; table: BlockBox;
sizes: ResolvedSizes) =
+ if tctx.space.w.t == scStretch:
+ table.state.xminwidth = tctx.space.w.u
let lctx = tctx.lctx
if table.computed{"border-collapse"} != BorderCollapseCollapse:
let spc = table.computed{"border-spacing"}
@@ -2216,6 +2218,7 @@ proc layoutTableWrapper(bctx: BlockContext; box: BlockBox;
box.state.size = table.state.size
box.state.baseline = table.state.size.h
box.state.firstBaseline = table.state.size.h
+ box.state.xminwidth = table.state.xminwidth
if box.children.len > 1:
# do it here, so that caption's box can stretch to our width
let caption = box.children[1]