From 7cb055307d0e3860137019e2b6c302beba6e31a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Tue, 29 Mar 2016 19:32:51 +0200 Subject: [PATCH 001/425] Add element to text layer even if width === 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some browsers render certain special characters with width 0, others with strictly positive width. (For example, the Greek Delta, Δ, has width 0 in Google Chrome, and a positive width in Firefox.) The `if` clause in operation so far results in different text layer DOM trees for different browsers. This commit fixes that by adding the elements independently of their width. --- src/display/text_layer.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/display/text_layer.js b/src/display/text_layer.js index 62b59a3d..702e1d20 100644 --- a/src/display/text_layer.js +++ b/src/display/text_layer.js @@ -156,23 +156,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(); From e20a2171777ac46fef4e27f592b084c885626f15 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Thu, 21 Apr 2016 15:11:26 -0500 Subject: [PATCH 002/425] Release of 1.5.188 --- pdfjs.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdfjs.config b/pdfjs.config index 67e53600..5300c3b6 100644 --- a/pdfjs.config +++ b/pdfjs.config @@ -1,6 +1,6 @@ { - "betaVersion": "1.4.20", - "stableVersion": "1.3.91", + "betaVersion": "1.5.188", + "stableVersion": "1.4.20", "baseVersion": "9eedfc128c526d3155955ef825a952d627780922", "versionPrefix": "1.5." } \ No newline at end of file From 9ceeb2174196afc9def3b7e75b0d2ab6bd9b46dd Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 22 Apr 2016 10:02:17 +0200 Subject: [PATCH 003/425] Prevent accidentally overriding the `error` function in the `commonobj` messageHandler in api.js (issue 7232) This naming issue has been present since PR 3529, but at least I cannot find any issues/bugs that seem to have been caused by it, which is good. The patch also removes an unnecessary `else` branch, since an already existing `break` means that it's redundant. Fixes 7232. --- src/display/api.js | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index d17da531..827256de 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1486,28 +1486,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], From 76aa6875482df521368d3b97f8b098f44e73ce03 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Fri, 22 Apr 2016 17:23:25 -0500 Subject: [PATCH 004/425] Makes importl10n and server async gulp functions. --- external/importL10n/locales.js | 5 ++++- gulpfile.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js index 089209c4..de0fa272 100644 --- a/external/importL10n/locales.js +++ b/external/importL10n/locales.js @@ -82,10 +82,13 @@ function downloadLanguageFiles(root, langCode, callback) { }); } -function downloadL10n(root) { +function downloadL10n(root, callback) { var i = 0; (function next() { if (i >= langCodes.length) { + if (callback) { + callback(); + } return; } downloadLanguageFiles(root, langCodes[i++], next); diff --git a/gulpfile.js b/gulpfile.js index bf77da26..3bc39b87 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,7 +51,7 @@ gulp.task('default', function() { }); }); -gulp.task('server', function () { +gulp.task('server', function (done) { console.log(); console.log('### Starting local server'); @@ -80,7 +80,7 @@ gulp.task('makefile', function () { .pipe(gulp.dest('.')); }); -gulp.task('importl10n', function() { +gulp.task('importl10n', function(done) { var locales = require('./external/importL10n/locales.js'); console.log(); @@ -89,7 +89,7 @@ gulp.task('importl10n', function() { if (!fs.existsSync(L10N_DIR)) { fs.mkdirSync(L10N_DIR); } - locales.downloadL10n(L10N_DIR); + locales.downloadL10n(L10N_DIR, done); }); // Getting all shelljs registered tasks and register them with gulp From 9d7d95ead4afe347800ad4fcb836eca5c3540801 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 23 Apr 2016 15:57:51 +0200 Subject: [PATCH 005/425] [Bug 1194700] Ensure that the `customScaleOption` is hidden in e10s When Firefox is run in e10s mode, which will soon be the default, the PDF.js zoom dropdown menu doesn't look right. This is apparently because the ` - - - - - +
+

+
@@ -66,23 +44,33 @@ limitations under the License.
-