Bug 1512982 - Update pdf.js to version 2.1.97. r=bdahl a=RyanVM-on-IRC
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 10 Dec 2018 10:09:44 -0500
changeset 506151 6d14e4da344d756c2a4ce71af61d5cb131a8e359
parent 506150 f9ef4b24affae8cf8b72973c6d2f76e65bd986d8
child 506152 0cf938ef3c98b60c9e276a197b50ea9a2bf14c38
push id10306
push userarchaeopteryx@coole-files.de
push dateMon, 10 Dec 2018 16:26:52 +0000
treeherdermozilla-beta@6d14e4da344d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl, RyanVM-on-IRC
bugs1512982
milestone65.0
Bug 1512982 - Update pdf.js to version 2.1.97. r=bdahl a=RyanVM-on-IRC
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
browser/extensions/pdfjs/moz.yaml
--- 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.1.86
+Current extension version is: 2.1.97
 
-Taken from upstream commit: 1cb7cc9b
+Taken from upstream commit: 45c01974
--- a/browser/extensions/pdfjs/content/build/pdf.js
+++ b/browser/extensions/pdfjs/content/build/pdf.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.1.86';
-var pdfjsBuild = '1cb7cc9b';
+var pdfjsVersion = '2.1.97';
+var pdfjsBuild = '45c01974';
 
 var pdfjsSharedUtil = __w_pdfjs_require__(1);
 
 var pdfjsDisplayAPI = __w_pdfjs_require__(7);
 
 var pdfjsDisplayTextLayer = __w_pdfjs_require__(19);
 
 var pdfjsDisplayAnnotationLayer = __w_pdfjs_require__(20);
@@ -5136,17 +5136,17 @@ function _fetchDocument(worker, source, 
 
   if (pdfDataRangeTransport) {
     source.length = pdfDataRangeTransport.length;
     source.initialData = pdfDataRangeTransport.initialData;
   }
 
   return worker.messageHandler.sendWithPromise('GetDocRequest', {
     docId,
-    apiVersion: '2.1.86',
+    apiVersion: '2.1.97',
     source: {
       data: source.data,
       url: source.url,
       password: source.password,
       disableAutoFetch: source.disableAutoFetch,
       rangeChunkSize: source.rangeChunkSize,
       length: source.length
     },
@@ -6855,19 +6855,19 @@ const InternalRenderTask = function Inte
       }
     }
 
   }
 
   return InternalRenderTask;
 }();
 
-const version = '2.1.86';
+const version = '2.1.97';
 exports.version = version;
-const build = '1cb7cc9b';
+const build = '45c01974';
 exports.build = build;
 
 /***/ }),
 /* 8 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -118,18 +118,18 @@ return /******/ (function(modules) { // 
 /************************************************************************/
 /******/ ([
 /* 0 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
 
 "use strict";
 
 
-var pdfjsVersion = '2.1.86';
-var pdfjsBuild = '1cb7cc9b';
+var pdfjsVersion = '2.1.97';
+var pdfjsBuild = '45c01974';
 
 var pdfjsCoreWorker = __w_pdfjs_require__(1);
 
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
 /***/ }),
 /* 1 */
 /***/ (function(module, exports, __w_pdfjs_require__) {
@@ -370,17 +370,17 @@ var WorkerMessageHandler = {
   },
 
   createDocumentHandler(docParams, port) {
     var pdfManager;
     var terminated = false;
     var cancelXHRs = null;
     var WorkerTasks = [];
     let apiVersion = docParams.apiVersion;
-    let workerVersion = '2.1.86';
+    let workerVersion = '2.1.97';
 
     if (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';
--- a/browser/extensions/pdfjs/content/web/viewer.js
+++ b/browser/extensions/pdfjs/content/web/viewer.js
@@ -411,31 +411,24 @@ let PDFViewerApplication = {
       this.eventBus.dispatch('localized', {
         source: this
       });
     });
     this.initialized = true;
   },
 
   async _readPreferences() {
-    const OVERRIDES = {
-      disableFontFace: true,
-      disableRange: true,
-      disableStream: true,
-      textLayerMode: _ui_utils.TextLayerMode.DISABLE
-    };
+    if (_app_options.AppOptions.get('disablePreferences') === true) {
+      return;
+    }
 
     try {
       const prefs = await this.preferences.getAll();
 
-      for (let name in prefs) {
-        if (name in OVERRIDES && _app_options.AppOptions.get(name) === OVERRIDES[name]) {
-          continue;
-        }
-
+      for (const name in prefs) {
         _app_options.AppOptions.set(name, prefs[name]);
       }
     } catch (reason) {}
   },
 
   async _parseHashParameters() {
     if (!_app_options.AppOptions.get('pdfBugEnabled')) {
       return;
@@ -5975,17 +5968,17 @@ class PDFHistory {
     }
 
     if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {
       return;
     }
 
     let forceReplace = false;
 
-    if (this._destination.page === position.first || this._destination.page === position.page) {
+    if (this._destination.page >= position.first && this._destination.page <= position.page) {
       if (this._destination.dest || !this._destination.first) {
         return;
       }
 
       forceReplace = true;
     }
 
     this._pushOrReplaceState(position, forceReplace);
--- a/browser/extensions/pdfjs/moz.yaml
+++ b/browser/extensions/pdfjs/moz.yaml
@@ -15,15 +15,15 @@ origin:
   description: Portable Document Format (PDF) viewer that is built with HTML5
 
   # Full URL for the package's homepage/etc
   # Usually different from repository url
   url: https://github.com/mozilla/pdf.js
 
   # Human-readable identifier for this version/release
   # Generally "version NNN", "tag SSS", "bookmark SSS"
-  release: version 2.1.86
+  release: version 2.1.97
 
   # The package's license, where possible using the mnemonic from
   # https://spdx.org/licenses/
   # Multiple licenses can be specified (as a YAML list)
   # A "LICENSE" file must exist containing the full license text
   license: Apache-2.0