about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-07 00:39:29 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-07 00:43:11 +0100
commitc59356f7fb5f58955d5153a05fb37f9eb226d971 (patch)
tree9efd9871e6727aba01f6f12c40f2de2ebde6b042 /src
parent666817d9e1a80c4fe1b63ac101e172fd9067b4ba (diff)
downloadchawan-c59356f7fb5f58955d5153a05fb37f9eb226d971.tar.gz
dom: another insertAdjacentHTML fix
ctx can be HTML even if we take `this'
Diffstat (limited to 'src')
-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 19828381..1cb0a672 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -4919,8 +4919,8 @@ proc insertAdjacentHTML(this: Element; position, text: string):
       return errDOMException("Parent is not a valid element",
         "NoModificationAllowedError")
     ctx = this.parentElement
-    if ctx == nil or not this.document.isxml and ctx.tagType == TAG_HTML:
-      ctx = this.document.newHTMLElement(TAG_BODY)
+  if ctx == nil or not this.document.isxml and ctx.tagType == TAG_HTML:
+    ctx = this.document.newHTMLElement(TAG_BODY)
   let fragment = ctx.fragmentParsingAlgorithm(text)
   case position
   of iapBeforeBegin: this.parentNode.insert(fragment, this)