Paginator: fix changing background in Chromium

This commit is contained in:
John Factotum
2024-09-23 16:48:11 +08:00
parent 42ebb0aec4
commit b8a0d11910
+3 -1
View File
@@ -1003,7 +1003,9 @@ export class Paginator extends HTMLElement {
$style.textContent = style $style.textContent = style
} else $style.textContent = styles } else $style.textContent = styles
this.#background.style.background = getBackground(this.#view.document) // NOTE: needs `requestAnimationFrame` in Chromium
requestAnimationFrame(() =>
this.#background.style.background = getBackground(this.#view.document))
// needed because the resize observer doesn't work in Firefox // needed because the resize observer doesn't work in Firefox
this.#view?.document?.fonts?.ready?.then(() => this.#view.expand()) this.#view?.document?.fonts?.ready?.then(() => this.#view.expand())