Compare commits

..

No commits in common. "11e89b74d926fa121945a4aee95d24d46257e94b" and "8f4c0169a0f82423fedb77fb7c28503e52a93419" have entirely different histories.

8 changed files with 37 additions and 154 deletions

View File

@ -91,6 +91,12 @@ function findUnequal(arr, start, value) {
return j;
}
function setValues(arr, start, end, value) {
for (let j = start; j < end; ++j) {
arr[j] = value;
}
}
function reverseValues(arr, start, end) {
for (let i = start, j = end - 1; i < j; ++i, --j) {
const temp = arr[i];
@ -317,7 +323,7 @@ function bidi(str, startLevel = -1, vertical = false) {
after = "R";
}
if (before === after) {
types.fill(before, i, end);
setValues(types, i, end, before);
}
i = end - 1; // reset to end (-1 so next iteration is ok)
}

View File

@ -906,7 +906,6 @@ const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {
t[896] = 91;
t[897] = 93;
t[923] = 64;
t[940] = 163;
t[1004] = 48;
t[1005] = 49;
t[1006] = 50;

View File

@ -1172,37 +1172,6 @@ if (
};
}
if (
typeof PDFJSDev !== "undefined" &&
!PDFJSDev.test("SKIP_BABEL") &&
typeof AbortSignal.any !== "function"
) {
AbortSignal.any = function (iterable) {
const ac = new AbortController();
const { signal } = ac;
// Return immediately if any of the signals are already aborted.
for (const s of iterable) {
if (s.aborted) {
ac.abort(s.reason);
return signal;
}
}
// Register "abort" listeners for all signals.
for (const s of iterable) {
s.addEventListener(
"abort",
() => {
ac.abort(s.reason);
},
{ signal } // Automatically remove the listener.
);
}
return signal;
};
}
export {
_isValidExplicitDest,
AbortException,

View File

@ -260,7 +260,6 @@
!bug860632.pdf
!bug894572.pdf
!bug911034.pdf
!issue19695.pdf
!bug1108301.pdf
!issue10301.pdf
!bug1157493.pdf

View File

@ -1,102 +0,0 @@
%PDF-1.7
34 0 obj
<<
/Type /Catalog
/Pages 35 0 R
>>
endobj
35 0 obj
<<
/Type /Pages
/MediaBox [ 0 0 200 50 ]
/Count 1
/Kids [ 36 0 R ]
>>
endobj
36 0 obj
<<
/Type /Page
/Parent 35 0 R
/Resources <<
/Font <<
/F1 37 0 R
>>
>>
/Contents 38 0 R
>>
endobj
37 0 obj
<<
/BaseFont /Calibri
/DescendantFonts [ 12 0 R ]
/Encoding /Identity-H
/Subtype /Type0
/Type /Font
>>
endobj
38 0 obj
<<
/Length 54
>>
stream
BT
10 20 TD
/F1 20 Tf
<03AC03ED03F0035803EC03EC>Tj
ET
endstream
endobj
12 0 obj
<<
/BaseFont /Calibri
/CIDSystemInfo <<
/Ordering (Identity)
/Registry (Adobe)
/Supplement 0
>>
/FontDescriptor 13 0 R
/Subtype /CIDFontType2
/Type /Font
/W [ 3 [ 226.074 ] 47 [ 251.953 ] 87 [ 516.602 ] 258 [ 479.004 ] 288 [ 497.559 ] 349 [ 229.492 ] 374 [ 525.391 ] 396 [ 348.633 ] 400 [ 391.113 ] 853 [ 249.512 ] 856 [ 252.441 ] 859 [ 249.512 ] 940 [ 506.836 ] 1004 [ 506.836 ] 1005 [ 506.836 ] 1007 [ 506.836 ] 1008 [ 506.836 ] 1009 [ 506.836 ] 1010 [ 506.836 ] 1011 [ 506.836 ] 1012 [ 506.836 ] 1013 [ 506.836 ] 1085 [ 498.047 ] 3423 [ 500 ] ]
>>
endobj
13 0 obj
<<
/Ascent 750
/CapHeight 0
/Descent -250
/Flags 32
/FontBBox [ -503 -312 1240 1026 ]
/FontName /Calibri
/ItalicAngle 0
/StemV 0
/Type /FontDescriptor
>>
endobj
xref
0 1
0000000000 65535 f
12 1
0000000477 00000 n
13 1
0000001044 00000 n
34 1
0000000009 00000 n
35 1
0000000060 00000 n
36 1
0000000146 00000 n
37 1
0000000252 00000 n
38 1
0000000371 00000 n
trailer
<<
/Size 7
/Root 34 0 R
>>
startxref
1214
%%EOF

View File

@ -706,13 +706,6 @@
"rounds": 1,
"type": "load"
},
{
"id": "issue19695",
"file": "pdfs/issue19695.pdf",
"md5": "963474b8847afc9eeda4ff4635f7a523",
"rounds": 1,
"type": "eq"
},
{
"id": "openofficearabiccidtruetype-pdf",
"file": "pdfs/arial_unicode_ab_cidfont.pdf",

View File

@ -559,7 +559,11 @@ const PDFViewerApplication = {
}
if (appConfig.annotationEditorParams) {
if (annotationEditorMode !== AnnotationEditorType.DISABLE) {
if (
((typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
typeof AbortSignal.any === "function") &&
annotationEditorMode !== AnnotationEditorType.DISABLE
) {
const editorSignatureButton = appConfig.toolbar?.editorSignatureButton;
if (editorSignatureButton && AppOptions.get("enableSignatureEditor")) {
editorSignatureButton.parentElement.hidden = false;
@ -2071,14 +2075,19 @@ const PDFViewerApplication = {
_windowAbortController: { signal },
} = this;
this._touchManager = new TouchManager({
container: window,
isPinchingDisabled: () => pdfViewer.isInPresentationMode,
isPinchingStopped: () => this.overlayManager?.active,
onPinching: this.touchPinchCallback.bind(this),
onPinchEnd: this.touchPinchEndCallback.bind(this),
signal,
});
if (
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
typeof AbortSignal.any === "function"
) {
this._touchManager = new TouchManager({
container: window,
isPinchingDisabled: () => pdfViewer.isInPresentationMode,
isPinchingStopped: () => this.overlayManager?.active,
onPinching: this.touchPinchCallback.bind(this),
onPinchEnd: this.touchPinchEndCallback.bind(this),
signal,
});
}
function addWindowResolutionChange(evt = null) {
if (evt) {

View File

@ -711,7 +711,13 @@ class PDFViewer {
hiddenCapability.resolve();
}
},
{ signal: AbortSignal.any([signal, ac.signal]) }
{
signal:
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
typeof AbortSignal.any === "function"
? AbortSignal.any([signal, ac.signal])
: signal,
}
);
await Promise.race([
@ -908,7 +914,11 @@ class PDFViewer {
viewer.before(element);
}
if (annotationEditorMode !== AnnotationEditorType.DISABLE) {
if (
((typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
typeof AbortSignal.any === "function") &&
annotationEditorMode !== AnnotationEditorType.DISABLE
) {
const mode = annotationEditorMode;
if (pdfDocument.isPureXfa) {