about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-26 13:48:47 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-26 13:48:47 +0100
commitca88af27d30722b6ecb6cc7dd47e572526218eae (patch)
tree255edb94b2870ca9af78970b46cf86f1c85f3d0a /src/layout
parent041219b67de28fd7d18daa6b17f85d625108d8f3 (diff)
downloadchawan-ca88af27d30722b6ecb6cc7dd47e572526218eae.tar.gz
layout/engine: calculate wrappervals only if needed
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/engine.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 45662888..c5536517 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -1226,9 +1226,9 @@ proc flushTableRow(ctx: var InnerBlockContext) =
     if ctx.blockgroup.parent.computed{"display"} == DISPLAY_TABLE_ROW:
       ctx.blockgroup.parent.children.add(ctx.anonRow)
     else:
-      var wrappervals = ctx.styledNode.computed.inheritProperties()
-      wrappervals{"display"} = DISPLAY_TABLE
       if ctx.anonTable == nil:
+        var wrappervals = ctx.styledNode.computed.inheritProperties()
+        wrappervals{"display"} = DISPLAY_TABLE
         ctx.anonTable = getTableBox(wrappervals)
       ctx.anonTable.children.add(ctx.anonRow)
     ctx.anonRow = nil