about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-28 01:08:04 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-28 01:09:09 +0200
commit3f919dda32231276c9388e1f1278d73465c14e3e (patch)
tree7a8f644f2ec37d0225d60b0077283399f5b71a3d
parent03bbf7f451a638e2d1b4dff7ef659d70d576ff01 (diff)
downloadchawan-3f919dda32231276c9388e1f1278d73465c14e3e.tar.gz
layout: fix crash on inline tables
-rw-r--r--src/layout/engine.nim2
-rw-r--r--test/layout/inline-table.expected2
-rw-r--r--test/layout/inline-table.html1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 0f98417f..ddbb4802 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -1446,7 +1446,7 @@ proc layoutChildren(ictx: var InlineContext; state: var InlineState;
     case child.computed{"display"}
     of DisplayInline:
       state.fragment.children.add(ictx.layoutInline(child))
-    of DisplayInlineBlock, DisplayInlineTable, DisplayInlineFlex:
+    of DisplayInlineBlock, DisplayInlineTableWrapper, DisplayInlineFlex:
       # Note: we do not need a separate inline fragment here, because the tree
       # generator already does an iflush() before adding inline blocks.
       let w = fitContent(ictx.space.w)
diff --git a/test/layout/inline-table.expected b/test/layout/inline-table.expected
new file mode 100644
index 00000000..8405060b
--- /dev/null
+++ b/test/layout/inline-table.expected
@@ -0,0 +1,2 @@
+
+test
diff --git a/test/layout/inline-table.html b/test/layout/inline-table.html
new file mode 100644
index 00000000..50299e00
--- /dev/null
+++ b/test/layout/inline-table.html
@@ -0,0 +1 @@
+<div style="display: inline-table">test</div>