about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-01 13:42:33 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-01 13:42:33 +0200
commita2467edbd458eed9bec16ec8cddcb89c86a0b156 (patch)
tree50a66a22a424eb3c595140ba63f260044b9d5930 /src/html
parent872e5c22493e3bfde6f818ec4362c205ba8e39d5 (diff)
downloadchawan-a2467edbd458eed9bec16ec8cddcb89c86a0b156.tar.gz
dom: fix previousElementSibling
(again. ouch.)
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 4afa953e..6e2e2a04 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -1607,8 +1607,8 @@ func previousElementSibling*(elem: Element): Element {.jsfget.} =
   if p == nil: return nil
   for i in countdown(elem.index - 1, 0):
     let node = p.childList[i]
-    if p.childList[i].nodeType == ELEMENT_NODE:
-      return elem
+    if node.nodeType == ELEMENT_NODE:
+      return Element(node)
   return nil
 
 func nextElementSibling*(elem: Element): Element {.jsfget.} =