From e0574a00c2c001671be825e55fecb741238b438b Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 1 Mar 2024 14:01:10 +0100 Subject: css: remove caption-side: left, right, fix caption-side: bottom left/right never really worked correctly, is non-standard, and the only browser that supported it (Firefox) removed it years ago. bottom was adding the table width to its offset instead of the height, that is now fixed. --- src/layout/engine.nim | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/layout/engine.nim') diff --git a/src/layout/engine.nim b/src/layout/engine.nim index c0b29e5e..7e65bac6 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -2028,25 +2028,10 @@ proc addTableCaption(ctx: TableContext, table: BlockBox, of CAPTION_SIDE_BOTTOM, CAPTION_SIDE_BLOCK_END: let caption = lctx.buildTableCaption(ctx.caption, stretch(table.size.w), maxContent()) - caption.offset.y += table.size.w + caption.offset.y += table.size.h table.nested.add(caption) table.size.h += caption.size.h table.size.w = max(table.size.w, caption.size.w) - of CAPTION_SIDE_LEFT, CAPTION_SIDE_INLINE_START: - let caption = lctx.buildTableCaption(ctx.caption, - fitContent(sizes.space.w), fitContent(table.size.h)) - for r in table.nested: - r.offset.x += caption.size.w - table.nested.insert(caption, 0) - table.size.w += caption.size.w - table.size.h = max(table.size.h, caption.size.h) - of CAPTION_SIDE_RIGHT, CAPTION_SIDE_INLINE_END: - let caption = lctx.buildTableCaption(ctx.caption, - fitContent(sizes.space.w), fitContent(table.size.h)) - caption.offset.x += table.size.w - table.nested.add(caption) - table.size.w += caption.size.w - table.size.h = max(table.size.h, caption.size.h) # Table layout. We try to emulate w3m's behavior here: # 1. Calculate minimum and preferred width of each column -- cgit 1.4.1-2-gfad0