Bug 1157827 - Update pdf.js to version 1.1.82. r=bdahl, r=Mossop

This commit is contained in:
Ryan VanderMeulen 2015-04-27 18:06:55 -04:00
parent cee2c0116a
commit 334b3d9808
9 changed files with 564 additions and 463 deletions

View File

@ -1,3 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.1.24
Current extension version is: 1.1.82

View File

@ -459,8 +459,6 @@ ChromeActions.prototype = {
var winmm = this.domWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
@ -773,8 +771,6 @@ function FindEventManager(contentWindow) {
this.contentWindow = contentWindow;
this.winmm = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
}

View File

@ -194,9 +194,8 @@ let PdfjsChromeUtils = {
},
handleEvent: function(aEvent) {
// We cannot just forward the message as a CPOW without setting up
// __exposedProps__ on it. Instead, let's just create a structured
// cloneable version of the event for performance and for the ease of usage.
// To avoid forwarding the message as a CPOW, create a structured cloneable
// version of the event for both performance, and ease of usage, reasons.
let type = aEvent.type;
let detail = {
query: aEvent.detail.query,
@ -205,16 +204,16 @@ let PdfjsChromeUtils = {
findPrevious: aEvent.detail.findPrevious
};
let chromeWindow = aEvent.target.ownerDocument.defaultView;
let browser = chromeWindow.gBrowser.selectedBrowser;
if (this._browsers.has(browser)) {
// Only forward the events if the selected browser is a registered
// browser.
let mm = browser.messageManager;
mm.sendAsyncMessage('PDFJS:Child:handleEvent',
{ type: type, detail: detail });
aEvent.preventDefault();
let browser = aEvent.currentTarget.browser;
if (!this._browsers.has(browser)) {
throw new Error('FindEventManager was not bound ' +
'for the current browser.');
}
// Only forward the events if the current browser is a registered browser.
let mm = browser.messageManager;
mm.sendAsyncMessage('PDFJS:Child:handleEvent',
{ type: type, detail: detail });
aEvent.preventDefault();
},
_types: ['find',

View File

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {};
}
PDFJS.version = '1.1.24';
PDFJS.build = 'f6a8110';
PDFJS.version = '1.1.82';
PDFJS.build = '71ab5e5';
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
@ -239,17 +239,10 @@ function warn(msg) {
// Fatal errors that should trigger the fallback UI and halt execution by
// throwing an exception.
function error(msg) {
// If multiple arguments were passed, pass them all to the log function.
if (arguments.length > 1) {
var logArguments = ['Error:'];
logArguments.push.apply(logArguments, arguments);
console.log.apply(console, logArguments);
// Join the arguments into a single string for the lines below.
msg = [].join.call(arguments, ' ');
} else {
if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) {
console.log('Error: ' + msg);
console.log(backtrace());
}
console.log(backtrace());
UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);
throw new Error(msg);
}

View File

@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {};
}
PDFJS.version = '1.1.24';
PDFJS.build = 'f6a8110';
PDFJS.version = '1.1.82';
PDFJS.build = '71ab5e5';
(function pdfjsWrapper() {
// Use strict in our context only - users might not want it
@ -239,17 +239,10 @@ function warn(msg) {
// Fatal errors that should trigger the fallback UI and halt execution by
// throwing an exception.
function error(msg) {
// If multiple arguments were passed, pass them all to the log function.
if (arguments.length > 1) {
var logArguments = ['Error:'];
logArguments.push.apply(logArguments, arguments);
console.log.apply(console, logArguments);
// Join the arguments into a single string for the lines below.
msg = [].join.call(arguments, ' ');
} else {
if (PDFJS.verbosity >= PDFJS.VERBOSITY_LEVELS.errors) {
console.log('Error: ' + msg);
console.log(backtrace());
}
console.log(backtrace());
UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown);
throw new Error(msg);
}
@ -3126,6 +3119,7 @@ var Catalog = (function CatalogClosure() {
var nodesToVisit = [this.catDict.getRaw('Pages')];
var currentPageIndex = 0;
var xref = this.xref;
var checkAllKids = false;
function next() {
while (nodesToVisit.length) {
@ -3133,7 +3127,7 @@ var Catalog = (function CatalogClosure() {
if (isRef(currentNode)) {
xref.fetchAsync(currentNode).then(function (obj) {
if ((isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids')))) {
if (isDict(obj, 'Page') || (isDict(obj) && !obj.has('Kids'))) {
if (pageIndex === currentPageIndex) {
capability.resolve([obj, currentNode]);
} else {
@ -3148,12 +3142,17 @@ var Catalog = (function CatalogClosure() {
return;
}
// must be a child page dictionary
// Must be a child page dictionary.
assert(
isDict(currentNode),
'page dictionary kid reference points to wrong type of object'
);
var count = currentNode.get('Count');
// If the current node doesn't have any children, avoid getting stuck
// in an empty node further down in the tree (see issue5644.pdf).
if (count === 0) {
checkAllKids = true;
}
// Skip nodes where the page can't be.
if (currentPageIndex + count <= pageIndex) {
currentPageIndex += count;
@ -3162,7 +3161,7 @@ var Catalog = (function CatalogClosure() {
var kids = currentNode.get('Kids');
assert(isArray(kids), 'page dictionary kids object is not an array');
if (count === kids.length) {
if (!checkAllKids && count === kids.length) {
// Nodes that don't have the page have been skipped and this is the
// bottom of the tree which means the page requested must be a
// descendant of this pages node. Ideally we would just resolve the
@ -9140,7 +9139,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
this.cf = dict.get('CF');
this.stmf = dict.get('StmF') || identityName;
this.strf = dict.get('StrF') || identityName;
this.eff = dict.get('EFF') || this.strf;
this.eff = dict.get('EFF') || this.stmf;
}
}
@ -9215,6 +9214,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
return CipherTransformFactory;
})();
var PatternType = {
FUNCTION_BASED: 1,
AXIAL: 2,
@ -16191,6 +16191,38 @@ var Font = (function FontClosure() {
return readUint32(header, 0) === 0x00010000;
}
/**
* Helper function for |adjustMapping|.
* @return {boolean}
*/
function isProblematicUnicodeLocation(code) {
if (code <= 0x1F) { // Control chars
return true;
}
if (code >= 0x80 && code <= 0x9F) { // Control chars
return true;
}
if ((code >= 0x2000 && code <= 0x200F) || // General punctuation chars
(code >= 0x2028 && code <= 0x202F) ||
(code >= 0x2060 && code <= 0x206F)) {
return true;
}
if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials Unicode block
return true;
}
switch (code) {
case 0x7F: // Control char
case 0xA0: // Non breaking space
case 0xAD: // Soft hyphen
case 0x0E33: // Thai character SARA AM
case 0x2011: // Non breaking hyphen
case 0x205F: // Medium mathematical space
case 0x25CC: // Dotted circle (combining mark)
return true;
}
return false;
}
/**
* Rebuilds the char code to glyph ID map by trying to replace the char codes
* with their unicode value. It also moves char codes that are in known
@ -16230,15 +16262,7 @@ var Font = (function FontClosure() {
// characters probably aren't in the correct position (fixes an issue
// with firefox and thuluthfont).
if ((usedFontCharCodes[fontCharCode] !== undefined ||
fontCharCode <= 0x1f || // Control chars
fontCharCode === 0x7F || // Control char
fontCharCode === 0xAD || // Soft hyphen
fontCharCode === 0xA0 || // Non breaking space
fontCharCode === 0x0E33 || // Thai character SARA AM
fontCharCode === 0x25CC || // Dotted circle (combining mark)
(fontCharCode >= 0x80 && fontCharCode <= 0x9F) || // Control chars
// Prevent drawing characters in the specials unicode block.
(fontCharCode >= 0xFFF0 && fontCharCode <= 0xFFFF) ||
isProblematicUnicodeLocation(fontCharCode) ||
(isSymbolic && isIdentityUnicode)) &&
nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left.
// Loop to try and find a free spot in the private use area.
@ -30995,25 +31019,25 @@ var StreamsSequenceStream = (function StreamsSequenceStreamClosure() {
})();
var FlateStream = (function FlateStreamClosure() {
var codeLenCodeMap = new Uint32Array([
var codeLenCodeMap = new Int32Array([
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
]);
var lengthDecode = new Uint32Array([
var lengthDecode = new Int32Array([
0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a,
0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f,
0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073,
0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102
]);
var distDecode = new Uint32Array([
var distDecode = new Int32Array([
0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d,
0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1,
0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01,
0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001
]);
var fixedLitCodeTab = [new Uint32Array([
var fixedLitCodeTab = [new Int32Array([
0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0,
0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0,
0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0,
@ -31080,7 +31104,7 @@ var FlateStream = (function FlateStreamClosure() {
0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff
]), 9];
var fixedDistCodeTab = [new Uint32Array([
var fixedDistCodeTab = [new Int32Array([
0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c,
0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000,
0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d,
@ -31177,7 +31201,7 @@ var FlateStream = (function FlateStreamClosure() {
// build the table
var size = 1 << maxLen;
var codes = new Uint32Array(size);
var codes = new Int32Array(size);
for (var len = 1, code = 0, skip = 2;
len <= maxLen;
++len, code <<= 1, skip <<= 1) {

View File

@ -31,7 +31,8 @@ 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) {
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
// register various pdfjs factories that hook us into content loading.
PdfJs.updateRegistration();
}

View File

@ -102,12 +102,12 @@
box-shadow: 0px 2px 10px #ff0;
}
:-moz-full-screen .pdfViewer .page {
.pdfPresentationMode:-moz-full-screen .pdfViewer .page {
margin-bottom: 100%;
border: 0;
}
:fullscreen .pdfViewer .page {
.pdfPresentationMode:fullscreen .pdfViewer .page {
margin-bottom: 100%;
border: 0;
}
@ -184,7 +184,7 @@ select {
display: none !important;
}
#viewerContainer:-moz-full-screen {
#viewerContainer.pdfPresentationMode:-moz-full-screen {
top: 0px;
border-top: 2px solid transparent;
background-color: #000;
@ -195,7 +195,7 @@ select {
-moz-user-select: none;
}
#viewerContainer:fullscreen {
#viewerContainer.pdfPresentationMode:fullscreen {
top: 0px;
border-top: 2px solid transparent;
background-color: #000;
@ -206,24 +206,24 @@ select {
-moz-user-select: none;
}
:-moz-full-screen a:not(.internalLink) {
.pdfPresentationMode:-moz-full-screen a:not(.internalLink) {
display: none;
}
:fullscreen a:not(.internalLink) {
.pdfPresentationMode:fullscreen a:not(.internalLink) {
display: none;
}
:-moz-full-screen .textLayer > div {
.pdfPresentationMode:-moz-full-screen .textLayer > div {
cursor: none;
}
:fullscreen .textLayer > div {
.pdfPresentationMode:fullscreen .textLayer > div {
cursor: none;
}
#viewerContainer.presentationControls,
#viewerContainer.presentationControls .textLayer > div {
.pdfPresentationMode.pdfPresentationModeControls > *,
.pdfPresentationMode.pdfPresentationModeControls .textLayer > div {
cursor: default;
}

View File

@ -182,7 +182,6 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<button id="download" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>
<!-- <div class="toolbarButtonSpacer"></div> -->
<a href="#" id="viewBookmark" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span>
</a>

File diff suppressed because it is too large Load Diff