Skip to content
Bug reportNov 28, 2026· 0:33· 7 views

pdf.js Find Next scrolls backward in continuous view: 'figure' match on page 7 → viewer jumps to page 6

0:33 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumpdf.js find controller (PDFFindController match ordering within a page versus visual position) and scrollMatchIntoView in the viewer. Matches on a two-column page appear to follow text-content order rather than visual order, so Find Next can scroll backward in continuous mode.
os: macOSapp: pdf.js viewer (/pdf.js/web/viewer.html)dpr: 1locale: en-USbrowser: Chromium 151.0.7922.34document: compressed.tracemonkey-pldi-09.pdf (14 pages)timezone: Europe/Berlinviewport: 1280x720scroll_mode: continuous vertical

Repro steps

  1. 1.Open /pdf.js/web/viewer.html with compressed.tracemonkey-pldi-09.pdf. It shows page 1 of 14.
  2. 2.Change the zoom selector from Automatic Zoom to 125%.
  3. 3.Press Control+f to open the find bar.
  4. 4.Type 'figure'. The counter shows 1 of 27 matches on page 2.
  5. 5.Press Enter repeatedly (9 times) until the counter reads 10 of 27 matches. The highlight is on 'Figure 7 shows basic trace tree compilation' and the page indicator reads 7.
  6. 6.Press Enter once more (Find Next).
  7. 7.Observe the counter reads 11 of 27 matches. The viewer scrolls up to the 'Figure 5.' caption and the page indicator drops to 6.

Expected

Find Next moves to the next match further down the document. The viewport scrolls forward or stays in place, like the earlier presses that went from page 2 to page 3 to page 7.

Actual

From match 10 of 27 (page indicator 7, highlight on 'Figure 7 shows...' in Section 4), Find Next goes to match 11 of 27, the 'Figure 5.' caption at the top of the right column on page 6. The viewer scrolls backward and the page indicator changes from 7 to 6. Match 12 ('Figure 6.' caption) is also above the Section 4 text that held match 10. Only match 13 moves forward to the 'Figure 7.' caption on page 7.

Evidence

visualControl: forward navigation works. Match 1 of 27 is on page 2 ('Figure 1.' caption). The page indicator reads 2.
visualControl: match 2 of 27, page 2, highlight on the 'Figure 2.' caption.
visualControl: match 5 of 27, page 3, highlight on the 'Figure 3.' caption.
visualMatch 10 of 27. The page indicator reads 7. The highlight is on 'Figure 7 shows basic trace tree compilation' in Section 4, just above a page boundary. The page with Figures 7 and 8 is visible below.
visualAfter Enter at 17.5s, the counter shows 11 of 27 matches. The page indicator reads 6. The highlight is on the 'Figure 5.' caption at the top right of the page. The view scrolled backward.
visualAfter Enter at 20.9s, the counter shows 12 of 27 matches on page 6 ('Figure 6.' caption). The Section 4 text holding match 10 is visible below it, so this match is still behind the earlier one.
visualA dark overlay appears with the heading 'Find Next' and 'continuous scroll order', the line 'match 11/27: page 6' and 'delta: ? expected: positive'. The find bar counter at the same time reads 12 of 27.
consoleThree errors: 'Applying inline style violates the following Content Security Policy directive 'style-src 'self''... The action has been blocked.' They appear at the same time as the overlay and are likely unrelated to the find order.
visualAfter Enter at 27.6s, the counter shows 13 of 27 matches. The page indicator reads 7 and the highlight is on the 'Figure 7.' caption. Forward order resumes.
visualThe zoom selector reads 125% at 7s but reads Automatic Zoom at 9s after the search ran. This may be a separate issue.
consoleWarning 'No available adapters.' on load.
Issue markdown (copy-paste ready)
## Summary
In the pdf.js viewer, Find Next for `figure` scrolls backward in continuous view. From match 10 of 27 (page indicator 7), the next match (11 of 27) is the `Figure 5.` caption on page 6. The viewer jumps up and the page indicator changes from 7 to 6.

## Environment
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, DPR 1, en-US, Europe/Berlin
- `/pdf.js/web/viewer.html`, document `compressed.tracemonkey-pldi-09.pdf` (14 pages)

## Steps to reproduce
1. Open the viewer with `compressed.tracemonkey-pldi-09.pdf` (0s).
2. Set zoom to 125% (3s).
3. Press `Control+f` (6s) and type `figure`. The counter shows `1 of 27 matches` (9s).
4. Press Enter until the counter reads `10 of 27 matches` (15s). The highlight is on `Figure 7 shows basic trace tree compilation` and the page indicator reads 7.
5. Press Enter once more (17.5s).

## Expected
Find Next moves forward to the next match down the document. The viewport does not scroll back above the current match.

## Actual
- 19s: `11 of 27 matches`, page indicator 6, highlight on the `Figure 5.` caption at the top of the page. The view scrolled backward.
- 21s: `12 of 27 matches`, still page 6 (`Figure 6.` caption), above the text of match 10.
- 29s: `13 of 27 matches`, page 7 (`Figure 7.` caption). Forward order resumes.

## Control (works)
- 9s: match 1 on page 2. 11s: match 2 on page 2. 13s: match 5 on page 3. Each press moved forward.

## Evidence
- Visual: page indicator 7 at 15s, then 6 at 19s after one Find Next.
- Visual: overlay at 25s reads `delta: ? expected: positive`.
- Console (24.9s): three CSP `style-src 'self'` inline style errors. These appear with the overlay and are likely unrelated.
- Console (0s): `No available adapters.` warning.
- Side note: the zoom read 125% at 7s but Automatic Zoom at 9s after the search.

## Suspected area
Find controller match ordering within a two-column page. Matches seem to follow text-content order rather than visual position, so Find Next can scroll backward.

*Recorded with SceneRecap.*

This report was written by SceneRecap from a screen recording. Try SceneRecap free

Turn a screen recording into a bug report like this one.

Repro steps, expected vs actual and the console and network evidence, each with a timestamp. On every plan, Free included.

Try SceneRecap free →
pdf.js Find Next scrolls backward in continuous view: 'figure' match on page 7 → viewer jumps to page 6 · SceneRecap