Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox v130+ fixes improvements #6559

Merged
merged 3 commits into from
Sep 18, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/annotator/anchoring/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const isNotSpace = (char: string) => !isSpace(char);

/**
* Determines if provided text layer is done rendering.
* It works on older PDF.js versions which expose a public renderingDone prop,
* It works on older PDF.js versions which expose a public `renderingDone` prop,
* and newer versions as well
*/
export function isTextLayerRenderingDone(textLayer: TextLayer): boolean {
Expand Down
26 changes: 15 additions & 11 deletions src/annotator/anchoring/test/pdf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,18 +741,22 @@ describe('annotator/anchoring/pdf', () => {
});

[
{ element: null, expectedResult: false },
{ element: {}, expectedResult: true },
].forEach(({ element, expectedResult }) => {
{ div: document.createElement('div'), expectedResult: false },
{
div: (function () {
const div = document.createElement('div');

const endOfContent = document.createElement('div');
endOfContent.className = 'endOfContent';
div.append(endOfContent);

return div;
})(),
expectedResult: true,
},
].forEach(({ div, expectedResult }) => {
it('returns true if the div contains an endOfContent element', () => {
assert.equal(
isTextLayerRenderingDone({
div: {
querySelector: () => element,
},
}),
expectedResult,
);
assert.equal(isTextLayerRenderingDone({ div }), expectedResult);
});
});
});
Expand Down
1 change: 1 addition & 0 deletions src/types/pdfjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export type PDFViewerApplication = {
* Indicates the download of the PDF has completed.
* This prop is not set in PDF.js >=4.5, in which case you should use
* `PDFViewerApplication.pdfDocument.getDownloadInfo()` instead.
* See https://github.com/mozilla/pdf.js/pull/18463/commits/64a4f0dc7e60e86a7c1da1dc903497fff71abe2c
*
* @see {PDFDocument}
*/
Expand Down