Bug 1895324 - Update PDF.js to 14e87469dbb04fa0e9e6f7ec23e5c9d7b283e901 r=pdfjs-reviewers,calixte

Differential Revision: https://phabricator.services.mozilla.com/D209575
This commit is contained in:
Updatebot 2024-05-06 19:36:08 +00:00
Родитель 92766666d5
Коммит f2cb7dd042
7 изменённых файлов: 51 добавлений и 69 удалений

Просмотреть файл

@ -674,4 +674,4 @@ mozilla-pdf.js:
fetch:
type: git
repo: https://github.com/mozilla/pdf.js
revision: d64f334f98d4b7f1c2e09a731a63b68629c946f9
revision: 14e87469dbb04fa0e9e6f7ec23e5c9d7b283e901

Просмотреть файл

@ -1448,10 +1448,8 @@ function isDataScheme(url) {
function isPdfFile(filename) {
return typeof filename === "string" && /\.pdf$/i.test(filename);
}
function getFilenameFromUrl(url, onlyStripPath = false) {
if (!onlyStripPath) {
[url] = url.split(/[#?]/, 1);
}
function getFilenameFromUrl(url) {
[url] = url.split(/[#?]/, 1);
return url.substring(url.lastIndexOf("/") + 1);
}
function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") {
@ -9353,7 +9351,7 @@ function getDocument(src) {
}
const fetchDocParams = {
docId,
apiVersion: "4.3.8",
apiVersion: "4.3.18",
data,
password,
disableAutoFetch,
@ -11013,8 +11011,8 @@ class InternalRenderTask {
}
}
}
const version = "4.3.8";
const build = "c419c8333";
const version = "4.3.18";
const build = "14e87469d";
;// CONCATENATED MODULE: ./src/shared/scripting_utils.js
function makeColorComp(n) {
@ -13551,17 +13549,13 @@ class FileAttachmentAnnotationElement extends AnnotationElement {
isRenderable: true
});
const {
filename,
content,
description
} = this.data.file;
this.filename = getFilenameFromUrl(filename, true);
this.content = content;
file
} = this.data;
this.filename = file.filename;
this.content = file.content;
this.linkService.eventBus?.dispatch("fileattachmentannotation", {
source: this,
filename,
content,
description
...file
});
}
render() {
@ -17804,8 +17798,8 @@ class DrawLayer {
const pdfjsVersion = "4.3.8";
const pdfjsBuild = "c419c8333";
const pdfjsVersion = "4.3.18";
const pdfjsBuild = "14e87469d";
var __webpack_exports__AbortException = __webpack_exports__.AbortException;
var __webpack_exports__AnnotationEditorLayer = __webpack_exports__.AnnotationEditorLayer;

Просмотреть файл

@ -3956,8 +3956,8 @@ function initSandbox(params) {
;// CONCATENATED MODULE: ./src/pdf.scripting.js
const pdfjsVersion = "4.3.8";
const pdfjsBuild = "c419c8333";
const pdfjsVersion = "4.3.18";
const pdfjsBuild = "14e87469d";
globalThis.pdfjsScripting = {
initSandbox: initSandbox
};

Просмотреть файл

@ -7508,7 +7508,7 @@ class JpegStream extends DecodeStream {
;// CONCATENATED MODULE: ./external/openjpeg/openjpeg.js
var OpenJPEG = (() => {
var _scriptDir = "file:///home/calixte/dev/mozilla/pdf.js.release/external/openjpeg/openjpeg.js";
var _scriptDir = "file:///builds/worker/pdf.js/external/openjpeg/openjpeg.js";
return function (moduleArg = {}) {
var Module = moduleArg;
var readyPromiseResolve, readyPromiseReject;
@ -33978,6 +33978,9 @@ function clearGlobalCaches() {
function pickPlatformItem(dict) {
if (!(dict instanceof Dict)) {
return null;
}
if (dict.has("UF")) {
return dict.get("UF");
} else if (dict.has("F")) {
@ -33991,6 +33994,9 @@ function pickPlatformItem(dict) {
}
return null;
}
function stripPath(str) {
return str.substring(str.lastIndexOf("/") + 1);
}
class FileSpec {
#contentAvailable = false;
constructor(root, xref, skipContent = false) {
@ -34014,29 +34020,28 @@ class FileSpec {
}
}
get filename() {
if (!this._filename && this.root) {
const filename = pickPlatformItem(this.root) || "unnamed";
this._filename = stringToPDFString(filename).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/");
let filename = "";
const item = pickPlatformItem(this.root);
if (item && typeof item === "string") {
filename = stringToPDFString(item).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/");
}
return this._filename;
return shadow(this, "filename", filename || "unnamed");
}
get content() {
if (!this.#contentAvailable) {
return null;
}
if (!this.contentRef && this.root) {
this.contentRef = pickPlatformItem(this.root.get("EF"));
}
this._contentRef ||= pickPlatformItem(this.root?.get("EF"));
let content = null;
if (this.contentRef) {
const fileObj = this.xref.fetchIfRef(this.contentRef);
if (this._contentRef) {
const fileObj = this.xref.fetchIfRef(this._contentRef);
if (fileObj instanceof BaseStream) {
content = fileObj.getBytes();
} else {
warn("Embedded file specification points to non-existing/invalid content");
}
} else {
warn("Embedded file specification does not have a content");
warn("Embedded file specification does not have any content");
}
return content;
}
@ -34050,7 +34055,8 @@ class FileSpec {
}
get serializable() {
return {
filename: this.filename,
rawFilename: this.filename,
filename: stripPath(this.filename),
content: this.content,
description: this.description
};
@ -38292,9 +38298,9 @@ class Catalog {
if (urlDict instanceof Dict) {
const fs = new FileSpec(urlDict, null, true);
const {
filename
rawFilename
} = fs.serializable;
url = filename;
url = rawFilename;
} else if (typeof urlDict === "string") {
url = urlDict;
}
@ -55439,7 +55445,7 @@ class WorkerMessageHandler {
docId,
apiVersion
} = docParams;
const workerVersion = "4.3.8";
const workerVersion = "4.3.18";
if (apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
}
@ -56002,8 +56008,8 @@ if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" &&
;// CONCATENATED MODULE: ./src/pdf.worker.js
const pdfjsVersion = "4.3.8";
const pdfjsBuild = "c419c8333";
const pdfjsVersion = "4.3.18";
const pdfjsBuild = "14e87469d";
var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler;
export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler };

Просмотреть файл

@ -5598,7 +5598,6 @@ class PDFPageView {
this.renderingState = RenderingStates.RUNNING;
const canvasWrapper = document.createElement("div");
canvasWrapper.classList.add("canvasWrapper");
canvasWrapper.setAttribute("aria-hidden", true);
this.#addLayer(canvasWrapper, "canvasWrapper");
if (!this.textLayer && this.#textLayerMode !== TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
this._accessibilityManager ||= new TextAccessibilityManager();
@ -5874,7 +5873,7 @@ class PDFViewer {
#scaleTimeoutId = null;
#textLayerMode = TextLayerMode.ENABLE;
constructor(options) {
const viewerVersion = "4.3.8";
const viewerVersion = "4.3.18";
if (version !== viewerVersion) {
throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
}
@ -9558,8 +9557,8 @@ function webViewerReportTelemetry({
const pdfjsVersion = "4.3.8";
const pdfjsBuild = "c419c8333";
const pdfjsVersion = "4.3.18";
const pdfjsBuild = "14e87469d";
const AppConstants = null;
window.PDFViewerApplication = PDFViewerApplication;
window.PDFViewerApplicationConstants = AppConstants;

Просмотреть файл

@ -2568,7 +2568,6 @@ class BaseTreeViewer {
;// CONCATENATED MODULE: ./web/pdf_attachment_viewer.js
class PDFAttachmentViewer extends BaseTreeViewer {
constructor(options) {
super(options);
@ -2631,29 +2630,18 @@ class PDFAttachmentViewer extends BaseTreeViewer {
let attachmentsCount = 0;
for (const name in attachments) {
const item = attachments[name];
const content = item.content,
description = item.description,
filename = getFilenameFromUrl(item.filename, true);
const div = document.createElement("div");
div.className = "treeItem";
const element = document.createElement("a");
this._bindLink(element, {
content,
description,
filename
});
element.textContent = this._normalizeTextContent(filename);
this._bindLink(element, item);
element.textContent = this._normalizeTextContent(item.filename);
div.append(element);
fragment.append(div);
attachmentsCount++;
}
this._finishRendering(fragment, attachmentsCount);
}
#appendAttachment({
filename,
content,
description
}) {
#appendAttachment(item) {
const renderedPromise = this._renderedCapability.promise;
renderedPromise.then(() => {
if (renderedPromise !== this._renderedCapability.promise) {
@ -2661,15 +2649,11 @@ class PDFAttachmentViewer extends BaseTreeViewer {
}
const attachments = this._attachments || Object.create(null);
for (const name in attachments) {
if (filename === name) {
if (item.filename === name) {
return;
}
}
attachments[filename] = {
filename,
content,
description
};
attachments[item.filename] = item;
this.render({
attachments,
keepRenderedCapability: true
@ -8178,7 +8162,6 @@ class PDFPageView {
this.renderingState = RenderingStates.RUNNING;
const canvasWrapper = document.createElement("div");
canvasWrapper.classList.add("canvasWrapper");
canvasWrapper.setAttribute("aria-hidden", true);
this.#addLayer(canvasWrapper, "canvasWrapper");
if (!this.textLayer && this.#textLayerMode !== TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
this._accessibilityManager ||= new TextAccessibilityManager();
@ -8454,7 +8437,7 @@ class PDFViewer {
#scaleTimeoutId = null;
#textLayerMode = TextLayerMode.ENABLE;
constructor(options) {
const viewerVersion = "4.3.8";
const viewerVersion = "4.3.18";
if (version !== viewerVersion) {
throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
}
@ -12664,8 +12647,8 @@ function webViewerReportTelemetry({
const pdfjsVersion = "4.3.8";
const pdfjsBuild = "c419c8333";
const pdfjsVersion = "4.3.18";
const pdfjsBuild = "14e87469d";
const AppConstants = null;
window.PDFViewerApplication = PDFViewerApplication;
window.PDFViewerApplicationConstants = AppConstants;

Просмотреть файл

@ -20,8 +20,8 @@ origin:
# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: c419c8333b1b509fe90242135d9594aa026a8724 (2024-05-02T12:41:02Z).
revision: c419c8333b1b509fe90242135d9594aa026a8724
release: 14e87469dbb04fa0e9e6f7ec23e5c9d7b283e901 (2024-05-06T18:00:03Z).
revision: 14e87469dbb04fa0e9e6f7ec23e5c9d7b283e901
# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/