Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/integration/reorganize_pages_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3084,6 +3084,12 @@ describe("Reorganize Pages View", () => {
() => parseInt(document.getElementById("pageNumber").max, 10) === 6
);

// Focus must move to the first newly inserted page (page 3, since
// we merged after page 2).
await page.waitForFunction(
() => window.PDFViewerApplication.page === 3
);

// Pages 1–2 come from the original document, then all 3 pages of
// the merged PDF, then pages 4–6 of the original shifted to the end.
await waitForHavingContents(page, [1, 2, 1, 2, 3, 3]);
Expand Down
5 changes: 5 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,11 @@ const PDFViewerApplication = {
return;
}
this._mergedDocumentNeedsSaving = true;

// The following line is necessary to fix bug 2034827.
// TODO: create an integration test that covers this case.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely clear on why this TODO is here given that this commit already extends the integration tests above to cover this case?

Aside from that, why does clearing the history here change the focus? It might be good to extend that part of the comment a bit, to indicate what the effect of this is in addition to the bug number it fixes.

this.pdfHistory = null;

this.open({
data: modifiedPdfBytes,
filename: this._docFilename,
Expand Down
Loading