diff options
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/layout.nim | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/css/layout.nim b/src/css/layout.nim index b28aecc8..3ec833da 100644 --- a/src/css/layout.nim +++ b/src/css/layout.nim @@ -2422,18 +2422,16 @@ proc preLayoutTableRows(tctx: var TableContext; table: BlockBox) = var tfoot: seq[BlockBox] = @[] for child in table.children: let child = BlockBox(child) - case child.computed{"display"} - of DisplayTableRow: tbody.add(child) - of DisplayTableHeaderGroup: - for it in child.children: - thead.add(BlockBox(it)) - of DisplayTableRowGroup: - for it in child.children: - tbody.add(BlockBox(it)) - of DisplayTableFooterGroup: + let display = child.computed{"display"} + if display == DisplayTableRow: + tbody.add(child) + else: for it in child.children: - tfoot.add(BlockBox(it)) - else: assert false, $child.computed{"display"} + case display + of DisplayTableHeaderGroup: thead.add(BlockBox(it)) + of DisplayTableRowGroup: tbody.add(BlockBox(it)) + of DisplayTableFooterGroup: tfoot.add(BlockBox(it)) + else: assert false, $child.computed{"display"} tctx.preLayoutTableRows(thead, table) tctx.preLayoutTableRows(tbody, table) tctx.preLayoutTableRows(tfoot, table) |