about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-09-24 01:43:33 +0200
committerbptato <nincsnevem662@gmail.com>2024-09-24 01:44:20 +0200
commitd7085253b704f8f0e31fa1cacf82a55399565da1 (patch)
tree5608c96107166d7192f3009595a3ee700cb4c0eb
parentfcd9aa9f9c604ed5d104343542962a26b2acda62 (diff)
downloadchawan-d7085253b704f8f0e31fa1cacf82a55399565da1.tar.gz
buffer: allow button nested in a
for compatibility with other browsers...
-rw-r--r--src/server/buffer.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index 8adc3fd5..c5d00655 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -319,6 +319,9 @@ func isClickable(styledNode: StyledNode): bool =
   let element = Element(styledNode.node)
   if element of HTMLAnchorElement:
     return HTMLAnchorElement(element).href != ""
+  if element of FormAssociatedElement:
+    if FormAssociatedElement(element).form == nil:
+      return false
   return element.tagType in ClickableElements
 
 func getClickable(styledNode: StyledNode): Element =
@@ -327,6 +330,7 @@ func getClickable(styledNode: StyledNode): Element =
     if styledNode.isClickable():
       return Element(styledNode.node)
     styledNode = styledNode.parent
+  return nil
 
 proc submitForm(buffer: Buffer; form: HTMLFormElement; submitter: Element):
   Request