diff options
-rw-r--r-- | src/html/dom.nim | 2 | ||||
-rw-r--r-- | src/html/env.nim | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index fb9e21b7..e813460d 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -2322,7 +2322,7 @@ proc getter[T: uint32|string](this: CSSStyleDeclaration, u: T): return ok(this.getPropertyValue(u)) return err() -proc style(element: Element): CSSStyleDeclaration {.jsfget.} = +proc style*(element: Element): CSSStyleDeclaration {.jsfget.} = if element.style_cached == nil: element.style_cached = CSSStyleDeclaration(element: element) return element.style_cached 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() |