Bug 1268706 - Update pdf.js to version 1.5.222. r=bdahl

--HG--
extra : rebase_source : 68bbc833875e04f35c359065dda040037de46d7a
This commit is contained in:
Ryan VanderMeulen 2016-04-29 11:36:14 -04:00
Родитель a1bb284697
Коммит 0d3fc06844
7 изменённых файлов: 3047 добавлений и 2562 удалений

Просмотреть файл

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

Просмотреть файл

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it
'use strict';
var pdfjsVersion = '1.4.258';
var pdfjsBuild = '990150c';
var pdfjsVersion = '1.5.222';
var pdfjsBuild = 'd20002b';
var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ?
@ -2935,23 +2935,21 @@ var renderTextLayer = (function renderTextLayerClosure() {
}
var width = ctx.measureText(textDiv.textContent).width;
if (width > 0) {
textLayerFrag.appendChild(textDiv);
var transform;
if (textDiv.dataset.canvasWidth !== undefined) {
// Dataset values come of type string.
var textScale = textDiv.dataset.canvasWidth / width;
transform = 'scaleX(' + textScale + ')';
} else {
transform = '';
}
var rotation = textDiv.dataset.angle;
if (rotation) {
transform = 'rotate(' + rotation + 'deg) ' + transform;
}
if (transform) {
CustomStyle.setProp('transform' , textDiv, transform);
}
textLayerFrag.appendChild(textDiv);
var transform;
if (textDiv.dataset.canvasWidth !== undefined && width > 0) {
// Dataset values come of type string.
var textScale = textDiv.dataset.canvasWidth / width;
transform = 'scaleX(' + textScale + ')';
} else {
transform = '';
}
var rotation = textDiv.dataset.angle;
if (rotation) {
transform = 'rotate(' + rotation + 'deg) ' + transform;
}
if (transform) {
CustomStyle.setProp('transform' , textDiv, transform);
}
}
capability.resolve();
@ -7621,28 +7619,26 @@ var WorkerTransport = (function WorkerTransportClosure() {
case 'Font':
var exportedData = data[2];
var font;
if ('error' in exportedData) {
var error = exportedData.error;
warn('Error during font loading: ' + error);
this.commonObjs.resolve(id, error);
var exportedError = exportedData.error;
warn('Error during font loading: ' + exportedError);
this.commonObjs.resolve(id, exportedError);
break;
} else {
var fontRegistry = null;
if (getDefaultSetting('pdfBug') && globalScope.FontInspector &&
globalScope['FontInspector'].enabled) {
fontRegistry = {
registerFont: function (font, url) {
globalScope['FontInspector'].fontAdded(font, url);
}
};
}
font = new FontFaceObject(exportedData, {
isEvalSuported: getDefaultSetting('isEvalSupported'),
disableFontFace: getDefaultSetting('disableFontFace'),
fontRegistry: fontRegistry
});
}
var fontRegistry = null;
if (getDefaultSetting('pdfBug') && globalScope.FontInspector &&
globalScope['FontInspector'].enabled) {
fontRegistry = {
registerFont: function (font, url) {
globalScope['FontInspector'].fontAdded(font, url);
}
};
}
var font = new FontFaceObject(exportedData, {
isEvalSuported: getDefaultSetting('isEvalSupported'),
disableFontFace: getDefaultSetting('disableFontFace'),
fontRegistry: fontRegistry
});
this.fontLoader.bind(
[font],
@ -8450,8 +8446,6 @@ exports._UnsupportedManager = _UnsupportedManager;
exports.isWorker = isWorker;
exports.PDFJS = globalScope.PDFJS;
}));
}).call(pdfjsLibs);
exports.PDFJS = pdfjsLibs.pdfjsDisplayGlobal.PDFJS;
@ -8483,4 +8477,3 @@ exports._UnsupportedManager = _UnsupportedManager;
exports.addLinkAttributes = pdfjsLibs.pdfjsDisplayDOMUtils.addLinkAttributes;
}));

