Bug 1451562 - Update pdf.js to version 2.0.480. r=bdahl
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 04 Apr 2018 17:57:32 -0400
changeset 777706 09ea3044c41f259b6489cc86bbfa9b714046a1e7
parent 777705 3b6ec4f3984e90bfe97dd1c9bb6aa8e510b4e197
child 777707 2aae81812b14d6c60e605f6978b1708216314af0
push id105269
push userbmo:gl@mozilla.com
push dateThu, 05 Apr 2018 08:11:19 +0000
reviewersbdahl
bugs1451562
milestone61.0a1
Bug 1451562 - Update pdf.js to version 2.0.480. r=bdahl
browser/extensions/pdfjs/README.mozilla
browser/extensions/pdfjs/content/build/pdf.js
browser/extensions/pdfjs/content/build/pdf.worker.js
browser/extensions/pdfjs/content/web/viewer.js
--- 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.0.466
+Current extension version is: 2.0.480
 
-Taken from upstream commit: a8e9f6cc
+Taken from upstream commit: a7a034d8
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -1645,18 +1645,18 @@ exports.GlobalWorkerOptions = GlobalWork
 
 /***/ }),
 /* 5 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.466';
-var pdfjsBuild = 'a8e9f6cc';
+var pdfjsVersion = '2.0.480';
+var pdfjsBuild = 'a7a034d8';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayAPI = __w_pdfjs_require__(9);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(17);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(18);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(1);
 var pdfjsDisplaySVG = __w_pdfjs_require__(19);
 let pdfjsDisplayWorkerOptions = __w_pdfjs_require__(4);
 let pdfjsDisplayAPICompatibility = __w_pdfjs_require__(3);
@@ -4924,17 +4924,17 @@ function _fetchDocument(worker, source, 
     return Promise.reject(new Error('Worker was destroyed'));
   }
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
   }
   return worker.messageHandler.sendWithPromise('GetDocRequest', {
     docId,
-    apiVersion: '2.0.466',
+    apiVersion: '2.0.480',
     source: {
       data: source.data,
       url: source.url,
       password: source.password,
       disableAutoFetch: source.disableAutoFetch,
       rangeChunkSize: source.rangeChunkSize,
       length: source.length
     },
@@ -6247,18 +6247,18 @@ var InternalRenderTask = function Intern
         }
       }
     }
   };
   return InternalRenderTask;
 }();
 var version, build;
 {
-  exports.version = version = '2.0.466';
-  exports.build = build = 'a8e9f6cc';
+  exports.version = version = '2.0.480';
+  exports.build = build = 'a7a034d8';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamFactory = setPDFNetworkStreamFactory;
@@ -8008,17 +8008,17 @@ var CanvasGraphics = function CanvasGrap
       var currentTransform = ctx.mozCurrentTransformInverse;
       var a = currentTransform[0],
           b = currentTransform[1];
       var widthScale = Math.max(Math.sqrt(a * a + b * b), 1);
       var c = currentTransform[2],
           d = currentTransform[3];
       var heightScale = Math.max(Math.sqrt(c * c + d * d), 1);
       var imgToPaint, tmpCanvas;
-      if (imgData instanceof HTMLElement || !imgData.data) {
+      if (typeof HTMLElement === 'function' && imgData instanceof HTMLElement || !imgData.data) {
         imgToPaint = imgData;
       } else {
         tmpCanvas = this.cachedCanvases.getCanvas('inlineImage', width, height);
         var tmpCtx = tmpCanvas.context;
         putBinaryImageData(tmpCtx, imgData);
         imgToPaint = tmpCanvas.canvas;
       }
       var paintWidth = width,
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -12934,17 +12934,17 @@ var JpxImage = function JpxImageClosure(
               cod.multipleComponentTransform = data[j++];
               cod.decompositionLevelsCount = data[j++];
               cod.xcb = (data[j++] & 0xF) + 2;
               cod.ycb = (data[j++] & 0xF) + 2;
               var blockStyle = data[j++];
               cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1);
               cod.resetContextProbabilities = !!(blockStyle & 2);
               cod.terminationOnEachCodingPass = !!(blockStyle & 4);
-              cod.verticalyStripe = !!(blockStyle & 8);
+              cod.verticallyStripe = !!(blockStyle & 8);
               cod.predictableTermination = !!(blockStyle & 16);
               cod.segmentationSymbolUsed = !!(blockStyle & 32);
               cod.reversibleTransformation = data[j++];
               if (cod.entropyCoderWithCustomPrecincts) {
                 var precinctsSizes = [];
                 while (j < length + position) {
                   var precinctsSize = data[j++];
                   precinctsSizes.push({
@@ -12959,18 +12959,18 @@ var JpxImage = function JpxImageClosure(
                 unsupported.push('selectiveArithmeticCodingBypass');
               }
               if (cod.resetContextProbabilities) {
                 unsupported.push('resetContextProbabilities');
               }
               if (cod.terminationOnEachCodingPass) {
                 unsupported.push('terminationOnEachCodingPass');
               }
-              if (cod.verticalyStripe) {
-                unsupported.push('verticalyStripe');
+              if (cod.verticallyStripe) {
+                unsupported.push('verticallyStripe');
               }
               if (cod.predictableTermination) {
                 unsupported.push('predictableTermination');
               }
               if (unsupported.length > 0) {
                 doNotRecover = true;
                 throw new Error('Unsupported COD options (' + unsupported.join(', ') + ')');
               }
@@ -21107,18 +21107,18 @@ exports.PostScriptCompiler = PostScriptC
 
 /***/ }),
 /* 19 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.0.466';
-var pdfjsBuild = 'a8e9f6cc';
+var pdfjsVersion = '2.0.480';
+var pdfjsBuild = 'a7a034d8';
 var pdfjsCoreWorker = __w_pdfjs_require__(20);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 20 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
@@ -21309,17 +21309,17 @@ var WorkerMessageHandler = {
     });
   },
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     let apiVersion = docParams.apiVersion;
-    let workerVersion = '2.0.466';
+    let workerVersion = '2.0.480';
     if (apiVersion !== null && apiVersion !== workerVersion) {
       throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
     }
     var docId = docParams.docId;
     var docBaseUrl = docParams.docBaseUrl;
     var workerHandlerName = docParams.docId + '_worker';
     var handler = new _util.MessageHandler(workerHandlerName, docId, port);
     handler.postMessageTransfers = docParams.postMessageTransfers;
@@ -32352,17 +32352,17 @@ var CMapFactory = function CMapFactoryCl
   function parseCMapName(cMap, lexer) {
     var obj = lexer.getObj();
     if ((0, _primitives.isName)(obj) && (0, _util.isString)(obj.name)) {
       cMap.name = obj.name;
     }
   }
   function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) {
     var previous;
-    var embededUseCMap;
+    var embeddedUseCMap;
     objLoop: while (true) {
       try {
         var obj = lexer.getObj();
         if ((0, _primitives.isEOF)(obj)) {
           break;
         } else if ((0, _primitives.isName)(obj)) {
           if (obj.name === 'WMode') {
             parseWMode(cMap, lexer);
@@ -32371,17 +32371,17 @@ var CMapFactory = function CMapFactoryCl
           }
           previous = obj;
         } else if ((0, _primitives.isCmd)(obj)) {
           switch (obj.cmd) {
             case 'endcmap':
               break objLoop;
             case 'usecmap':
               if ((0, _primitives.isName)(previous)) {
-                embededUseCMap = previous.name;
+                embeddedUseCMap = previous.name;
               }
               break;
             case 'begincodespacerange':
               parseCodespaceRange(cMap, lexer);
               break;
             case 'beginbfchar':
               parseBfChar(cMap, lexer);
               break;
@@ -32399,18 +32399,18 @@ var CMapFactory = function CMapFactoryCl
       } catch (ex) {
         if (ex instanceof _util.MissingDataException) {
           throw ex;
         }
         (0, _util.warn)('Invalid cMap data: ' + ex);
         continue;
       }
     }
-    if (!useCMap && embededUseCMap) {
-      useCMap = embededUseCMap;
+    if (!useCMap && embeddedUseCMap) {
+      useCMap = embeddedUseCMap;
     }
     if (useCMap) {
       return extendCMap(cMap, fetchBuiltInCMap, useCMap);
     }
     return Promise.resolve(cMap);
   }
   function extendCMap(cMap, fetchBuiltInCMap, useCMap) {
     return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (newCMap) {
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -421,17 +421,17 @@ function cloneObj(obj) {
   return result;
 }
 const WaitOnType = {
   EVENT: 'event',
   TIMEOUT: 'timeout'
 };
 function waitOnEventOrTimeout({ target, name, delay = 0 }) {
   if (typeof target !== 'object' || !(name && typeof name === 'string') || !(Number.isInteger(delay) && delay >= 0)) {
-    return Promise.reject(new Error('waitOnEventOrTimeout - invalid paramaters.'));
+    return Promise.reject(new Error('waitOnEventOrTimeout - invalid parameters.'));
   }
   let capability = (0, _pdfjsLib.createPromiseCapability)();
   function handler(type) {
     if (target instanceof EventBus) {
       target.off(name, eventHandler);
     } else {
       target.removeEventListener(name, eventHandler);
     }