diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-25 21:42:48 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-25 21:42:48 +0100 |
commit | 041219b67de28fd7d18daa6b17f85d625108d8f3 (patch) | |
tree | c112526cfc43a9e38a9136aa9c35da40dda0a305 /src/layout | |
parent | e87109683acf7c11462dd53684c076a6f7724a63 (diff) | |
download | chawan-041219b67de28fd7d18daa6b17f85d625108d8f3.tar.gz |
Fix an anonymous table bug
...by flushing anonymous tables *before* inline layout is set (therefore avoiding placing them inside inline boxes.)
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 813400b4..45662888 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -1444,13 +1444,19 @@ proc generateBlockBox(styledNode: StyledNode, viewport: Viewport, marker = none( ctx.generateInnerBlockBox() + # Flush anonymous tables here, to avoid setting inline layout with tables. + ctx.flushTableRow() + ctx.flushTable() + # (flush here, because why not) + ctx.flushInherit() + # Avoid unnecessary anonymous block boxes. This also helps set our layout to # inline even if no inner anonymous block was generated. if box.children.len == 0: box.children = ctx.blockgroup.boxes box.inlinelayout = true ctx.blockgroup.boxes.setLen(0) - ctx.flush() + ctx.blockgroup.flush() return box proc generateTableCellBox(styledNode: StyledNode, viewport: Viewport, parent: var InnerBlockContext): TableCellBoxBuilder = |