From 5d81fe5098c85f337ee7c93ac4927995aff00c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 25 Jun 2026 15:55:26 +0200 Subject: [PATCH] Move SVG text selection styles to pdf_viewer.css draw_layer_builder.css, which originally included these styles, is not loaded in GECKOVIEW. This is because it also includes all the styles related to highlights and drawing, which are only supported in the main viewer. The new SVG-based highlights are also used in GECKOVIEW, so even though the JS logic for them lives in the DrawLayer builder, we need to move the CSS somewhere where we know it's going to be loaded. --- web/draw_layer_builder.css | 10 ---------- web/pdf_viewer.css | 13 +++++++++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/web/draw_layer_builder.css b/web/draw_layer_builder.css index bee793d11..5ea206ced 100644 --- a/web/draw_layer_builder.css +++ b/web/draw_layer_builder.css @@ -14,16 +14,6 @@ */ .canvasWrapper { - .selection { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; - background: rgb(0 90 255 / 0.22); - } - svg { transform: none; diff --git a/web/pdf_viewer.css b/web/pdf_viewer.css index b32fb4743..e787cc8e1 100644 --- a/web/pdf_viewer.css +++ b/web/pdf_viewer.css @@ -120,6 +120,19 @@ image-rendering: pixelated; } } + + /* Used by the DrawLayer, but we keep these styles here and not in + * draw_layer_builder.css because we need them to be loaded in GECKOVIEW for + * text selection. */ + .selection { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: none; + background: rgb(0 90 255 / 0.22); + } } }