diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/css/layout.nim | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim index f32cba2c..3372d9da 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -1796,13 +1796,11 @@ proc layoutTableCell(lctx: LayoutContext; box: BlockBox; space: AvailableSpace) = var sizes = ResolvedSizes( padding: lctx.resolvePadding(space.w, box.computed), - space: space, + space: availableSpace(w = space.w, h = maxContent()), bounds: DefaultBounds ) if sizes.space.w.isDefinite(): sizes.space.w.u -= sizes.padding[dtHorizontal].sum() - if sizes.space.h.isDefinite(): - sizes.space.h.u -= sizes.padding[dtVertical].sum() box.state = BoxLayoutState() var bctx = BlockContext(lctx: lctx) bctx.layoutFlow(box, sizes) @@ -1812,6 +1810,9 @@ proc layoutTableCell(lctx: LayoutContext; box: BlockBox; # If the highest float edge is higher than the box itself, set that as # the box height. box.state.size.h = max(box.state.size.h, bctx.maxFloatHeight) + if space.h.t == scStretch: + box.state.size.h = max(box.state.size.h, space.h.u - + sizes.padding[dtVertical].sum()) # A table cell's minimum width overrides its width. box.state.size.w = max(box.state.size.w, box.state.xminwidth) |