[html-style-info] compact gnc:html-style-table-fetch

This commit is contained in:
Christopher Lam 2019-10-12 13:18:02 +08:00
parent 66e5bc8a58
commit 8e64fa7f65

View File

@ -355,20 +355,18 @@
s #f)))
(define (fetch-worker style antecedents)
(if (null? antecedents)
style
(let ((parent (car antecedents)))
(if (not parent)
(fetch-worker style (cdr antecedents))
(if (gnc:html-style-table-compiled? parent)
(cond
((null? antecedents) style)
((not (car antecedents)) (fetch-worker style (cdr antecedents)))
((gnc:html-style-table-compiled? (car antecedents))
(gnc:html-style-info-merge
style
(hash-ref (gnc:html-style-table-inheritable parent) markup))
style (hash-ref (gnc:html-style-table-inheritable (car antecedents)) markup)))
(else
(fetch-worker
(gnc:html-style-info-merge
style (get-inheritable-style
(gnc:html-style-table-primary parent)))
(cdr antecedents)))))))
(gnc:html-style-table-primary (car antecedents))))
(cdr antecedents)))))
(if (and table (gnc:html-style-table-compiled? table))
(hash-ref (gnc:html-style-table-compiled table) markup)
@ -378,7 +376,3 @@
(define (gnc:html-style-table-set! table markup style-info)
(hash-set! (gnc:html-style-table-primary table) markup style-info))