aboutsummaryrefslogtreecommitdiffstats
path: root/src/html/catom.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-11-09 16:14:53 +0100
committerbptato <nincsnevem662@gmail.com>2024-11-09 16:34:26 +0100
commit074d86a867c20d6e9daf164e5d03a81cf7ecb2b4 (patch)
tree2b398d7ce3d29c4b8165f21249414ce12bfe5a69 /src/html/catom.nim
parentf6d7c5372b81b9cf7ce76df67b0e61981f96d60f (diff)
downloadchawan-074d86a867c20d6e9daf164e5d03a81cf7ecb2b4.tar.gz
dom: support all HTMLHyperlinkElementUtils getters
Diffstat (limited to 'src/html/catom.nim')
-rw-r--r--src/html/catom.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/html/catom.nim b/src/html/catom.nim
index c0263d95..8ac023ab 100644
--- a/src/html/catom.nim
+++ b/src/html/catom.nim
@@ -47,7 +47,10 @@ macro makeStaticAtom =
satFormaction = "formaction"
satFormenctype = "formenctype"
satFormmethod = "formmethod"
+ satHash = "hash"
satHeight = "height"
+ satHost = "host"
+ satHostname = "hostname"
satHref = "href"
satId = "id"
satIntegrity = "integrity"
@@ -67,13 +70,19 @@ macro makeStaticAtom =
satNovalidate = "novalidate"
satOnclick = "onclick"
satOnload = "onload"
+ satOrigin = "origin"
+ satPassword = "password"
+ satPathname = "pathname"
+ satPort = "port"
satProgress = "progress"
+ satProtocol = "protocol"
satReadystatechange = "readystatechange"
satReferrerpolicy = "referrerpolicy"
satRel = "rel"
satRequired = "required"
satRows = "rows"
satRowspan = "rowspan"
+ satSearch = "search"
satSelected = "selected"
satSize = "size"
satSizes = "sizes"
@@ -90,6 +99,7 @@ macro makeStaticAtom =
satTouchstart = "touchstart"
satType = "type"
satUsemap = "usemap"
+ satUsername = "username"
satValign = "valign"
satValue = "value"
satWheel = "wheel"
@@ -220,6 +230,12 @@ proc fromJS*(ctx: JSContext; val: JSAtom; res: var CAtom): Opt[void] =
res = ctx.getFactoryImpl().toAtom(s)
return ok()
+proc fromJS*(ctx: JSContext; val: JSAtom; res: var StaticAtom): Opt[void] =
+ var ca: CAtom
+ ?ctx.fromJS(val, ca)
+ res = ctx.getFactoryImpl().toStaticAtom(ca)
+ return ok()
+
proc toJS*(ctx: JSContext; atom: CAtom): JSValue =
return ctx.toJS(ctx.getFactoryImpl().toStr(atom))