зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1354081 - Update pdf.js to version 1.7.418. r=bdahl
This commit is contained in:
Родитель
49cdc6d567
Коммит
f1e573b0c7
|
@ -1,3 +1,3 @@
|
|||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.7.401
|
||||
Current extension version is: 1.7.418
|
||||
|
|
|
@ -190,9 +190,9 @@ var PdfJs = {
|
|||
|
||||
updateRegistration: function updateRegistration() {
|
||||
if (this.enabled) {
|
||||
this._ensureRegistered();
|
||||
this.ensureRegistered();
|
||||
} else {
|
||||
this._ensureUnregistered();
|
||||
this.ensureUnregistered();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -205,7 +205,7 @@ var PdfJs = {
|
|||
Services.obs.removeObserver(this, TOPIC_PLUGIN_INFO_UPDATED);
|
||||
this._initialized = false;
|
||||
}
|
||||
this._ensureUnregistered();
|
||||
this.ensureUnregistered();
|
||||
},
|
||||
|
||||
_migrate: function migrate() {
|
||||
|
@ -324,7 +324,7 @@ var PdfJs = {
|
|||
return !enabledPluginFound;
|
||||
},
|
||||
|
||||
_ensureRegistered: function _ensureRegistered() {
|
||||
ensureRegistered: function ensureRegistered() {
|
||||
if (this._registered) {
|
||||
return;
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ var PdfJs = {
|
|||
this._registered = true;
|
||||
},
|
||||
|
||||
_ensureUnregistered: function _ensureUnregistered() {
|
||||
ensureUnregistered: function ensureUnregistered() {
|
||||
if (!this._registered) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,9 @@ const MAX_STRING_PREF_LENGTH = 128;
|
|||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetworkManager",
|
||||
"resource://pdf.js/PdfJsNetwork.jsm");
|
||||
|
|
|
@ -1292,6 +1292,16 @@ var CustomStyle = function CustomStyleClosure() {
|
|||
};
|
||||
return CustomStyle;
|
||||
}();
|
||||
var RenderingCancelledException = function RenderingCancelledException() {
|
||||
function RenderingCancelledException(msg, type) {
|
||||
this.message = msg;
|
||||
this.type = type;
|
||||
}
|
||||
RenderingCancelledException.prototype = new Error();
|
||||
RenderingCancelledException.prototype.name = 'RenderingCancelledException';
|
||||
RenderingCancelledException.constructor = RenderingCancelledException;
|
||||
return RenderingCancelledException;
|
||||
}();
|
||||
var hasCanvasTypedArrays;
|
||||
hasCanvasTypedArrays = function () {
|
||||
return true;
|
||||
|
@ -1380,6 +1390,8 @@ function getDefaultSetting(id) {
|
|||
return globalSettings ? globalSettings.externalLinkRel : DEFAULT_LINK_REL;
|
||||
case 'enableStats':
|
||||
return !!(globalSettings && globalSettings.enableStats);
|
||||
case 'pdfjsNext':
|
||||
return !!(globalSettings && globalSettings.pdfjsNext);
|
||||
default:
|
||||
throw new Error('Unknown default setting: ' + id);
|
||||
}
|
||||
|
@ -1407,6 +1419,7 @@ exports.isExternalLinkTargetSet = isExternalLinkTargetSet;
|
|||
exports.isValidUrl = isValidUrl;
|
||||
exports.getFilenameFromUrl = getFilenameFromUrl;
|
||||
exports.LinkTarget = LinkTarget;
|
||||
exports.RenderingCancelledException = RenderingCancelledException;
|
||||
exports.hasCanvasTypedArrays = hasCanvasTypedArrays;
|
||||
exports.getDefaultSetting = getDefaultSetting;
|
||||
exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL;
|
||||
|
@ -2068,6 +2081,7 @@ var FontFaceObject = displayFontLoader.FontFaceObject;
|
|||
var FontLoader = displayFontLoader.FontLoader;
|
||||
var CanvasGraphics = displayCanvas.CanvasGraphics;
|
||||
var Metadata = displayMetadata.Metadata;
|
||||
var RenderingCancelledException = displayDOMUtils.RenderingCancelledException;
|
||||
var getDefaultSetting = displayDOMUtils.getDefaultSetting;
|
||||
var DOMCanvasFactory = displayDOMUtils.DOMCanvasFactory;
|
||||
var DOMCMapReaderFactory = displayDOMUtils.DOMCMapReaderFactory;
|
||||
|
@ -3298,7 +3312,7 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
|
|||
cancel: function InternalRenderTask_cancel() {
|
||||
this.running = false;
|
||||
this.cancelled = true;
|
||||
this.callback('cancelled');
|
||||
this.callback(new RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
|
||||
},
|
||||
operatorListChanged: function InternalRenderTask_operatorListChanged() {
|
||||
if (!this.graphicsReady) {
|
||||
|
@ -3363,8 +3377,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
|
|||
}
|
||||
};
|
||||
}();
|
||||
exports.version = '1.7.401';
|
||||
exports.build = '57d9a64c';
|
||||
exports.version = '1.7.418';
|
||||
exports.build = 'a662d268';
|
||||
exports.getDocument = getDocument;
|
||||
exports.PDFDataRangeTransport = PDFDataRangeTransport;
|
||||
exports.PDFWorker = PDFWorker;
|
||||
|
@ -4331,8 +4345,8 @@ if (!globalScope.PDFJS) {
|
|||
globalScope.PDFJS = {};
|
||||
}
|
||||
var PDFJS = globalScope.PDFJS;
|
||||
PDFJS.version = '1.7.401';
|
||||
PDFJS.build = '57d9a64c';
|
||||
PDFJS.version = '1.7.418';
|
||||
PDFJS.build = 'a662d268';
|
||||
PDFJS.pdfBug = false;
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
sharedUtil.setVerbosityLevel(PDFJS.verbosity);
|
||||
|
@ -4392,6 +4406,7 @@ PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebG
|
|||
PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? LinkTarget.NONE : PDFJS.externalLinkTarget;
|
||||
PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? DEFAULT_LINK_REL : PDFJS.externalLinkRel;
|
||||
PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
|
||||
PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
|
||||
PDFJS.getDocument = displayAPI.getDocument;
|
||||
PDFJS.PDFDataRangeTransport = displayAPI.PDFDataRangeTransport;
|
||||
PDFJS.PDFWorker = displayAPI.PDFWorker;
|
||||
|
@ -6670,8 +6685,8 @@ exports.TilingPattern = TilingPattern;
|
|||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.7.401';
|
||||
var pdfjsBuild = '57d9a64c';
|
||||
var pdfjsVersion = '1.7.418';
|
||||
var pdfjsBuild = 'a662d268';
|
||||
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
||||
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
|
||||
var pdfjsDisplayAPI = __w_pdfjs_require__(3);
|
||||
|
@ -6702,6 +6717,7 @@ exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
|
|||
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
|
||||
exports.shadow = pdfjsSharedUtil.shadow;
|
||||
exports.createBlob = pdfjsSharedUtil.createBlob;
|
||||
exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
|
||||
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
|
||||
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
|
||||
|
||||
|
|
|
@ -27676,9 +27676,6 @@ var Font = function FontClosure() {
|
|||
}
|
||||
glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start];
|
||||
glyphId = glyphId + delta & 0xFFFF;
|
||||
if (glyphId === 0) {
|
||||
continue;
|
||||
}
|
||||
mappings.push({
|
||||
charCode: j,
|
||||
glyphId: glyphId
|
||||
|
@ -36373,8 +36370,8 @@ exports.Type1Parser = Type1Parser;
|
|||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.7.401';
|
||||
var pdfjsBuild = '57d9a64c';
|
||||
var pdfjsVersion = '1.7.418';
|
||||
var pdfjsBuild = 'a662d268';
|
||||
var pdfjsCoreWorker = __w_pdfjs_require__(17);
|
||||
;
|
||||
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/* Copyright 2014 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals Components, PdfJs, Services */
|
||||
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
* pdfjschildbootstrap-enabled.js loads into the content process to
|
||||
* take care of initializing our built-in version of pdfjs when
|
||||
* running remote. It will only be run when PdfJs.enable is true.
|
||||
*/
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://pdf.js/PdfJs.jsm");
|
||||
|
||||
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
// register various pdfjs factories that hook us into content loading.
|
||||
PdfJs.ensureRegistered();
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals Components, PdfjsContentUtils, PdfJs, Services */
|
||||
/* globals Components, PdfjsContentUtils */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -21,14 +21,7 @@
|
|||
* initializing our built-in version of pdfjs when running remote.
|
||||
*/
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://pdf.js/PdfJs.jsm");
|
||||
Components.utils.import("resource://pdf.js/PdfjsContentUtils.jsm");
|
||||
|
||||
// init content utils shim pdfjs will use to access privileged apis.
|
||||
PdfjsContentUtils.init();
|
||||
|
||||
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
|
||||
// register various pdfjs factories that hook us into content loading.
|
||||
PdfJs.updateRegistration();
|
||||
}
|
||||
|
|
|
@ -4944,7 +4944,7 @@ var PDFPageView = function PDFPageViewClosure() {
|
|||
if (paintTask === self.paintTask) {
|
||||
self.paintTask = null;
|
||||
}
|
||||
if (error === 'cancelled') {
|
||||
if (error instanceof pdfjsLib.RenderingCancelledException) {
|
||||
self.error = null;
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче