Bug 1394402 - Update pdf.js to version 1.9.489. r=bdahl
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 28 Aug 2017 09:26:07 -0400
changeset 377415 f202a1cb9af6db2ec8eb59701195dd276d7252d8
parent 377414 35c735592ec228eaece46bae3a6f4a8f998fdb0f
child 377416 cd9aa3938195762e74c1595895b462a8b0a5fe87
push id32408
push userarchaeopteryx@coole-files.de
push dateTue, 29 Aug 2017 18:31:12 +0000
treeherdermozilla-central@6c3510bac832 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl
bugs1394402
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1394402 - Update pdf.js to version 1.9.489. r=bdahl
browser/extensions/pdfjs/README.mozilla
browser/extensions/pdfjs/content/build/pdf.js
browser/extensions/pdfjs/content/build/pdf.worker.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: 1.9.476
+Current extension version is: 1.9.489
 
-Taken from upstream commit: 26c45369
+Taken from upstream commit: b7fcaff0
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -3841,18 +3841,18 @@ var _UnsupportedManager = function Unsup
       for (var i = 0, ii = listeners.length; i < ii; i++) {
         listeners[i](featureId);
       }
     }
   };
 }();
 var version, build;
 {
-  exports.version = version = '1.9.476';
-  exports.build = build = '26c45369';
+  exports.version = version = '1.9.489';
+  exports.build = build = 'b7fcaff0';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
 exports.PDFDocumentProxy = PDFDocumentProxy;
 exports.PDFPageProxy = PDFPageProxy;
 exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
@@ -4898,18 +4898,18 @@ var _svg = __w_pdfjs_require__(5);
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 var isWorker = typeof window === 'undefined';
 if (!_global_scope2.default.PDFJS) {
   _global_scope2.default.PDFJS = {};
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.476';
-  PDFJS.build = '26c45369';
+  PDFJS.version = '1.9.489';
+  PDFJS.build = 'b7fcaff0';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   (0, _util.setVerbosityLevel)(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
   get() {
@@ -10465,18 +10465,18 @@ exports.PDFDataTransportStream = PDFData
 
 /***/ }),
 /* 15 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '1.9.476';
-var pdfjsBuild = '26c45369';
+var pdfjsVersion = '1.9.489';
+var pdfjsBuild = 'b7fcaff0';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
 var pdfjsDisplayAPI = __w_pdfjs_require__(4);
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(6);
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(3);
 var pdfjsDisplayDOMUtils = __w_pdfjs_require__(1);
 var pdfjsDisplaySVG = __w_pdfjs_require__(5);
 ;
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -4483,34 +4483,38 @@ var Parser = function ParserClosure() {
       }
       return buf1;
     },
     findDefaultInlineStreamEnd(stream) {
       const E = 0x45,
             I = 0x49,
             SPACE = 0x20,
             LF = 0xA,
-            CR = 0xD,
-            n = 5;
+            CR = 0xD;
+      const n = 10,
+            NUL = 0x0;
       let startPos = stream.pos,
           state = 0,
           ch,
           maybeEIPos;
       while ((ch = stream.getByte()) !== -1) {
         if (state === 0) {
           state = ch === E ? 1 : 0;
         } else if (state === 1) {
           state = ch === I ? 2 : 0;
         } else {
           (0, _util.assert)(state === 2);
           if (ch === SPACE || ch === LF || ch === CR) {
             maybeEIPos = stream.pos;
             let followingBytes = stream.peekBytes(n);
-            for (let i = 0; i < n; i++) {
+            for (let i = 0, ii = followingBytes.length; i < ii; i++) {
               ch = followingBytes[i];
+              if (ch === NUL && followingBytes[i + 1] !== NUL) {
+                continue;
+              }
               if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) {
                 state = 0;
                 break;
               }
             }
             if (state === 2) {
               break;
             }
@@ -22099,31 +22103,39 @@ var Catalog = function CatalogClosure() 
       try {
         return (0, _util.stringToUTF8String)(url);
       } catch (e) {
         return url;
       }
     }
     var destDict = params.destDict;
     if (!(0, _primitives.isDict)(destDict)) {
-      (0, _util.warn)('Catalog_parseDestDictionary: "destDict" must be a dictionary.');
+      (0, _util.warn)('parseDestDictionary: "destDict" must be a dictionary.');
       return;
     }
     var resultObj = params.resultObj;
     if (typeof resultObj !== 'object') {
-      (0, _util.warn)('Catalog_parseDestDictionary: "resultObj" must be an object.');
+      (0, _util.warn)('parseDestDictionary: "resultObj" must be an object.');
       return;
     }
     var docBaseUrl = params.docBaseUrl || null;
     var action = destDict.get('A'),
         url,
         dest;
+    if (!(0, _primitives.isDict)(action) && destDict.has('Dest')) {
+      action = destDict.get('Dest');
+    }
     if ((0, _primitives.isDict)(action)) {
-      var linkType = action.get('S').name;
-      switch (linkType) {
+      let actionType = action.get('S');
+      if (!(0, _primitives.isName)(actionType)) {
+        (0, _util.warn)('parseDestDictionary: Invalid type in Action dictionary.');
+        return;
+      }
+      let actionName = actionType.name;
+      switch (actionName) {
         case 'URI':
           url = action.get('URI');
           if ((0, _primitives.isName)(url)) {
             url = '/' + url.name;
           } else if ((0, _util.isString)(url)) {
             url = addDefaultProtocolToUrl(url);
           }
           break;
@@ -22179,17 +22191,17 @@ var Catalog = function CatalogClosure() 
               url = jsUrl[2];
               if (jsUrl[3] === 'true' && jsUrl[1] === 'app.launchURL') {
                 resultObj.newWindow = true;
               }
               break;
             }
           }
         default:
-          (0, _util.warn)('Catalog_parseDestDictionary: Unrecognized link type "' + linkType + '".');
+          (0, _util.warn)(`parseDestDictionary: Unsupported Action type "${actionName}".`);
           break;
       }
     } else if (destDict.has('Dest')) {
       dest = destDict.get('Dest');
     }
     if ((0, _util.isString)(url)) {
       url = tryConvertUrlEncoding(url);
       var absoluteUrl = (0, _util.createValidAbsoluteUrl)(url, docBaseUrl);
@@ -40046,18 +40058,18 @@ exports.Type1Parser = Type1Parser;
 
 /***/ }),
 /* 35 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '1.9.476';
-var pdfjsBuild = '26c45369';
+var pdfjsVersion = '1.9.489';
+var pdfjsBuild = 'b7fcaff0';
 var pdfjsCoreWorker = __w_pdfjs_require__(17);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 36 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";