Skip to content

Commit

Permalink
Paginator: fix changing background in Chromium
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfactotum committed Sep 23, 2024
1 parent 42ebb0a commit b8a0d11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit b8a0d11

Please sign in to comment.