about summary refs log tree commit diff stats
path: root/src/html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-01 19:26:32 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-01 19:57:54 +0200
commit2b10a9b7f61d58157f85c93e8e7b18b1e01e4b79 (patch)
treea6c544e5c0e49578d847985945448344540a9f7f /src/html
parentef136ac44db26074bf9528f17dee764f731ed4eb (diff)
downloadchawan-2b10a9b7f61d58157f85c93e8e7b18b1e01e4b79.tar.gz
use =destroy instead of finalizers
This should help with moving to ORC in the future. (Also, finalizers
do not work very well in the first place.)
Diffstat (limited to 'src/html')
-rw-r--r--src/html/dom.nim53
-rw-r--r--src/html/htmlparser.nim2
2 files changed, 55 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index 048e40af..bf8e0fcc 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -367,6 +367,59 @@ type
   HTMLImageElement* = ref object of HTMLElement
     bitmap*: Bitmap
 
+jsDestructor(Navigator)
+jsDestructor(PluginArray)
+jsDestructor(MimeTypeArray)
+jsDestructor(Window)
+
+jsDestructor(console)
+jsDestructor(Element)
+jsDestructor(HTMLElement)
+jsDestructor(HTMLInputElement)
+jsDestructor(HTMLAnchorElement)
+jsDestructor(HTMLSelectElement)
+jsDestructor(HTMLSpanElement)
+jsDestructor(HTMLOptGroupElement)
+jsDestructor(HTMLOptionElement)
+jsDestructor(HTMLHeadingElement)
+jsDestructor(HTMLBRElement)
+jsDestructor(HTMLMenuElement)
+jsDestructor(HTMLUListElement)
+jsDestructor(HTMLOListElement)
+jsDestructor(HTMLLIElement)
+jsDestructor(HTMLStyleElement)
+jsDestructor(HTMLLinkElement)
+jsDestructor(HTMLFormElement)
+jsDestructor(HTMLTemplateElement)
+jsDestructor(HTMLUnknownElement)
+jsDestructor(HTMLScriptElement)
+jsDestructor(HTMLBaseElement)
+jsDestructor(HTMLAreaElement)
+jsDestructor(HTMLButtonElement)
+jsDestructor(HTMLTextAreaElement)
+jsDestructor(HTMLLabelElement)
+jsDestructor(HTMLCanvasElement)
+jsDestructor(HTMLImageElement)
+jsDestructor(EventTarget)
+jsDestructor(Node)
+jsDestructor(NodeList)
+jsDestructor(HTMLCollection)
+jsDestructor(Location)
+jsDestructor(Document)
+jsDestructor(DOMImplementation)
+jsDestructor(DOMTokenList)
+jsDestructor(Comment)
+jsDestructor(CDATASection)
+jsDestructor(DocumentFragment)
+jsDestructor(ProcessingInstruction)
+jsDestructor(CharacterData)
+jsDestructor(Text)
+jsDestructor(DocumentType)
+jsDestructor(Attr)
+jsDestructor(NamedNodeMap)
+jsDestructor(CanvasRenderingContext2D)
+jsDestructor(TextMetrics)
+
 proc parseColor(element: Element, s: string): RGBAColor
 
 proc resetTransform(state: var DrawingState) =
diff --git a/src/html/htmlparser.nim b/src/html/htmlparser.nim
index c3df8e3d..9f9d4b85 100644
--- a/src/html/htmlparser.nim
+++ b/src/html/htmlparser.nim
@@ -60,6 +60,8 @@ type
     AFTER_BODY, IN_FRAMESET, AFTER_FRAMESET, AFTER_AFTER_BODY,
     AFTER_AFTER_FRAMESET
 
+jsDestructor(DOMParser)
+
 proc resetInsertionMode(parser: var HTML5Parser) =
   template switch_insertion_mode_and_return(mode: InsertionMode) =
     parser.insertionMode = mode