diff options
author | bptato <nincsnevem662@gmail.com> | 2023-07-04 23:39:11 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-07-04 23:39:11 +0200 |
commit | ecd97e8baf04c34eaf34353f66b136efce17e55d (patch) | |
tree | 59d225caa6b97b4d6b465ffda765e2a057e79a5e /src/html | |
parent | aeba0d4737cbdd1f4cde4300cdc338eb8e10ff3d (diff) | |
download | chawan-ecd97e8baf04c34eaf34353f66b136efce17e55d.tar.gz |
dom: work around bad codegen
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/dom.nim | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 820e63f9..e203dda1 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2387,10 +2387,12 @@ proc setForm*(element: FormAssociatedElement, form: HTMLFormElement) = proc resetFormOwner(element: FormAssociatedElement) = element.parserInserted = false - if element.form != nil and - element.tagType notin ListedElements or not element.attrb("form") and - element.findAncestor({TAG_FORM}) == element.form: - return + if element.form != nil: + if element.tagType notin ListedElements: + return + let lastForm = element.findAncestor({TAG_FORM}) + if not element.attrb("form") and lastForm == element.form: + return element.form = nil if element.tagType in ListedElements and element.attrb("form") and element.isConnected: let form = element.attr("form") |