From b8a0d1191063779ef91c5246431e0171574d054a Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:48:11 +0800 Subject: [PATCH] Paginator: fix changing background in Chromium --- paginator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paginator.js b/paginator.js index 8668922..7ea374c 100644 --- a/paginator.js +++ b/paginator.js @@ -1003,7 +1003,9 @@ export class Paginator extends HTMLElement { $style.textContent = style } 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 this.#view?.document?.fonts?.ready?.then(() => this.#view.expand())