1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Fix new intermittent failures with ink and stamp tests

It happens only on windows with chrome.
For any reason, click event isn't correctly triggered and it seems work correctly
with pointerup.
And it seems that when drawing a svg on an OffscreenCanvas we need to wait
a little in order to be able to transfer it: it's why this patch adds
a check on the canvas content.
This commit is contained in:
Calixte Denizet 2023-09-29 22:36:01 +02:00
parent 3ca63c68ea
commit 077d239b96
3 changed files with 39 additions and 9 deletions

View file

@ -207,7 +207,18 @@ function getEditorDimensions(page, id) {
}
exports.getEditorDimensions = getEditorDimensions;
function serializeBitmapDimensions(page) {
async function serializeBitmapDimensions(page) {
await page.waitForFunction(() => {
try {
const map =
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable
.map;
return !!map;
} catch {
return false;
}
});
return page.evaluate(() => {
const { map } =
window.PDFViewerApplication.pdfDocument.annotationStorage.serializable;