Merge pull request #20884 from calixteman/fix_extract_text

Fix the issue in the ref test tracemonkey-extract_0_2_12
This commit is contained in:
Tim van der Meij 2026-03-15 20:41:00 +01:00 committed by GitHub
commit 1192e5e921
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -666,7 +666,7 @@ class Driver {
task.isOffscreenCanvasSupported === false ? false : undefined;
const disableFontFace = task.disableFontFace === true;
const loadingTask = getDocument({
const documentOptions = {
url: new URL(task.file, window.location),
password: task.password,
cMapUrl: CMAP_URL,
@ -682,12 +682,15 @@ class Driver {
isOffscreenCanvasSupported,
styleElement: xfaStyleElement,
disableFontFace,
});
};
const loadingTask = getDocument(documentOptions);
let promise = loadingTask.promise;
if (!this.masterMode && task.type === "extract") {
promise = promise.then(async doc => {
const data = await doc.extractPages([
const extractedDocumentOptions = { ...documentOptions };
delete extractedDocumentOptions.url;
extractedDocumentOptions.data = await doc.extractPages([
{
document: null,
includePages: task.includePages,
@ -695,7 +698,7 @@ class Driver {
]);
await loadingTask.destroy();
delete task.includePages;
return getDocument(data).promise;
return getDocument(extractedDocumentOptions).promise;
});
}