diff --git a/browser/extensions/pdfjs/README.mozilla b/browser/extensions/pdfjs/README.mozilla index fbf0305b11ed..552eed1339fb 100644 --- a/browser/extensions/pdfjs/README.mozilla +++ b/browser/extensions/pdfjs/README.mozilla @@ -1,5 +1,5 @@ This is the PDF.js project output, https://github.com/mozilla/pdf.js -Current extension version is: 2.4.15 +Current extension version is: 2.4.43 -Taken from upstream commit: cead77ef +Taken from upstream commit: 16ae7c69 diff --git a/browser/extensions/pdfjs/content/build/pdf.js b/browser/extensions/pdfjs/content/build/pdf.js index 2a07a0704477..831fb2d12705 100644 --- a/browser/extensions/pdfjs/content/build/pdf.js +++ b/browser/extensions/pdfjs/content/build/pdf.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -var pdfjsVersion = '2.4.15'; -var pdfjsBuild = 'cead77ef'; +var pdfjsVersion = '2.4.43'; +var pdfjsBuild = '16ae7c69'; var pdfjsSharedUtil = __w_pdfjs_require__(1); @@ -1271,7 +1271,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { return worker.messageHandler.sendWithPromise('GetDocRequest', { docId, - apiVersion: '2.4.15', + apiVersion: '2.4.43', source: { data: source.data, url: source.url, @@ -1331,8 +1331,7 @@ const PDFDocumentLoadingTask = function PDFDocumentLoadingTaskClosure() { } then(onFulfilled, onRejected) { - (0, _display_utils.deprecated)('PDFDocumentLoadingTask.then method, ' + 'use the `promise` getter instead.'); - return this.promise.then.apply(this.promise, arguments); + throw new Error('Removed API method: ' + 'PDFDocumentLoadingTask.then, use the `promise` getter instead.'); } } @@ -3004,8 +3003,7 @@ class RenderTask { } then(onFulfilled, onRejected) { - (0, _display_utils.deprecated)('RenderTask.then method, use the `promise` getter instead.'); - return this.promise.then.apply(this.promise, arguments); + throw new Error('Removed API method: ' + 'RenderTask.then, use the `promise` getter instead.'); } } @@ -3176,9 +3174,9 @@ const InternalRenderTask = function InternalRenderTaskClosure() { return InternalRenderTask; }(); -const version = '2.4.15'; +const version = '2.4.43'; exports.version = version; -const build = 'cead77ef'; +const build = '16ae7c69'; exports.build = build; /***/ }), diff --git a/browser/extensions/pdfjs/content/build/pdf.worker.js b/browser/extensions/pdfjs/content/build/pdf.worker.js index f0bbce1a8aa4..6863b19485ce 100644 --- a/browser/extensions/pdfjs/content/build/pdf.worker.js +++ b/browser/extensions/pdfjs/content/build/pdf.worker.js @@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; -const pdfjsVersion = '2.4.15'; -const pdfjsBuild = 'cead77ef'; +const pdfjsVersion = '2.4.43'; +const pdfjsBuild = '16ae7c69'; const pdfjsCoreWorker = __w_pdfjs_require__(1); @@ -225,7 +225,7 @@ var WorkerMessageHandler = { var WorkerTasks = []; const verbosity = (0, _util.getVerbosityLevel)(); const apiVersion = docParams.apiVersion; - const workerVersion = '2.4.15'; + const workerVersion = '2.4.43'; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); @@ -19969,7 +19969,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { }, hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { - if (!(0, _primitives.isDict)(resources)) { + if (!(resources instanceof _primitives.Dict)) { return false; } @@ -19983,19 +19983,35 @@ var PartialEvaluator = function PartialEvaluatorClosure() { xref = this.xref; while (nodes.length) { - var key, i, ii; var node = nodes.shift(); var graphicStates = node.get('ExtGState'); - if ((0, _primitives.isDict)(graphicStates)) { + if (graphicStates instanceof _primitives.Dict) { var graphicStatesKeys = graphicStates.getKeys(); - for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { - key = graphicStatesKeys[i]; - var graphicState = graphicStates.get(key); + for (let i = 0, ii = graphicStatesKeys.length; i < ii; i++) { + const key = graphicStatesKeys[i]; + let graphicState = graphicStates.getRaw(key); + + if (graphicState instanceof _primitives.Ref) { + if (processed[graphicState.toString()]) { + continue; + } + + graphicState = xref.fetch(graphicState); + } + + if (!(graphicState instanceof _primitives.Dict)) { + continue; + } + + if (graphicState.objId) { + processed[graphicState.objId] = true; + } + var bm = graphicState.get('BM'); - if ((0, _primitives.isName)(bm) && bm.name !== 'Normal') { + if (bm instanceof _primitives.Name && bm.name !== 'Normal') { return true; } } @@ -20003,17 +20019,17 @@ var PartialEvaluator = function PartialEvaluatorClosure() { var xObjects = node.get('XObject'); - if (!(0, _primitives.isDict)(xObjects)) { + if (!(xObjects instanceof _primitives.Dict)) { continue; } var xObjectsKeys = xObjects.getKeys(); - for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { - key = xObjectsKeys[i]; + for (let i = 0, ii = xObjectsKeys.length; i < ii; i++) { + const key = xObjectsKeys[i]; var xObject = xObjects.getRaw(key); - if ((0, _primitives.isRef)(xObject)) { + if (xObject instanceof _primitives.Ref) { if (processed[xObject.toString()]) { continue; } @@ -20035,7 +20051,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { var xResources = xObject.dict.get('Resources'); - if ((0, _primitives.isDict)(xResources) && (!xResources.objId || !processed[xResources.objId])) { + if (xResources instanceof _primitives.Dict && (!xResources.objId || !processed[xResources.objId])) { nodes.push(xResources); if (xResources.objId) { @@ -20473,7 +20489,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() { if (font) { if (!(0, _primitives.isRef)(font)) { - throw new Error('The "font" object should be a reference.'); + throw new _util.FormatError('The "font" object should be a reference.'); } fontRef = font; @@ -20482,15 +20498,26 @@ var PartialEvaluator = function PartialEvaluatorClosure() { if (fontRes) { fontRef = fontRes.getRaw(fontName); - } else { - (0, _util.warn)('fontRes not available'); - return errorFont(); } } if (!fontRef) { - (0, _util.warn)('fontRef not available'); - return errorFont(); + const partialMsg = `Font "${fontName || font && font.toString()}" is not available`; + + if (!this.options.ignoreErrors && !this.parsingType3Font) { + (0, _util.warn)(`${partialMsg}.`); + return errorFont(); + } + + this.handler.send('UnsupportedFeature', { + featureId: _util.UNSUPPORTED_FEATURES.font + }); + (0, _util.warn)(`${partialMsg} -- attempting to fallback to a default font.`); + fontRef = new _primitives.Dict(); + fontRef.set('BaseFont', _primitives.Name.get('PDFJS-FallbackFont')); + fontRef.set('Type', _primitives.Name.get('FallbackType')); + fontRef.set('Subtype', _primitives.Name.get('FallbackType')); + fontRef.set('Encoding', _primitives.Name.get('WinAnsiEncoding')); } if (this.fontCache.has(fontRef)) { diff --git a/browser/extensions/pdfjs/content/web/viewer.css b/browser/extensions/pdfjs/content/web/viewer.css index e449583fa5bc..86b9d240a636 100644 --- a/browser/extensions/pdfjs/content/web/viewer.css +++ b/browser/extensions/pdfjs/content/web/viewer.css @@ -67,8 +67,7 @@ bottom: 0px; z-index: -1; cursor: default; - -moz-user-select: none; - user-select: none; + user-select: none; } .textLayer .endOfContent.active { @@ -425,8 +424,7 @@ select { height: 100%; overflow: hidden; cursor: none; - -moz-user-select: none; - user-select: none; + user-select: none; } .pdfPresentationMode:fullscreen a:not(.internalLink) { @@ -481,8 +479,7 @@ html[dir='rtl'] #sidebarContainer { /* Improve responsiveness and avoid visual glitches when the sidebar is resized. */ transition-duration: 0s; /* Prevent e.g. the thumbnails being selected when the sidebar is resized. */ - -moz-user-select: none; - user-select: none; + user-select: none; } #outerContainer.sidebarMoving #sidebarContainer, @@ -708,8 +705,7 @@ html[dir='rtl'] .findbar { } .findbar label { - -moz-user-select: none; - user-select: none; + user-select: none; } #findInput { @@ -980,8 +976,7 @@ html[dir='rtl'] .splitToolbarButtonSeparator { color: hsla(0,0%,100%,.8); font-size: 12px; line-height: 14px; - -moz-user-select: none; - user-select: none; + user-select: none; /* Opera does not support user-select, use <... unselectable="on"> instead */ cursor: default; transition-property: background-color, border-color, box-shadow; @@ -1436,8 +1431,7 @@ html[dir='rtl'] .verticalToolbarSeparator { font-size: 12px; line-height: 14px; text-align: left; - -moz-user-select: none; - user-select: none; + user-select: none; cursor: default; } @@ -1530,8 +1524,7 @@ a:focus > .thumbnail > .thumbnailSelectionRing, top: 0; bottom: 0; overflow: auto; - -moz-user-select: none; - user-select: none; + user-select: none; } #outlineView { @@ -1564,8 +1557,7 @@ html[dir='rtl'] .outlineItem > .outlineItems { color: hsla(0,0%,100%,.8); font-size: 13px; line-height: 15px; - -moz-user-select: none; - user-select: none; + user-select: none; white-space: normal; } diff --git a/browser/extensions/pdfjs/moz.yaml b/browser/extensions/pdfjs/moz.yaml index 7c41c9fb2676..e0957d593c0e 100644 --- a/browser/extensions/pdfjs/moz.yaml +++ b/browser/extensions/pdfjs/moz.yaml @@ -20,7 +20,7 @@ origin: # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: version 2.4.15 + release: version 2.4.43 # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/