Commit Graph

8894 Commits

Author SHA1 Message Date
Tim van der Meij
5f925a561e Merge pull request #7174 from Snuffleupagus/issue-6905-crypto_spec
Use `beforeAll`/`afterAll` in `CipherTransformFactory` in crypto_spec.js (issue 6905)
2016-04-10 14:13:24 +02:00
Jonas Jenwald
b0ce83b372 Use beforeAll/afterAll in CipherTransformFactory in crypto_spec.js (issue 6905
This patch also adds/improves utility functions for checking if the passwords are correct/incorrect, and replaces `string2binary` with `stringToBytes`. Finally the patch does away with the `DictMock`, in favour of using actual `Dict`s.

Re: issue 6905.
2016-04-10 13:20:21 +02:00
Jonas Jenwald
f59c3a0644 Remove the remaining usages of new {Name,Cmd} in favor of {Name,Cmd}.get
Using `new {Name,Cmd}` should be avoided, since it creates a new object on *every* call, whereas `{Name,Cmd}.get` uses caches to only create *one* object regardless of how many times they are called.

Most of these are found in the unit-tests, where increased memory usage probably doesn't matter very much. But it still seems good to get rid of those cases, since no part of the codebase ought to advertise that usage.

Given the small size of the patch, I'm also tweaking a few comments and class names.
2016-04-08 12:14:05 +02:00
Yury Delendik
1c253e6e1d Merge pull request #7170 from Snuffleupagus/pr-7097-followup
Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
2016-04-07 14:55:00 -05:00
Jonas Jenwald
514210814d Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
This is a regression from PR 7097.

(Also, out of scope for this PR, but I think that a `setTimeout` value of `1000 ms` is too large. Switching from scrolling to zooming can fell sluggish, and give the impression that nothing happens.)
2016-04-07 21:04:52 +02:00
Brendan Dahl
f351eb23aa Merge pull request #7097 from prometheansacrifice/zoom-due-to-scroll-inertia
Prevents document zooming if still scrolling and meta keys pressed (Issue #7022)
2016-04-07 11:52:10 -07:00
Brendan Dahl
68e8f5fff5 Merge pull request #7126 from yurydelendik/rm-pdfjs-display
Move all PDFJS display/ usages into global.js file.
2016-04-07 11:47:58 -07:00
Yury Delendik
1e4886a15a Remove global window and navigator usages from the core code. 2016-04-07 13:46:07 -05:00
Yury Delendik
1e3e14e6b2 Exposes all functional members via lib exports and use them in viewer. 2016-04-07 13:46:07 -05:00
Yury Delendik
1d12aed5ca Move all PDFJS.xxx settings into display/global. 2016-04-07 13:46:07 -05:00
Tim van der Meij
bc8df673a6 Merge pull request #7164 from Snuffleupagus/issue-6905-dom_utils_spec
Use `beforeAll`/`afterAll` in `isExternalLinkTargetSet` in dom_utils_spec.js (issue 6905)
2016-04-07 20:39:01 +02:00
Yury Delendik
6123c0367f Merge pull request #7169 from yurydelendik/jspm-format
Specifies package format for jspm.
2016-04-07 11:58:07 -05:00
Yury Delendik
38c41d86c6 Specifies package format for jspm. 2016-04-07 11:52:56 -05:00
Manas
6878d7c6d3 Disables zooming when the stream of events that don't have meta/ctrl
keys active at the outset, for 1000ms
2016-04-07 22:18:46 +05:30
Jonas Jenwald
c6c5b8fab8 Use beforeAll/afterAll in isExternalLinkTargetSet in dom_utils_spec.js (issue 6905)
Re: issue 6905.
2016-04-07 14:00:40 +02:00
Tim van der Meij
911a2ca1c6 Merge pull request #7158 from timvandermeij/readme
Update Webpack and Browserify example README files
2016-04-06 18:44:31 +02:00
Tim van der Meij
b293d1caf5 Update Webpack and Browserify example README files
Previously the commands were not properly parsed as such by GitHub
because they need to be indented with four spaces.

Furthermore, address some minor textual nits.
2016-04-06 18:36:41 +02:00
Yury Delendik
6c9f418aae Merge pull request #7150 from yurydelendik/browserify
Initial browserify example.
2016-04-06 09:45:55 -05:00
Yury Delendik
47688b655a Merge pull request #7144 from yurydelendik/mv-viewer-2
Prepare viewer.js for async loading and module separation.
2016-04-06 09:40:59 -05:00
Yury Delendik
f9a0dc1188 Merge pull request #7114 from dhuseby/Bug_1237908
[Bug 1237908] Make pdf.js use the correct principal origin attributes when loading …
2016-04-06 09:38:11 -05:00
Dave Huseby
867a5ea1b0 Make pdf.js use the correct principal origin attributes when loading subresources. 2016-04-04 14:12:51 -07:00
Yury Delendik
d7d7935648 Initial browserify example. 2016-04-04 11:32:01 -05:00
Yury Delendik
2dd03e1785 Merge pull request #7148 from yurydelendik/force-cjs-path
Forces UMD header to have relative path and extension for CommonJS.
2016-04-02 11:59:29 -05:00
Yury Delendik
118b71925c Forces UMD header to have relative path and extension for CommonJS. 2016-04-02 11:10:36 -05:00
Yury Delendik
34aa915441 Merge pull request #7146 from Snuffleupagus/extract-CFFParser
Extract CFFParser and Type1Parser from fonts.js
2016-04-02 10:50:38 -05:00
Yury Delendik
055d642bf2 Merge pull request #7107 from Rob--W/worker-loading
Detect premature worker load error
2016-04-02 10:40:26 -05:00
Rob Wu
c8996f654f Detect and handle premature worker load error
Fall back to a fake worker if the worker fails to load or initialize,
e.g. due to a network error, a security error or simply a script error.
2016-04-02 11:06:15 +02:00
Jonas Jenwald
ef551e8266 Extract Type1Parser from fonts.js 2016-04-01 23:38:53 +02:00
Jonas Jenwald
b961e1d21b Extract CFFParser from fonts.js (issue 6777) 2016-04-01 22:32:39 +02:00
Yury Delendik
313b418a20 Prepare viewer.js for async loading and module separation. 2016-04-01 10:29:44 -05:00
Yury Delendik
b371785fbb Rename web/viewer.js -> web/app.js 2016-04-01 10:27:16 -05:00
Yury Delendik
a250c150ab Merge pull request #7134 from yurydelendik/circ-stream-colorspace
Refactors to remove stream.js dependency on colorspace.js
2016-04-01 08:23:24 -05:00
Yury Delendik
ff3ce973b8 Merge pull request #7106 from Snuffleupagus/issue-7101
Keep track of the character to glyph mapping in font_renderer.js, to prevent errors when different characters point to the same glyph (issue 7101)
2016-04-01 08:09:21 -05:00
Yury Delendik
35cbf74b12 Refactors to remove stream.js dependency on colorspace.js 2016-04-01 07:36:16 -05:00
Brendan Dahl
13d440df61 Merge pull request #7078 from Snuffleupagus/refactor-toFontChar-without-file
Refactor the building of `toFontChar` for non-embedded fonts
2016-03-31 10:43:11 -07:00
Brendan Dahl
8910cea7d6 Merge pull request #7066 from Snuffleupagus/Type1-headerBlockLength
Parse Type1 font files to determine the various `Length{n}` properties, instead of trusting the PDF file (issue 5686, issue 3928)
2016-03-31 09:25:16 -07:00
Jonas Jenwald
05cf709f8e Parse Type1 font files to determine the various Length{n} properties, instead of trusting the PDF file (issue 5686, issue 3928)
Fixes 5686.
Fixes 3928.
2016-03-31 11:08:12 +02:00
Jonas Jenwald
c40df8a393 Make Type1Font more class-like, by adding closure
*Note:* Ignoring whitespace should simplify reviewing a great deal.
2016-03-31 11:00:27 +02:00
Yury Delendik
447c48ea27 Merge pull request #7133 from Snuffleupagus/faster-unittests-beforeAll-afterAll
Faster unit-tests by using `beforeAll`/`afterAll` in api_spec.js
2016-03-30 09:28:16 -05:00
Jonas Jenwald
7163e1eff3 Faster unit-tests by using beforeAll/afterAll in api_spec.js
In the API unit-tests, we're currently loading the `basicapi.pdf` before every sub-test in `PDFDocument` and `Page`, which slows down the unit-tests quite a bit.
Locally this patch reduces the run time for `gulp unittest` by at least 40% for me.
2016-03-30 15:32:01 +02:00
Jonas Jenwald
17aaa125df Keep track of the character to glyph mapping in font_renderer.js, to prevent errors when different characters point to the same glyph (issue 7101)
Fixes 7101.
2016-03-30 11:33:04 +02:00
Yury Delendik
bec4891f5d Merge pull request #7102 from brendandahl/onerror
Log uncaught global errors.
2016-03-29 17:23:28 -05:00
Tim van der Meij
6d2b195857 Merge pull request #7128 from Snuffleupagus/issue-6204-unittest
Add unit-tests for destionations in /Names (NameTree) dictionaries where all entries are indirect objects
2016-03-29 22:44:22 +02:00
Nico Schlömer
7cb055307d Add element to text layer even if width === 0
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.
2016-03-29 19:32:51 +02:00
Brendan Dahl
4e2f70440f Merge pull request #6711 from yurydelendik/errors
Better errors capturing at the core and stop rendering on error.
2016-03-29 09:19:28 -07:00
Jonas Jenwald
ac772017b6 Add unit-tests for destionations in /Names (NameTree) dictionaries where all entries are indirect objects
Re: issue 6204 and PR 6208.
2016-03-29 17:55:05 +02:00
Yury Delendik
df0cbccfd8 Merge pull request #7129 from yurydelendik/jasmine
Updates Jasmine version.
2016-03-29 10:32:17 -05:00
Yury Delendik
0a700fa29d Updates Jasmine version. 2016-03-29 09:34:13 -05:00
Tim van der Meij
553928c26e Merge pull request #7118 from Snuffleupagus/issue-7115
Prevent failures in the Annotation code if the `Rect` array contains indirect objects (issue 7115)
2016-03-29 00:04:59 +02:00
Yury Delendik
27dd386248 Merge pull request #7122 from Snuffleupagus/issue-7117
Allow unit-tests to use linked PDF files, by having the `unittest` command download unavailable ones (issue 7117)
2016-03-28 10:19:17 -05:00