about summary refs log tree commit diff stats
path: root/src/html/env.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-21 00:37:33 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-21 00:37:33 +0100
commite00dfe404a8ff9ad8161d38160edc847526ad06b (patch)
tree6af9240a595d9224dfb5b533b64fec4f3f54c50c /src/html/env.nim
parentaa1866cd238c8ebfdd2c1d0aac3d534e5dc94dc1 (diff)
downloadchawan-e00dfe404a8ff9ad8161d38160edc847526ad06b.tar.gz
env: stub out window.getComputedStyle()
not a real implementation, just to reduce exceptions
Diffstat (limited to 'src/html/env.nim')
-rw-r--r--src/html/env.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/html/env.nim b/src/html/env.nim
index d4adeacf..9d0516fe 100644
--- a/src/html/env.nim
+++ b/src/html/env.nim
@@ -116,6 +116,11 @@ proc atob(window: Window, data: string): DOMResult[NarrowString] {.jsfunc.} =
 proc btoa(window: Window, data: JSString): DOMResult[string] {.jsfunc.} =
   return btoa(data)
 
+proc getComputedStyle(window: Window, element: Element,
+    pseudoElt = none(Element)): JSResult[CSSStyleDeclaration] {.jsfunc.} =
+  #TODO implement this properly
+  return ok(element.style)
+
 proc addScripting*(window: Window, selector: Selector[int]) =
   let rt = newJSRuntime()
   let ctx = rt.newJSContext()