Force the text selection color to be in light mode

Most of the pdfs have a white background, so it makes sense to use the colors for light mode.
This commit is contained in:
Calixte Denizet 2026-05-25 09:08:42 +02:00
parent 5f2691e77d
commit f7af3ea9ac

View File

@ -132,6 +132,9 @@ class DOMFilterFactory extends BaseFilterFactory {
if (!this.#_defs) {
const div = this.#document.createElement("div");
const { style } = div;
// The pdf colors are mostly in light mode (white background with a black
// foreground), so the filters are created in light mode.
style.colorScheme = "only light";
style.visibility = "hidden";
style.contain = "strict";
style.width = style.height = 0;