From 28bda9f68b57925ddd281c3c3c3f64aef6f1495d Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Sun, 3 Sep 2023 19:45:18 +0200 Subject: [PATCH] Drop redundant styles from .grab-to-pan-grab:active `.grab-to-pan-grab:active` is `#viewerContainer` when the mouse is pressed down. It is supposed to have a `cursor: grabbing` appearance immediately on mousedown, `.grab-to-pan-grabbing` is the overlay that is supposed to cover everything, and also has the `cursor: grabbing` appearance. The "cover everything" result is achieved through `position:fixed`, `inset:0`, etc. The block with these CSS properties for "cover everything" is currently shared by `.grab-to-pan-grab:active` and `.grab-to-pan-grabbing`, but only "cursor" need to be shared. The original JS and CSS code at https://github.com/Rob--W/grab-to-pan.js shows that these were supposed to be associated with the overlay only. The PR that added this to PDF.js also shows that the "cover everything" CSS properties were supposed to be limited to the overlay only: https://github.com/mozilla/pdf.js/pull/4209#discussion-diff-9285917 But the final version of the PR mistakenly merged them together. This patch rectifies that mistake. --- web/viewer.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/viewer.css b/web/viewer.css index 0caed2f1ec808..7a16646dee705 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -1368,6 +1368,8 @@ dialog :link { .grab-to-pan-grab:active, .grab-to-pan-grabbing { cursor: grabbing !important; +} +.grab-to-pan-grabbing { position: fixed; background: rgba(0, 0, 0, 0); display: block;