Bug 1800694 - Update pdf.js to new version c7d6ab2f7123c5a65155c55aa19d9d9abd8c2ff2 r=pdfjs-reviewers,marco

Differential Revision: https://phabricator.services.mozilla.com/D162121
This commit is contained in:
Calixte 2022-11-15 18:26:11 +00:00
parent c2c26b3674
commit 76e589d8af
5 changed files with 49 additions and 33 deletions

View File

@ -1141,7 +1141,7 @@ async function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
}
const workerId = await worker.messageHandler.sendWithPromise("GetDocRequest", {
docId,
apiVersion: '3.1.43',
apiVersion: '3.1.49',
data: source.data,
password: source.password,
disableAutoFetch: source.disableAutoFetch,
@ -2760,9 +2760,9 @@ class InternalRenderTask {
}
}
}
const version = '3.1.43';
const version = '3.1.49';
exports.version = version;
const build = '3078e2c1d';
const build = 'c7d6ab2f7';
exports.build = build;
/***/ }),
@ -12924,8 +12924,8 @@ var _is_node = __w_pdfjs_require__(12);
var _text_layer = __w_pdfjs_require__(28);
var _svg = __w_pdfjs_require__(29);
var _xfa_layer = __w_pdfjs_require__(27);
const pdfjsVersion = '3.1.43';
const pdfjsBuild = '3078e2c1d';
const pdfjsVersion = '3.1.49';
const pdfjsBuild = 'c7d6ab2f7';
;
})();

View File

@ -4205,8 +4205,8 @@ Object.defineProperty(exports, "initSandbox", ({
}
}));
var _initialization = __w_pdfjs_require__(1);
const pdfjsVersion = '3.1.43';
const pdfjsBuild = '3078e2c1d';
const pdfjsVersion = '3.1.49';
const pdfjsBuild = 'c7d6ab2f7';
})();
/******/ return __webpack_exports__;

View File

@ -101,7 +101,7 @@ class WorkerMessageHandler {
docId,
apiVersion
} = docParams;
const workerVersion = '3.1.43';
const workerVersion = '3.1.49';
if (apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
}
@ -4591,6 +4591,7 @@ class Annotation {
this.data.fieldName = this._constructFieldName(dict);
this.data.pageIndex = params.pageIndex;
}
this._isOffscreenCanvasSupported = params.isOffscreenCanvasSupported;
this._fallbackFontDict = null;
this._needAppearances = false;
}
@ -5197,7 +5198,6 @@ class WidgetAnnotation extends Annotation {
const data = this.data;
this.ref = params.ref;
this._needAppearances = params.needAppearances;
this._isOffscreenCanvasSupported = params.isOffscreenCanvasSupported;
data.annotationType = _util.AnnotationType.WIDGET;
if (data.fieldName === undefined) {
data.fieldName = this._constructFieldName(dict);
@ -52455,8 +52455,8 @@ Object.defineProperty(exports, "WorkerMessageHandler", ({
}
}));
var _worker = __w_pdfjs_require__(1);
const pdfjsVersion = '3.1.43';
const pdfjsBuild = '3078e2c1d';
const pdfjsVersion = '3.1.49';
const pdfjsBuild = 'c7d6ab2f7';
})();
/******/ return __webpack_exports__;

View File

