about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-12 18:12:55 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-12 18:12:55 +0200
commit2f0ea08df1e6884da51ea510cc352395e853cfc0 (patch)
tree214aef273f772a8ad657039097cb7c9134ba9f7d /src/layout
parent1abd3aadf0c999c6e26ba4e7910b5abe3510c6c2 (diff)
downloadchawan-2f0ea08df1e6884da51ea510cc352395e853cfc0.tar.gz
Fix a tokenizer bug, clean up some warnings
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/engine.nim12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 3fe7af96..bf40f4b4 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -110,7 +110,6 @@ proc horizontalAlignRow(ictx: InlineContext, row: InlineRow, computed: CSSComput
       dec spaces
       if spaces > 0:
         let spacingwidth = (ictx.maxwidth - sumwidth) div spaces
-        let oldwidth = row.width
         row.width = 0
         for atom in row.atoms:
           atom.offset.x = row.width
@@ -474,7 +473,7 @@ proc buildInlineBlock(builder: InlineBlockBoxBuilder, parent: InlineContext, par
   assert builder.content != nil
   result = parentblock.newInlineBlock(builder)
 
-  let blockbuilder = BlockBoxBuilder(builder.content)
+  let blockbuilder = builder.content
   if blockbuilder.inlinelayout:
     # Builder only contains inline boxes.
     result.bctx.inline = result.bctx.buildInlines(blockbuilder.children)
@@ -520,9 +519,6 @@ proc buildInline(bctx: BlockContext, box: InlineBoxBuilder) =
   if padding_left > 0:
     box.ictx.thisrow.addSpacing(padding_left, box.ictx.cellheight, paddingformat)
 
-  let originalRow = box.ictx.thisrow
-  let originalWidth = box.ictx.thisrow.width
-
   for text in box.text:
     assert box.children.len == 0
     box.ictx.renderText(text, bctx.compwidth, box.computed, box.node)
@@ -674,12 +670,6 @@ func getInputBox(parent: BoxBuilder, input: HTMLInputElement, viewport: Viewport
   textbox.text.add(input.inputString())
   return textbox
 
-func getInputBox(computed: CSSComputedValues, input: HTMLInputElement, viewport: Viewport): InlineBoxBuilder =
-  let textbox = computed.getTextBox()
-  textbox.node = input
-  textbox.text.add(input.inputString())
-  return textbox
-
 # Don't generate empty anonymous inline blocks between block boxes
 func canGenerateAnonymousInline(blockgroup: seq[BoxBuilder], computed: CSSComputedValues, text: Text): bool =
   return blockgroup.len > 0 and blockgroup[^1].computed{"display"} == DISPLAY_INLINE or