Просмотреть файл

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it
'use strict';
var pdfjsVersion = '1.4.258';
var pdfjsBuild = '990150c';
var pdfjsVersion = '1.5.222';
var pdfjsBuild = 'd20002b';
var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ?
@ -451,7 +451,7 @@ exports.ArithmeticDecoder = ArithmeticDecoder;
types[j] = 'EN';
}
// do after
for (j = i + 1; j < strLength; --j) {
for (j = i + 1; j < strLength; ++j) {
if (types[j] !== 'ET') {
break;
}
@ -34156,6 +34156,12 @@ var XRef = (function XRefClosure() {
error('Invalid entry in XRef subsection: ' + first + ', ' + count);
}
// The first xref table entry, i.e. obj 0, should be free. Attempting
// to adjust an incorrect first obj # (fixes issue 3248 and 7229).
if (i === 0 && entry.free && first === 1) {
first = 0;
}
if (!this.entries[i + first]) {
this.entries[i + first] = entry;
}
@ -34169,12 +34175,6 @@ var XRef = (function XRefClosure() {
delete tableState.entryCount;
}
// Per issue 3248: hp scanners generate bad XRef
if (first === 1 && this.entries[1] && this.entries[1].free) {
// shifting the entries
this.entries.shift();
}
// Sanity check: as per spec, first object must be free
if (this.entries[0] && !this.entries[0].free) {
error('Invalid XRef table: unexpected first object');
@ -41542,11 +41542,8 @@ exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
exports.WorkerTask = WorkerTask;
exports.WorkerMessageHandler = WorkerMessageHandler;
}));
}).call(pdfjsLibs);
exports.WorkerMessageHandler = pdfjsLibs.pdfjsCoreWorker.WorkerMessageHandler;
}));

Просмотреть файл

@ -531,7 +531,7 @@ var PDFBug = (function PDFBugClosure() {
});
}
},
init: function init(pdfjsLib) {
init: function init(pdfjsLib, container) {
/*
* Basic Layout:
* PDFBug
@ -552,7 +552,6 @@ var PDFBug = (function PDFBugClosure() {
panels.setAttribute('class', 'panels');
ui.appendChild(panels);
var container = document.getElementById('viewerContainer');
container.appendChild(ui);
container.style.right = panelWidth + 'px';

Просмотреть файл

@ -1,14 +1,14 @@
/* globals FirefoxCom */
'use strict';
// Small subset of the webL10n API by Fabien Cazenave for pdf.js extension.
(function(window) {
var gLanguage = '';
var gExternalLocalizerServices = null;
// fetch an l10n objects
function getL10nData(key) {
var response = FirefoxCom.requestSync('getStrings', key);
var response = gExternalLocalizerServices.getStrings(key);
var data = JSON.parse(response);
if (!data) {
console.warn('[l10n] #' + key + ' missing for [' + gLanguage + ']');
@ -94,8 +94,8 @@
}
}
window.addEventListener('DOMContentLoaded', function() {
gLanguage = FirefoxCom.requestSync('getLocale', null);
function translateDocument() {
gLanguage = gExternalLocalizerServices.getLocale();
translateFragment();
@ -104,6 +104,13 @@
evtObject.initEvent('localized', false, false);
evtObject.language = gLanguage;
window.dispatchEvent(evtObject);
}
window.addEventListener('DOMContentLoaded', function() {
if (gExternalLocalizerServices) {
translateDocument();
}
// ... else see setExternalLocalizerServices below
});
// Public API
@ -128,6 +135,16 @@
return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';
},
setExternalLocalizerServices: function (externalLocalizerServices) {
gExternalLocalizerServices = externalLocalizerServices;
// ... in case if we missed DOMContentLoaded above.
if (window.document.readyState === 'interactive' ||
window.document.readyState === 'complete') {
translateDocument();
}
},
// translate an element or document fragment
translate: translateFragment
};

Просмотреть файл

@ -159,6 +159,15 @@
border: none;
}
.pdfViewer.singlePageView {
display: inline-block;
}
.pdfViewer.singlePageView .page {
margin: 0;
border: none;
}
.pdfViewer .page canvas {
margin: 0;
display: block;

Разница между файлами не показана из-за своего большого размера Загрузить разницу