@ -4549,7 +4549,7 @@ const CHARACTERS_TO_NORMALIZE = {
"\u00BE": "3/4"
};
const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);
const DIACRITICS_EXCEPTION_STR = [...DIACRITICS_EXCEPTION.values()].map(x => String.fromCharCode(x)).join("");
let DIACRITICS_EXCEPTION_STR;
const DIACRITICS_REG_EXP = /\p{M}+/gu;
const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu;
const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
@ -4557,6 +4557,7 @@ const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;
const SYLLABLES_LENGTHS = new Map();
const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]";
const NFKC_CHARS_TO_NORMALIZE = new Map();
let noSyllablesRegExp = null;
let withSyllablesRegExp = null;
function normalize(text) {
@ -4582,7 +4583,8 @@ function normalize(text) {
normalizationRegex = withSyllablesRegExp;
} else {
const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
const regexp = `([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\p{Ideographic}\\n)|(\\n)`;
const toNormalizeWithNFKC = "\u2460-\u2473" + "\u24b6-\u24ff" + "\u3244-\u32bf" + "\u32d0-\u32fe" + "\uff00-\uffef";
const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\p{Ideographic}\\n)|(\\n)`;
if (syllablePositions.length === 0) {
normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum");
} else {
@ -4601,10 +4603,10 @@ function normalize(text) {
let shiftOrigin = 0;
let eol = 0;
let hasDiacritics = false;
normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, i) => {
normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, i) => {
i -= shiftOrigin;
if (p1) {
const replacement = CHARACTERS_TO_NORMALIZE[match];
const replacement = CHARACTERS_TO_NORMALIZE[p1];
const jj = replacement.length;
for (let j = 1; j < jj; j++) {
positions.push([i - shift + j, shift - j]);
@ -4613,8 +4615,21 @@ function normalize(text) {
return replacement;
}
if (p2) {
const hasTrailingDashEOL = p2.endsWith("\n");
const len = hasTrailingDashEOL ? p2.length - 2 : p2.length;
let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);
if (!replacement) {
replacement = p2.normalize("NFKC");
NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);
}
const jj = replacement.length;
for (let j = 1; j < jj; j++) {
positions.push([i - shift + j, shift - j]);
}
shift -= jj - 1;
return replacement;
}
if (p3) {
const hasTrailingDashEOL = p3.endsWith("\n");
const len = hasTrailingDashEOL ? p3.length - 2 : p3.length;
hasDiacritics = true;
let jj = len;
if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {
@ -4632,24 +4647,24 @@ function normalize(text) {
shift += 1;
shiftOrigin += 1;
eol += 1;
return p2.slice(0, len);
return p3.slice(0, len);
}
return p2;
}
if (p3) {
positions.push([i - shift + 1, 1 + shift]);
shift += 1;
shiftOrigin += 1;
eol += 1;
return p3.charAt(0);
return p3;
}
if (p4) {
positions.push([i - shift + 1, shift]);
positions.push([i - shift + 1, 1 + shift]);
shift += 1;
shiftOrigin += 1;
eol += 1;
return p4.charAt(0);
}
if (p5) {
positions.push([i - shift + 1, shift]);
shiftOrigin += 1;
eol += 1;
return p5.charAt(0);
}
if (p6) {
positions.push([i - shift + 1, shift - 1]);
shift -= 1;
shiftOrigin += 1;
@ -4665,7 +4680,7 @@ function normalize(text) {
shift -= newCharLen;
shiftOrigin += newCharLen;
}
return p6;
return p7;
});
positions.push([normalized.length, shift]);
return [normalized, positions, hasDiacritics];
@ -4915,6 +4930,7 @@ class PDFFindController {
}
if (matchDiacritics) {
if (hasDiacritics) {
DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION);
isUnicode = true;
query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`;
}
@ -8010,7 +8026,7 @@ class PDFViewer {
#scrollModePageState = null;
#onVisibilityChange = null;
constructor(options) {
const viewerVersion = '3.1.43';
const viewerVersion = '3.1.49';
if (_pdfjsLib.version !== viewerVersion) {
throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
}
@ -12494,8 +12510,8 @@ var _ui_utils = __webpack_require__(1);
var _app_options = __webpack_require__(2);
var _pdf_link_service = __webpack_require__(3);
var _app = __webpack_require__(4);
const pdfjsVersion = '3.1.43';
const pdfjsBuild = '3078e2c1d';
const pdfjsVersion = '3.1.49';
const pdfjsBuild = 'c7d6ab2f7';
const AppConstants = null;
exports.PDFViewerApplicationConstants = AppConstants;
window.PDFViewerApplication = _app.PDFViewerApplication;

View File

@ -20,8 +20,8 @@ origin:
# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: 3078e2c1d9c3d1e6bf79709f2680dfca6b35cc9d (2022-11-14T14:56:27Z).
revision: 3078e2c1d9c3d1e6bf79709f2680dfca6b35cc9d
release: c7d6ab2f7123c5a65155c55aa19d9d9abd8c2ff2 (2022-11-15T16:18:03Z).
revision: c7d6ab2f7123c5a65155c55aa19d9d9abd8c2ff2
# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/