about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/html/dom.nim3
-rw-r--r--src/io/buffer.nim2
-rw-r--r--src/layout/engine.nim2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 6788bd35..d5ee1015 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -163,6 +163,7 @@ type
 
 # For debugging
 func `$`*(node: Node): string =
+  if node == nil: return "nil"
   case node.nodeType
   of ELEMENT_NODE:
     let element = Element(node)
@@ -535,7 +536,7 @@ func newComment*(document: Document, data: string = ""): Comment =
   result.document = document
   result.data = data
 
-# note: we do not implement custom elements
+#TODO custom elements
 func newHTMLElement*(document: Document, tagType: TagType, namespace = Namespace.HTML, prefix = none[string]()): HTMLElement =
   case tagType
   of TAG_INPUT:
diff --git a/src/io/buffer.nim b/src/io/buffer.nim
index 0cfcbe18..a9843eb4 100644
--- a/src/io/buffer.nim
+++ b/src/io/buffer.nim
@@ -713,7 +713,7 @@ proc loadResources(buffer: Buffer, document: Document) =
   var stack: seq[Element]
   if document.html != nil:
     stack.add(document.html)
-  while stack.len > 0 and false: #TODO actually implement this
+  while stack.len > 0:
     let elem = stack.pop()
 
     if elem.tagType == TAG_LINK:
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index a21d444a..bdff8c64 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -688,7 +688,7 @@ proc generateFromElem(box: BlockBoxBuilder, styledNode: StyledNode, blockgroup:
     box.generateInlineBoxes(styledNode, blockgroup, viewport)
   of DISPLAY_INLINE_BLOCK:
     flush_ibox
-    let childbox = getInlineBlockBox(box.computed)
+    let childbox = getInlineBlockBox(styledNode.computed)
     childbox.content = styledNode.generateBlockBox(viewport)
     blockgroup.add(childbox)
   else: