Commit Graph

9622 Commits

Author SHA1 Message Date
Tim van der Meij
27c3c33eec Merge pull request #8288 from yurydelendik/mv-make-web
Moves 'web' target to the gulpfile.
2017-04-15 00:03:29 +02:00
Yury Delendik
f8b3b75e42 Merge pull request #8289 from timvandermeij/firefox-extension-cleanup
Firefox extension: remove unused preference cleanup from `bootstrap.js`
2017-04-14 17:00:59 -05:00
Yury Delendik
89df5ef033 Moves 'web' target to the gulpfile. 2017-04-14 16:57:53 -05:00
Tim van der Meij
e7a3ea29aa
Firefox extension: remove unused preference cleanup from bootstrap.js
The comment for the removal has been added three years ago, so we can
safely remove this now.
2017-04-14 23:49:01 +02:00
Jonas Jenwald
fd51a7cb8c Merge pull request #8287 from yurydelendik/babel-es2015-preset
Allow to convert (some of) ES6 code to ES5.
2017-04-14 21:47:45 +02:00
Yury Delendik
5855c0a8be Allow to convert (some of) ES6 code to ES5. 2017-04-14 14:39:25 -05:00
Jonas Jenwald
bc1f4dd9c8 Merge pull request #8285 from yurydelendik/webcjspath
Change amd to cjs path in ES6 modules
2017-04-14 18:35:39 +02:00
Yury Delendik
f6d4de9898 Merge pull request #8283 from yurydelendik/uint32arrayview
Moves Uint32ArrayView and hasCanvasTypedArrays into compatibility.js.
2017-04-14 10:39:21 -05:00
Yury Delendik
5feb2a253f Merge pull request #8286 from mozilla/package-version
Changing package.json version to 1.0.0
2017-04-14 10:37:26 -05:00
Yury Delendik
3b36a1709a Changing package.json version to 1.0.0
We are changing how we are structuring the src file -- it makes sense to create a "major" release.
2017-04-14 10:36:42 -05:00
Yury Delendik
8e681ce3e2 Change amd to cjs path in ES6 modules 2017-04-14 10:32:36 -05:00
Yury Delendik
30bee9fe0c Moves Uint32ArrayView and hasCanvasTypedArrays into compatibility.js. 2017-04-14 10:04:52 -05:00
Yury Delendik
74b31ab18f Merge pull request #8203 from Snuffleupagus/es6-modules-web
Convert the files in the `/web` folder to ES6 modules
2017-04-13 11:16:27 -05:00
Yury Delendik
c4c44c1bbe Merge pull request #8240 from Snuffleupagus/api-stopAtErrors
[api-minor] Always allow e.g. rendering to continue even if there are errors, and add a `stopAtErrors` parameter to `getDocument` to opt-out of this behaviour (issue 6342, issue 3795, bug 1130815)
2017-04-13 10:58:49 -05:00
Yury Delendik
46646a9dd1 Merge pull request #8131 from timvandermeij/remove-umd-validation
ES6 modules: remove UMD header validation
2017-04-13 10:49:41 -05:00
Yury Delendik
b529df4547 Merge pull request #8281 from yurydelendik/v1.8.188
v1.8.188
2017-04-13 10:48:20 -05:00
Yury Delendik
b939827b4b v1.8.188 2017-04-13 10:46:19 -05:00
Yury Delendik
ad1023ff55 Merge pull request #8262 from tcorral/master
Fix worker resolution on using minified version
2017-04-13 10:41:36 -05:00
Tim van der Meij
32e01cda96 Merge pull request #8228 from timvandermeij/line-annotations
Implement support for line annotations
2017-04-13 00:18:31 +02:00
Tim van der Meij
e15a2ec523
Annotations: implement support for line annotations
This patch implements support for line annotations. Other viewers only
show the popup annotation when hovering over the line, which may have
any orientation. To make this possible, we render an invisible line (SVG
element) over the line on the canvas that acts as the trigger for the
popup annotation. This invisible line has the same starting coordinates,
ending coordinates and width of the line on the canvas.
2017-04-12 23:05:25 +02:00
Jonas Jenwald
2274465588 Merge pull request #8275 from Snuffleupagus/telemetry-stub
Rename PdfJsTelemetry-addon.jsm to PdfJsTelemetry-stub.jsm
2017-04-12 13:32:33 +02:00
Georg Fritzsche
4e8cd2b7d3 Rename PdfJsTelemetry-addon.jsm to PdfJsTelemetry-stub.jsm
And remove unused linting comments.
2017-04-12 13:11:04 +02:00
Yury Delendik
7052316f58 Merge pull request #8273 from Snuffleupagus/issue-8272
Correctly detect if `requestAnimationFrame` is supported in `compatibility.js` (issue 8272)
2017-04-11 10:14:39 -05:00
Jonas Jenwald
3a302fdb53 Correctly detect if requestAnimationFrame is supported in compatibility.js (issue 8272)
This is a regression from PR 8222.

Fixes 8272.
2017-04-11 17:01:35 +02:00
Jonas Jenwald
fbe7b2eee7 Always ignore Type3 glyphs if their OperatorLists contain errors, regardless of the value of the stopAtErrors option
Compared to the parsing of e.g. an entire page, it doesn't really make sense to only be able to render a Type3 glyph partially.
2017-04-11 08:59:22 +02:00
Jonas Jenwald
a39d636eb8 [api-minor] Always allow e.g. rendering to continue even if there are errors, and add a stopAtErrors parameter to getDocument to opt-out of this behaviour (issue 6342, issue 3795, bug 1130815)
Other PDF readers, e.g. Adobe Reader and PDFium (in Chrome), will attempt to render as much of a page as possible even if there are errors present.
Currently we just bail as soon the first error is hit, which means that we'll usually not render anything in these cases and just display a blank page instead.

NOTE: This patch changes the default behaviour of the PDF.js API to always attempt to recover as much data as possible, even when encountering errors during e.g. `getOperatorList`/`getTextContent`, which thus improve our handling of corrupt PDF files and allow the default viewer to handle errors slightly more gracefully.
In the event that an API consumer wishes to use the old behaviour, where we stop parsing as soon as an error is encountered, the `stopAtErrors` parameter can be set at `getDocument`.

Fixes, inasmuch it's possible since the PDF files are corrupt, e.g. issue 6342, issue 3795, and [bug 1130815](https://bugzilla.mozilla.org/show_bug.cgi?id=1130815) (and probably others too).
2017-04-11 08:59:22 +02:00
Jonas Jenwald
10e5f766a2 Merge pull request #8266 from brendandahl/issue6652
Normalize blend mode names.
2017-04-11 08:54:42 +02:00
Brendan Dahl
4969b2ad97 Normalize blend mode names. 2017-04-10 16:18:08 -07:00
TCASAS
010d38a8c0 Fix worker resolution on using minified version
- When the minified version is used the resolver of the worker can not find it properly and throws 404 error.
- The problem was that:
  - It was getting the current name of the file.
  - It was replacing **.js** by **.worker.js**
- When it was loading the unminified version it was working fine because:
  - *pdf.js - .js + .worker.js*  = **pdf.worker.js**
- When it was loading the minified version it didtn't work because:
  - *pdf.min.js - .js + .worker.js* = **pdf.min.worker.js**
  - **pdf.min.worker.js** doesn't exist the real file name is **pdf.worker.min.js**
2017-04-10 13:41:50 +02:00
Tim van der Meij
30d63b0c50
Annotations: move container border removal to the display layer
The display layer is responsible for creating the HTML elements for the
annotations from the core layer. If we need to ignore border styling for
the containers of certain elements, the display layer should do so and
not the core layer. I noticed this during the implementation of line
annotations, for which we actually need the original border width in the
display layer, even though we ignore it for the container. If we set the
border style to zero in the core layer, this becomes impossible.

To prevent this, this patch moves the container border removal code from
the core layer to the display layer. This makes the core layer output
the unchanged annotation data and lets the display layer remove any
border styling if necessary.
2017-04-09 19:01:38 +02:00
Jonas Jenwald
b2c3f8f081 Convert a number of import * as pdfjsLib from 'pdfjs-web/pdfjs'; cases to only specify the necessary imports
Rather than always importing everything from the `web/pdfjs.js`, similar to all other imports we can just choose what we actually need.
2017-04-09 11:55:48 +02:00
Jonas Jenwald
3b35c15d42 Convert the files in the /web folder to ES6 modules
Note that as discussed on IRC, this makes the viewer slightly slower to load *only* in `gulp server` mode, however the difference seem slight enough that I think it will be fine.
2017-04-09 11:55:48 +02:00
Jonas Jenwald
313060aff5 Refactor the DownloadManager initialization in GENERIC/CHROME builds, to avoid issues when converting the code to ES6 modules 2017-04-09 11:55:48 +02:00
Tim van der Meij
d6dfc26d4e Merge pull request #8257 from Snuffleupagus/eslint_prefer-promise-reject-errors
Enable the `prefer-promise-reject-errors` ESLint rule
2017-04-08 22:27:04 +02:00
Jonas Jenwald
f41d80bdd3 Enable the prefer-promise-reject-errors ESLint rule
See http://eslint.org/docs/rules/prefer-promise-reject-errors, note that this is similar to the already used  `no-throw-literal` rule.
2017-04-08 11:47:22 +02:00
Brendan Dahl
55a853b667 Merge pull request #8244 from Snuffleupagus/issue-8241
Actually skip pages included in the `skipPages` array when running tests, rather than creating empty 1x1 canvases (issue 8241)
2017-04-07 10:53:54 -07:00
Jonas Jenwald
c5199d0814 Update l10n files 2017-04-07 12:31:54 +02:00
Yury Delendik
8ff1fbe7f8 Merge pull request #8249 from yurydelendik/v1.8.170
Release 1.8.170
2017-04-06 13:44:11 -05:00
Yury Delendik
a0dee94d60 Release 1.8.170 2017-04-06 13:39:45 -05:00
Yury Delendik
3ca67550ef Merge pull request #8248 from yurydelendik/version-1.8
Version 1.8
2017-04-06 13:38:03 -05:00
Yury Delendik
a7f735dbfa Version 1.8 2017-04-06 13:36:33 -05:00
Jonas Jenwald
9d62ff80ca Actually skip pages included in the skipPages array when running tests, rather than creating empty 1x1 canvases (issue 8241)
Considering how extremely simple this patch turned out to be, I'm almost worried that I completely misunderstood why the current code looks like it does...
2017-04-06 13:17:52 +02:00
Jonas Jenwald
a662d26814 Merge pull request #8243 from brendandahl/no-skip-glyph0
Don’t skip glyph 0 in cmap.
2017-04-06 10:25:55 +02:00
Brendan Dahl
cdc79a4721 Don’t skip glyph 0 in cmap. 2017-04-05 15:17:38 -07:00
Yury Delendik
c380d25407 Merge pull request #8239 from georgf/master
Stub out Firefox addon Telemetry wrapper
2017-04-05 13:29:54 -05:00
Georg Fritzsche
788fe1f810 Stub out Firefox addon Telemetry wrapper
We are planning to remove the addon histogram APIs from Firefox
Telemetry.
The easy solution here is to just stub out all calls that use them.
2017-04-05 14:17:31 +07:00
Yury Delendik
f9c07fa695 Merge pull request #8235 from Snuffleupagus/issue-7901
Disable the `NativeImageDecoder` in the `node/pdf2svg.js` example (issue 7901)
2017-04-04 10:38:22 -05:00
Yury Delendik
b665b0319a Merge pull request #8222 from tjgrathwell/ios-fake-cancel-animation-frame
ios: Patch cancelAnimationFrame whenever fakeRequestAnimationFrame is used
2017-04-04 10:29:04 -05:00
Jonas Jenwald
d76cfc0610 Disable the NativeImageDecoder in the node/pdf2svg.js example (issue 7901)
It doesn't really make sense to attempt to utilize the `NativeImageDecoder` in Node, since there's no native image support available, hence building on PR 8035 we can easily disable it in the example.

Fixes 7901.
2017-04-04 17:24:29 +02:00
Yury Delendik
31f8875614 Merge pull request #8157 from Snuffleupagus/api-RenderTask-cancel-Error
[api-minor] Reject the `RenderTask` with an actual `Error`, instead of just a `string`, when rendering is cancelled
2017-04-04 09:38:47 -05:00