Browse Source

PDF.js version 1.9.640 - See mozilla/pdf.js@853db85b7648397148c4b6ef77852578ee1aa8a1

master v1.9.640
pdfjsbot 7 years ago
parent
commit
a289ae5157
  1. 2
      bower.json
  2. 16
      build/pdf.combined.js
  3. 2
      build/pdf.combined.js.map
  4. 14
      build/pdf.js
  5. 2
      build/pdf.js.map
  6. 2
      build/pdf.min.js
  7. 6
      build/pdf.worker.js
  8. 2
      build/pdf.worker.js.map
  9. 2
      build/pdf.worker.min.js
  10. 2
      lib/core/worker.js
  11. 6
      lib/display/api.js
  12. 4
      lib/display/global.js
  13. 4
      lib/pdf.js
  14. 4
      lib/pdf.worker.js
  15. 38
      lib/test/unit/pdf_history_spec.js
  16. 25
      lib/web/pdf_history.js
  17. 2
      package.json
  18. 25
      web/pdf_viewer.js
  19. 2
      web/pdf_viewer.js.map

2
bower.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.9.638",
"version": "1.9.640",
"main": [
"build/pdf.js",
"build/pdf.worker.js"

16
build/pdf.combined.js

@ -11341,7 +11341,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -11341,7 +11341,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '1.9.638';
var apiVersion = '1.9.640';
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
source.chunkedViewerLoading = !!pdfDataRangeTransport;
@ -12645,8 +12645,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -12645,8 +12645,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.638';
exports.build = build = 'c8023772';
exports.version = version = '1.9.640';
exports.build = build = '853db85b';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -29761,8 +29761,8 @@ exports.SVGGraphics = SVGGraphics; @@ -29761,8 +29761,8 @@ exports.SVGGraphics = SVGGraphics;
"use strict";
var pdfjsVersion = '1.9.638';
var pdfjsBuild = 'c8023772';
var pdfjsVersion = '1.9.640';
var pdfjsBuild = '853db85b';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(98);
var pdfjsDisplayAPI = __w_pdfjs_require__(54);
@ -35623,8 +35623,8 @@ if (!_global_scope2.default.PDFJS) { @@ -35623,8 +35623,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.638';
PDFJS.build = 'c8023772';
PDFJS.version = '1.9.640';
PDFJS.build = '853db85b';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -38581,7 +38581,7 @@ var WorkerMessageHandler = { @@ -38581,7 +38581,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '1.9.638';
var workerVersion = '1.9.640';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

2
build/pdf.combined.js.map

File diff suppressed because one or more lines are too long

14
build/pdf.js

@ -2946,7 +2946,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -2946,7 +2946,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '1.9.638';
var apiVersion = '1.9.640';
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
source.chunkedViewerLoading = !!pdfDataRangeTransport;
@ -4337,8 +4337,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -4337,8 +4337,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.638';
exports.build = build = 'c8023772';
exports.version = version = '1.9.640';
exports.build = build = '853db85b';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -7410,8 +7410,8 @@ exports.SVGGraphics = SVGGraphics; @@ -7410,8 +7410,8 @@ exports.SVGGraphics = SVGGraphics;
"use strict";
var pdfjsVersion = '1.9.638';
var pdfjsBuild = 'c8023772';
var pdfjsVersion = '1.9.640';
var pdfjsBuild = '853db85b';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(82);
var pdfjsDisplayAPI = __w_pdfjs_require__(48);
@ -13272,8 +13272,8 @@ if (!_global_scope2.default.PDFJS) { @@ -13272,8 +13272,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.638';
PDFJS.build = 'c8023772';
PDFJS.version = '1.9.640';
PDFJS.build = '853db85b';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

2
build/pdf.js.map

File diff suppressed because one or more lines are too long

2
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

6
build/pdf.worker.js vendored

@ -24705,8 +24705,8 @@ exports.PostScriptCompiler = PostScriptCompiler; @@ -24705,8 +24705,8 @@ exports.PostScriptCompiler = PostScriptCompiler;
"use strict";
var pdfjsVersion = '1.9.638';
var pdfjsBuild = 'c8023772';
var pdfjsVersion = '1.9.640';
var pdfjsBuild = '853db85b';
var pdfjsCoreWorker = __w_pdfjs_require__(62);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -24911,7 +24911,7 @@ var WorkerMessageHandler = { @@ -24911,7 +24911,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '1.9.638';
var workerVersion = '1.9.640';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

2
build/pdf.worker.js.map vendored

File diff suppressed because one or more lines are too long

2
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

2
lib/core/worker.js

@ -208,7 +208,7 @@ var WorkerMessageHandler = { @@ -208,7 +208,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
var apiVersion = docParams.apiVersion;
var workerVersion = '1.9.638';
var workerVersion = '1.9.640';
if (apiVersion !== null && apiVersion !== workerVersion) {
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
}

6
lib/display/api.js

@ -193,7 +193,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { @@ -193,7 +193,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
if (worker.destroyed) {
return Promise.reject(new Error('Worker was destroyed'));
}
var apiVersion = '1.9.638';
var apiVersion = '1.9.640';
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
source.chunkedViewerLoading = !!pdfDataRangeTransport;
@ -1584,8 +1584,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { @@ -1584,8 +1584,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.9.638';
exports.build = build = 'c8023772';
exports.version = version = '1.9.640';
exports.build = build = '853db85b';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;

4
lib/display/global.js

@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) { @@ -44,8 +44,8 @@ if (!_global_scope2.default.PDFJS) {
}
var PDFJS = _global_scope2.default.PDFJS;
{
PDFJS.version = '1.9.638';
PDFJS.build = 'c8023772';
PDFJS.version = '1.9.640';
PDFJS.build = '853db85b';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {

4
lib/pdf.js

@ -14,8 +14,8 @@ @@ -14,8 +14,8 @@
*/
'use strict';
var pdfjsVersion = '1.9.638';
var pdfjsBuild = 'c8023772';
var pdfjsVersion = '1.9.640';
var pdfjsBuild = '853db85b';
var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js');

4
lib/pdf.worker.js vendored

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
*/
'use strict';
var pdfjsVersion = '1.9.638';
var pdfjsBuild = 'c8023772';
var pdfjsVersion = '1.9.640';
var pdfjsBuild = '853db85b';
var pdfjsCoreWorker = require('./core/worker.js');
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

38
lib/test/unit/pdf_history_spec.js

@ -17,7 +17,27 @@ @@ -17,7 +17,27 @@
var _pdf_history = require('../../web/pdf_history');
describe('pdf_history', function () {
describe('isDestsEqual', function () {
describe('isDestHashesEqual', function () {
it('should reject non-equal destination hashes', function () {
expect((0, _pdf_history.isDestHashesEqual)(null, 'page.157')).toEqual(false);
expect((0, _pdf_history.isDestHashesEqual)('title.0', 'page.157')).toEqual(false);
expect((0, _pdf_history.isDestHashesEqual)('page=1&zoom=auto', 'page.157')).toEqual(false);
expect((0, _pdf_history.isDestHashesEqual)('nameddest-page.157', 'page.157')).toEqual(false);
expect((0, _pdf_history.isDestHashesEqual)('page.157', 'nameddest=page.157')).toEqual(false);
var destArrayString = JSON.stringify([{
num: 3757,
gen: 0
}, { name: 'XYZ' }, 92.918, 748.972, null]);
expect((0, _pdf_history.isDestHashesEqual)(destArrayString, 'page.157')).toEqual(false);
expect((0, _pdf_history.isDestHashesEqual)('page.157', destArrayString)).toEqual(false);
});
it('should accept equal destination hashes', function () {
expect((0, _pdf_history.isDestHashesEqual)('page.157', 'page.157')).toEqual(true);
expect((0, _pdf_history.isDestHashesEqual)('nameddest=page.157', 'page.157')).toEqual(true);
expect((0, _pdf_history.isDestHashesEqual)('nameddest=page.157&zoom=100', 'page.157')).toEqual(true);
});
});
describe('isDestArraysEqual', function () {
var firstDest = [{
num: 1,
gen: 0
@ -39,18 +59,18 @@ describe('pdf_history', function () { @@ -39,18 +59,18 @@ describe('pdf_history', function () {
num: 1
}, { name: 'XYZ' }, 0, 375, null];
it('should reject non-equal destination arrays', function () {
expect((0, _pdf_history.isDestsEqual)(firstDest, undefined)).toEqual(false);
expect((0, _pdf_history.isDestsEqual)(firstDest, [1, 2, 3, 4, 5])).toEqual(false);
expect((0, _pdf_history.isDestsEqual)(firstDest, secondDest)).toEqual(false);
expect((0, _pdf_history.isDestsEqual)(firstDest, thirdDest)).toEqual(false);
expect((0, _pdf_history.isDestsEqual)(firstDest, fourthDest)).toEqual(false);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, undefined)).toEqual(false);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, [1, 2, 3, 4, 5])).toEqual(false);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, secondDest)).toEqual(false);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, thirdDest)).toEqual(false);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, fourthDest)).toEqual(false);
});
it('should accept equal destination arrays', function () {
expect((0, _pdf_history.isDestsEqual)(firstDest, firstDest)).toEqual(true);
expect((0, _pdf_history.isDestsEqual)(firstDest, fifthDest)).toEqual(true);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, firstDest)).toEqual(true);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, fifthDest)).toEqual(true);
var firstDestCopy = firstDest.slice();
expect(firstDest).not.toBe(firstDestCopy);
expect((0, _pdf_history.isDestsEqual)(firstDest, firstDestCopy)).toEqual(true);
expect((0, _pdf_history.isDestArraysEqual)(firstDest, firstDestCopy)).toEqual(true);
});
});
});

25
lib/web/pdf_history.js

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isDestsEqual = exports.PDFHistory = undefined;
exports.isDestArraysEqual = exports.isDestHashesEqual = exports.PDFHistory = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -151,7 +151,7 @@ var PDFHistory = function () { @@ -151,7 +151,7 @@ var PDFHistory = function () {
return;
}
var forceReplace = false;
if (this._destination && (this._destination.hash === hash || isDestsEqual(this._destination.dest, explicitDest))) {
if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
if (this._destination.page) {
return;
}
@ -407,7 +407,23 @@ var PDFHistory = function () { @@ -407,7 +407,23 @@ var PDFHistory = function () {
return PDFHistory;
}();
function isDestsEqual(firstDest, secondDest) {
function isDestHashesEqual(destHash, pushHash) {
if (typeof destHash !== 'string' || typeof pushHash !== 'string') {
return false;
}
if (destHash === pushHash) {
return true;
}
var _parseQueryString = (0, _ui_utils.parseQueryString)(destHash),
nameddest = _parseQueryString.nameddest;
if (nameddest === pushHash) {
return true;
}
return false;
}
function isDestArraysEqual(firstDest, secondDest) {
function isEntryEqual(first, second) {
if ((typeof first === 'undefined' ? 'undefined' : _typeof(first)) !== (typeof second === 'undefined' ? 'undefined' : _typeof(second))) {
return false;
@ -442,4 +458,5 @@ function isDestsEqual(firstDest, secondDest) { @@ -442,4 +458,5 @@ function isDestsEqual(firstDest, secondDest) {
return true;
}
exports.PDFHistory = PDFHistory;
exports.isDestsEqual = isDestsEqual;
exports.isDestHashesEqual = isDestHashesEqual;
exports.isDestArraysEqual = isDestArraysEqual;

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "pdfjs-dist",
"version": "1.9.638",
"version": "1.9.640",
"main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.",
"keywords": [

25
web/pdf_viewer.js

@ -3426,7 +3426,7 @@ exports.PDFSinglePageViewer = PDFSinglePageViewer; @@ -3426,7 +3426,7 @@ exports.PDFSinglePageViewer = PDFSinglePageViewer;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isDestsEqual = exports.PDFHistory = undefined;
exports.isDestArraysEqual = exports.isDestHashesEqual = exports.PDFHistory = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -3560,7 +3560,7 @@ var PDFHistory = function () { @@ -3560,7 +3560,7 @@ var PDFHistory = function () {
return;
}
var forceReplace = false;
if (this._destination && (this._destination.hash === hash || isDestsEqual(this._destination.dest, explicitDest))) {
if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
if (this._destination.page) {
return;
}
@ -3816,7 +3816,23 @@ var PDFHistory = function () { @@ -3816,7 +3816,23 @@ var PDFHistory = function () {
return PDFHistory;
}();
function isDestsEqual(firstDest, secondDest) {
function isDestHashesEqual(destHash, pushHash) {
if (typeof destHash !== 'string' || typeof pushHash !== 'string') {
return false;
}
if (destHash === pushHash) {
return true;
}
var _parseQueryString = (0, _ui_utils.parseQueryString)(destHash),
nameddest = _parseQueryString.nameddest;
if (nameddest === pushHash) {
return true;
}
return false;
}
function isDestArraysEqual(firstDest, secondDest) {
function isEntryEqual(first, second) {
if ((typeof first === 'undefined' ? 'undefined' : _typeof(first)) !== (typeof second === 'undefined' ? 'undefined' : _typeof(second))) {
return false;
@ -3851,7 +3867,8 @@ function isDestsEqual(firstDest, secondDest) { @@ -3851,7 +3867,8 @@ function isDestsEqual(firstDest, secondDest) {
return true;
}
exports.PDFHistory = PDFHistory;
exports.isDestsEqual = isDestsEqual;
exports.isDestHashesEqual = isDestHashesEqual;
exports.isDestArraysEqual = isDestArraysEqual;
/***/ }),
/* 13 */

2
web/pdf_viewer.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save