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