about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-11-22 20:18:53 +0100
committerbptato <nincsnevem662@gmail.com>2024-11-22 20:24:54 +0100
commit6e7cae47b2037860f53d4ae90d37a91d8b29906b (patch)
treedb8966bced3b74e25dd4c2bf824d130fee41be7c /src
parent7d549f10ba356486201645ae11fc4796ef5a4441 (diff)
downloadchawan-6e7cae47b2037860f53d4ae90d37a91d8b29906b.tar.gz
dom: implement HTMLDocument, make Image C/W
* add HTMLDocument as alias to Document
* set Image as configurable/writable

So looking closer, HTMLDocument *is* specified, just major browsers
don't follow the spec.

I doubt this incompatibility causes issues, anyway.
Diffstat (limited to 'src')
-rw-r--r--src/html/dom.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index b7ecffe0..70a9277c 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -4995,7 +4995,9 @@ return x;
 """)
   doAssert JS_SetConstructorBit(ctx, imageFun, true)
   let jsWindow = JS_GetGlobalObject(ctx)
-  ctx.defineProperty(jsWindow, "Image", imageFun)
+  ctx.definePropertyCW(jsWindow, "Image", imageFun)
+  ctx.definePropertyCW(jsWindow, "HTMLDocument",
+    JS_GetPropertyStr(ctx, jsWindow, "Document"))
   JS_FreeValue(ctx, jsWindow)
 
 # Forward declaration hack