From e00dfe404a8ff9ad8161d38160edc847526ad06b Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 21 Nov 2023 00:37:33 +0100 Subject: env: stub out window.getComputedStyle() not a real implementation, just to reduce exceptions --- src/html/env.nim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/html/env.nim') 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() -- cgit 1.4.1-2-gfad0