about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-03-01 14:01:10 +0100
committerbptato <nincsnevem662@gmail.com>2024-03-01 14:01:10 +0100
commite0574a00c2c001671be825e55fecb741238b438b (patch)
treeb2d534c451324297c8c1029b6a40096051b505b8 /src/layout
parent87ba9a87be15abbe06837f1519cfb76f4bf759f3 (diff)
downloadchawan-e0574a00c2c001671be825e55fecb741238b438b.tar.gz
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.
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/engine.nim17
1 files changed, 1 insertions, 16 deletions
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