solving bug in webview-get-style

This commit is contained in:
2026-07-30 11:44:21 +02:00
parent d8ed6235ef
commit 39b6e1adf5
+6 -6
View File
@@ -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)))