Bug 1708241 - Update pdf.js to version 2.9.142 r=calixte

Differential Revision: https://phabricator.services.mozilla.com/D113674
This commit is contained in:
Brendan Dahl
2021-04-28 16:56:53 +00:00
parent 41892c1a90
commit dbd0019eb4
8 changed files with 16965 additions and 16522 deletions

View File

@@ -246,6 +246,3 @@ password_cancel=Cancel
printing_not_supported=Warning: Printing is not fully supported by this browser. printing_not_supported=Warning: Printing is not fully supported by this browser.
printing_not_ready=Warning: The PDF is not fully loaded for printing. printing_not_ready=Warning: The PDF is not fully loaded for printing.
web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts. web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts.
# LOCALIZATION NOTE (unsupported_feature_signatures): Should contain the same
# exact string as in the `chrome.properties` file.
unsupported_feature_signatures=This PDF document contains digital signatures. Validation of signatures is not supported.

View File

@@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 2.9.44 Current extension version is: 2.9.142
Taken from upstream commit: 6cf307000 Taken from upstream commit: d10da907d

File diff suppressed because it is too large Load Diff

View File

@@ -4768,8 +4768,8 @@ Object.defineProperty(exports, "initSandbox", ({
var _initialization = __w_pdfjs_require__(1); var _initialization = __w_pdfjs_require__(1);
const pdfjsVersion = '2.9.44'; const pdfjsVersion = '2.9.142';
const pdfjsBuild = '6cf307000'; const pdfjsBuild = 'd10da907d';
})(); })();
/******/ return __webpack_exports__; /******/ return __webpack_exports__;

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,7 @@
} }
.textLayer .highlight { .textLayer .highlight {
position: relative;
margin: -1px; margin: -1px;
padding: 1px; padding: 1px;
background-color: rgba(180, 0, 170, 1); background-color: rgba(180, 0, 170, 1);
@@ -671,7 +672,7 @@
--secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg); --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg);
} }
@media (-moz-toolbar-prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
--main-color: rgba(249, 249, 250, 1); --main-color: rgba(249, 249, 250, 1);
--body-bg-color: rgba(42, 42, 46, 1); --body-bg-color: rgba(42, 42, 46, 1);

View File

@@ -471,7 +471,6 @@ const PDFViewerApplication = {
metadata: null, metadata: null,
_contentDispositionFilename: null, _contentDispositionFilename: null,
_contentLength: null, _contentLength: null,
triggerDelayedFallback: null,
_saveInProgress: false, _saveInProgress: false,
_wheelUnusedTicks: 0, _wheelUnusedTicks: 0,
_idleCallbacks: new Set(), _idleCallbacks: new Set(),
@@ -611,13 +610,13 @@ const PDFViewerApplication = {
for (let i = 0, ii = cssRules.length; i < ii; i++) { for (let i = 0, ii = cssRules.length; i < ii; i++) {
const rule = cssRules[i]; const rule = cssRules[i];
if (rule instanceof CSSMediaRule && rule.media?.[0] === "(-moz-toolbar-prefers-color-scheme: dark)") { if (rule instanceof CSSMediaRule && rule.media?.[0] === "(prefers-color-scheme: dark)") {
if (cssTheme === ViewerCssTheme.LIGHT) { if (cssTheme === ViewerCssTheme.LIGHT) {
styleSheet.deleteRule(i); styleSheet.deleteRule(i);
return; return;
} }
const darkRules = /^@media \(-moz-toolbar-prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(rule.cssText); const darkRules = /^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(rule.cssText);
if (darkRules?.[1]) { if (darkRules?.[1]) {
styleSheet.deleteRule(i); styleSheet.deleteRule(i);
@@ -945,7 +944,6 @@ const PDFViewerApplication = {
this.metadata = null; this.metadata = null;
this._contentDispositionFilename = null; this._contentDispositionFilename = null;
this._contentLength = null; this._contentLength = null;
this.triggerDelayedFallback = null;
this._saveInProgress = false; this._saveInProgress = false;
this._cancelIdleCallbacks(); this._cancelIdleCallbacks();
@@ -1124,32 +1122,12 @@ const PDFViewerApplication = {
} }
}, },
_delayedFallback(featureId) {
this.externalServices.reportTelemetry({
type: "unsupportedFeature",
featureId
});
if (!this.triggerDelayedFallback) {
this.triggerDelayedFallback = () => {
this.fallback(featureId);
this.triggerDelayedFallback = null;
};
}
},
fallback(featureId) { fallback(featureId) {
this.externalServices.reportTelemetry({ this.externalServices.reportTelemetry({
type: "unsupportedFeature", type: "unsupportedFeature",
featureId featureId
}); });
switch (featureId) {
case _pdfjsLib.UNSUPPORTED_FEATURES.errorFontLoadNative:
case _pdfjsLib.UNSUPPORTED_FEATURES.errorFontMissing:
return;
}
if (this._fellback) { if (this._fellback) {
return; return;
} }
@@ -1490,10 +1468,8 @@ const PDFViewerApplication = {
return false; return false;
} }
console.warn("Warning: JavaScript is not supported"); console.warn("Warning: JavaScript support is not enabled");
this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript);
this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript);
return true; return true;
}); });
@@ -1546,12 +1522,10 @@ const PDFViewerApplication = {
if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) { if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) {
console.warn("Warning: XFA is not supported"); console.warn("Warning: XFA is not supported");
this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
} else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderInteractiveForms) { } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderInteractiveForms) {
console.warn("Warning: Interactive form support is not enabled"); console.warn("Warning: Interactive form support is not enabled");
this.fallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
this._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);
} }
if (info.IsSignaturesPresent) { if (info.IsSignaturesPresent) {
@@ -1971,7 +1945,6 @@ const PDFViewerApplication = {
}); });
window.addEventListener("click", webViewerClick); window.addEventListener("click", webViewerClick);
window.addEventListener("keydown", webViewerKeyDown); window.addEventListener("keydown", webViewerKeyDown);
window.addEventListener("keyup", webViewerKeyUp);
window.addEventListener("resize", _boundEvents.windowResize); window.addEventListener("resize", _boundEvents.windowResize);
window.addEventListener("hashchange", _boundEvents.windowHashChange); window.addEventListener("hashchange", _boundEvents.windowHashChange);
window.addEventListener("beforeprint", _boundEvents.windowBeforePrint); window.addEventListener("beforeprint", _boundEvents.windowBeforePrint);
@@ -2086,7 +2059,6 @@ const PDFViewerApplication = {
}); });
window.removeEventListener("click", webViewerClick); window.removeEventListener("click", webViewerClick);
window.removeEventListener("keydown", webViewerKeyDown); window.removeEventListener("keydown", webViewerKeyDown);
window.removeEventListener("keyup", webViewerKeyUp);
window.removeEventListener("resize", _boundEvents.windowResize); window.removeEventListener("resize", _boundEvents.windowResize);
window.removeEventListener("hashchange", _boundEvents.windowHashChange); window.removeEventListener("hashchange", _boundEvents.windowHashChange);
window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint); window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint);
@@ -2649,10 +2621,6 @@ function webViewerTouchStart(evt) {
} }
function webViewerClick(evt) { function webViewerClick(evt) {
if (PDFViewerApplication.triggerDelayedFallback && PDFViewerApplication.pdfViewer.containsElement(evt.target)) {
PDFViewerApplication.triggerDelayedFallback();
}
if (!PDFViewerApplication.secondaryToolbar.isOpen) { if (!PDFViewerApplication.secondaryToolbar.isOpen) {
return; return;
} }
@@ -2664,14 +2632,6 @@ function webViewerClick(evt) {
} }
} }
function webViewerKeyUp(evt) {
if (evt.keyCode === 9) {
if (PDFViewerApplication.triggerDelayedFallback) {
PDFViewerApplication.triggerDelayedFallback();
}
}
}
function webViewerKeyDown(evt) { function webViewerKeyDown(evt) {
if (PDFViewerApplication.overlayManager.active) { if (PDFViewerApplication.overlayManager.active) {
return; return;
@@ -3539,27 +3499,29 @@ class EventBus {
const args = Array.prototype.slice.call(arguments, 1); const args = Array.prototype.slice.call(arguments, 1);
let externalListeners; let externalListeners;
eventListeners.slice(0).forEach(({
for (const {
listener, listener,
external, external,
once once
}) => { } of eventListeners.slice(0)) {
if (once) { if (once) {
this._off(eventName, listener); this._off(eventName, listener);
} }
if (external) { if (external) {
(externalListeners ||= []).push(listener); (externalListeners ||= []).push(listener);
return; continue;
} }
listener.apply(null, args); listener.apply(null, args);
}); }
if (externalListeners) { if (externalListeners) {
externalListeners.forEach(listener => { for (const listener of externalListeners) {
listener.apply(null, args); listener.apply(null, args);
}); }
externalListeners = null; externalListeners = null;
} }
@@ -9705,7 +9667,7 @@ class BaseViewer {
throw new Error("Cannot initialize BaseViewer."); throw new Error("Cannot initialize BaseViewer.");
} }
const viewerVersion = '2.9.44'; const viewerVersion = '2.9.142';
if (_pdfjsLib.version !== viewerVersion) { if (_pdfjsLib.version !== viewerVersion) {
throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`); throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
@@ -11223,8 +11185,7 @@ const DEFAULT_L10N_STRINGS = {
unexpected_response_error: "Unexpected server response.", unexpected_response_error: "Unexpected server response.",
printing_not_supported: "Warning: Printing is not fully supported by this browser.", printing_not_supported: "Warning: Printing is not fully supported by this browser.",
printing_not_ready: "Warning: The PDF is not fully loaded for printing.", printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.", web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."
unsupported_feature_signatures: "This PDF document contains digital signatures. Validation of signatures is not supported."
}; };
function getL10nFallback(key, args) { function getL10nFallback(key, args) {
@@ -14155,8 +14116,8 @@ var _app_options = __webpack_require__(1);
var _app = __webpack_require__(3); var _app = __webpack_require__(3);
const pdfjsVersion = '2.9.44'; const pdfjsVersion = '2.9.142';
const pdfjsBuild = '6cf307000'; const pdfjsBuild = 'd10da907d';
window.PDFViewerApplication = _app.PDFViewerApplication; window.PDFViewerApplication = _app.PDFViewerApplication;
window.PDFViewerApplicationOptions = _app_options.AppOptions; window.PDFViewerApplicationOptions = _app_options.AppOptions;
; ;
@@ -14302,4 +14263,4 @@ if (document.readyState === "interactive" || document.readyState === "complete")
})(); })();
/******/ })() /******/ })()
; ;

View File

@@ -20,7 +20,7 @@ origin:
# Human-readable identifier for this version/release # Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS" # Generally "version NNN", "tag SSS", "bookmark SSS"
release: version 2.9.44 release: version 2.9.142
# The package's license, where possible using the mnemonic from # The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/ # https://spdx.org/licenses/