From 39b6e1adf544649f3a0c566408fcaa882d07e46b Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Thu, 30 Jul 2026 11:44:21 +0200 Subject: [PATCH] solving bug in webview-get-style --- racket-webview.rkt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/racket-webview.rkt b/racket-webview.rkt index 505823e..a1d129d 100644 --- a/racket-webview.rkt +++ b/racket-webview.rkt @@ -1014,7 +1014,7 @@ ; ) (define/contract (webview-get-style wv selector styles) - (-> wv-win? (or/c symbol? string?) (or/c symbol? list-of-symbol?) (or/c list? hash?)) + (-> wv-win? (or/c symbol? string?) (or/c symbol? list-of-symbol?) (or/c list? hash? boolean?)) (let ((sel (if (symbol? selector) (format "#~a" selector) selector)) @@ -1025,8 +1025,7 @@ ; (list styles) ; styles))) ) - (let ((r (webview-call-js wv - (with-selector sel + (let* ((js-code (with-selector sel (λ (id el) (let ((cl (eval cl)) (r (make-hash))) @@ -1036,9 +1035,9 @@ (set! (js-ref r st) (js-ref stl st))))) (make-hash (list (list 'id id) - (list 'style r)))))) - ) - )) + (list 'style r))))))) + (r (webview-call-js wv js-code)) + ) ; (format ; (js-code ; "function(id, el) {" @@ -1051,6 +1050,7 @@ ; " return { id: id, style: r };" ; "}") cl)) ; ))) + (displayln (format "~a: ~a" r js-code)) (if (eq? r #f) #f (let ((h (hash-ref r 'with-ids)))