Commit Graph

8187 Commits

Author SHA1 Message Date
Yury Delendik
ef85685803 Merge pull request #6543 from Snuffleupagus/issue-6541
Prevent getOperatorList from failing to correctly parse OPS.paintXObject for TilingPatterns that are missing some /Resources entries (issue 6541)
2015-10-21 16:20:03 -04:00
Jonas Jenwald
487ba9065a Fail gracefully, and with a notification, if paintXObject is encountered in canvas.js
We should never actually try to execute `paintXObject` in canvas.js, but in some cases where we fail to parse the PDF file correctly it can happen. Currently this will potentially cause an entire page to fail to render, which seems suboptimal.
With this patch, we will instead continue rendering with a warning that things might not work correctly.
2015-10-21 21:30:59 +02:00
Jonas Jenwald
2e751199fb Prevent getOperatorList from failing to correctly parse OPS.paintXObject for TilingPatterns that are missing some /Resources entries (issue 6541)
Fixes 6541.
2015-10-21 21:30:56 +02:00
Yury Delendik
738daa0f79 Merge pull request #6550 from Rob--W/issue-6549-unknown-serialization
Ignore operators that are known to be unsupported
2015-10-21 10:20:57 -04:00
Rob Wu
50ff2d4c2a Ignore operators that are known to be unsupported
`operatorList.addOp` adds the arguments to the list which is then
passed as-is by postMessage to the main thread. But since we don't
parse these operations, they are raw PDF objects and may therefore
cause a serialization error.

This is a conservative patch, and only affects operators which are
known to be unsupported. We should ignore all unknown operators,
but I haven't really looked into the consequences of doing that.

Fixes #6549
2015-10-21 15:39:25 +02:00
Yury Delendik
f12d692c78 Merge pull request #6540 from Snuffleupagus/getDocument-onPassword-onProgress-unittests
Add unit-tests for the `onPassword/onProgress` callbacks of the API
2015-10-21 09:05:55 -04:00
Jonas Jenwald
e04113a35b Add unit-tests for the onPassword/onProgress callbacks of the API
The standard viewer implicitly depends on the `onPassword` and `onProgress` callbacks, in order to open password protected PDF files, respectively to report file loading progress. We currently have no unit-tests for this functionality, which seems unfortunate; hence this patch.

*Please note:* Rather than adding more unit-tests to `api_spec.js`, I slightly extended/reworked two existing tests. Specifically for the password test, this *does not* really change what we actually test, just how the test is done.
2015-10-21 00:01:52 +02:00
Jonas Jenwald
eff28eef3c Update l10n files 2015-10-19 18:15:22 +02:00
Brendan Dahl
1d3522381f Merge pull request #6532 from Snuffleupagus/pr-6531-unittest
Add unit-tests for PR 6531
2015-10-16 14:19:38 -07:00
Brendan Dahl
e4f0e6f2a0 Merge pull request #6531 from covlllp/new_merge
Fixes bluebeam password protection issue
2015-10-16 13:47:06 -07:00
Jonas Jenwald
5987197bd5 Ensure that all getDocument unit-tests returns the expected data 2015-10-16 18:54:20 +02:00
Jonas Jenwald
34cbee9bd3 Add unit-tests for PR 6531 2015-10-16 18:54:18 +02:00
Colin VanLang
6d8e883fe6 Fixes bluebeam password protection issue 2015-10-15 21:22:27 -04:00
Tim van der Meij
d1d81de6fc Merge pull request #6528 from Snuffleupagus/pr-6485-followup
Ensure that `Dict_getArray` doesn't fail if `xref` in undefined (PR 6485 follow-up)
2015-10-15 23:38:50 +02:00
Jonas Jenwald
49883439a5 Ensure that Dict_getArray doesn't fail if xref in undefined (PR 6485 follow-up)
In PR 6485 I somehow missed to account for the case where `xref` is undefined. Since a dictonary can be initialized without providing a reference to an `xref` instance, `Dict_getArray` can thus fail without this added check.
2015-10-15 11:47:07 +02:00
Brendan Dahl
2096a2a94a Merge pull request #5952 from Snuffleupagus/api-externalLinkTarget
[api-minor] Add an option to PDFJS for specifying the |target| attribute of external links (bug 976541)
2015-10-13 15:19:48 -07:00
Jonas Jenwald
610df45bad Prevent external links from "replacing" the viewer when it's embedded (bug 976541)
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=976541.

This patch also adds a `externalLinkTarget` preference, to make the behaviour user configurable.
2015-10-13 22:18:08 +02:00
Jonas Jenwald
39b962e3b0 Add unit-tests for isExternalLinkTargetSet 2015-10-13 21:56:46 +02:00
Jonas Jenwald
9ab896e307 [api-minor] Add an option to PDFJS for specifying the |target| attribute of external links
Replaces `PDFJS.openExternalLinksInNewWindow` with a more generic configuration option.
*Note:* `PDFJS.openExternalLinksInNewWindow = true;` is equal to `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK;`.
2015-10-13 21:52:00 +02:00
Tim van der Meij
d89fde05b0 Merge pull request #6481 from Snuffleupagus/issue-4914-test
Add a (linked) test-case for issue 4914
2015-10-13 20:02:48 +02:00
Tim van der Meij
b48512f64c Merge pull request #6524 from Snuffleupagus/presentation-mode-scrolling-regression-fix
Fix a regression, from PR 5356, that breaks all scrolling in PresentationMode
2015-10-13 16:39:55 +02:00
Jonas Jenwald
9fc8e1ea25 Fix a regression, from PR 5356, that breaks all scrolling in PresentationMode
*This regressed in PR 5356.*

Rather than just backing out the offending code, this patch restores scrolling in PresentationMode by making the `overflow: hidden;` check optional and letting the callers that need it (e.g. `PDFFindController`) opt-in to use it.
2015-10-13 16:27:50 +02:00
Tim van der Meij
c4403e6fd2 Merge pull request #6434 from Snuffleupagus/issue-4436-reduced-test
Replace the unavailable linked test-case for issue 4436 with a reduced test-case
2015-10-13 00:32:05 +02:00
Jonas Jenwald
6019b099fe Merge pull request #6520 from Rob--W/crx-chromecom-fix
[CRX] Call callback instead of onCompleted
2015-10-12 22:18:27 +02:00
Rob Wu
7e345b223c [CRX] Call callback instead of onCompleted 2015-10-11 17:35:16 +02:00
Brendan Dahl
3eaeacfe19 Merge pull request #6476 from Snuffleupagus/PartialEvaluator_readToUnicode-cmap-length
Right-size the `map` array in PartialEvaluator_readToUnicode
2015-10-09 10:31:28 -07:00
Tim van der Meij
9332da3101 Merge pull request #6502 from Snuffleupagus/bug-1020858-test
Add a reduced load test-case for bug 1020858
2015-10-06 15:38:04 +02:00
Brendan Dahl
42ddb7151b Merge pull request #5356 from Rob--W/scroll-issue-5355
scrollIntoView: Skip overflow:hidden elements
2015-10-05 11:15:34 -07:00
Jonas Jenwald
7b44d644ab Merge pull request #6503 from Snuffleupagus/bug-1202902-followup
Follow-up to PR 6489 - Upstream changes from Bug 1202902
2015-10-05 12:51:51 +02:00
Jonas Jenwald
49389c2d30 Follow-up to PR 6489 - Upstream changes from Bug 1202902
I somehow managed miss including one of the upstream changes in PR 6489; hence this patch. Sorry about the unnecessary churn in this code!
2015-10-05 12:31:53 +02:00
Jonas Jenwald
03f2c704a3 Add a reduced load test-case for bug 1020858
Re: PR 4907 and https://bugzilla.mozilla.org/show_bug.cgi?id=1020858.

*Note:* Since this is a `load` test, `makeref` won't be necessary.
2015-10-04 23:49:49 +02:00
Tim van der Meij
cd8bd73529 Merge pull request #6499 from Snuffleupagus/issue-4387-test
Add a (linked) load test for issue 4387
2015-10-04 16:50:18 +02:00
Tim van der Meij
1e29ddc4de Merge pull request #6500 from Snuffleupagus/pr-4897-test
Add a (linked) test-case for PR 4897
2015-10-04 16:26:57 +02:00
Tim van der Meij
5e4910f7b6 Merge pull request #6491 from Snuffleupagus/check-trailer-if-xref-missing
Make `XRef_indexObjects` even more robust against bad PDF files, by checking for the existence of 'trailer' if 'xref' is not found
2015-10-04 16:00:00 +02:00
Tim van der Meij
39d75935bd Merge pull request #6494 from Snuffleupagus/bug-1020226-test
Add a unit-test for bug 1020226
2015-10-04 15:49:36 +02:00
Jonas Jenwald
e8ad6c9d13 Add a unit-test for bug 1020226
For reference, see PR 4902 and https://bugzilla.mozilla.org/show_bug.cgi?id=1020226.
2015-10-04 15:45:24 +02:00
Tim van der Meij
41a75b1423 Merge pull request #6501 from Snuffleupagus/getPage-unit-tests
Slightly improved `getPage` unit-tests
2015-10-04 15:39:28 +02:00
Tim van der Meij
dd9d0b8770 Merge pull request #5480 from CodingFabian/issue-5458
Remove TryCatch in canvas for EvenOdd winding rule.
2015-10-04 15:31:34 +02:00
Jonas Jenwald
ae255f8921 Slightly improved getPage unit-tests 2015-10-04 14:28:24 +02:00
Jonas Jenwald
bdfda37c04 Add a (linked) test-case for PR 4897
Re: PR 4897.
2015-10-04 13:54:05 +02:00
Jonas Jenwald
96b3dc127d Add a (linked) load test for issue 4387
Re: PR 4404 and issue 4387.
2015-10-04 13:15:10 +02:00
Jonas Jenwald
9b12c64be5 Cache the regular expression used for finding objs in XRef_indexObjects, to avoid unnecessary allocations 2015-10-02 12:46:58 +02:00
Yury Delendik
82f73dfed5 Merge pull request #6473 from Snuffleupagus/bug-1165272
Upstream the changes from Bug 1165272 - unify Get*CodebasePrincipal with createCodebasePrincipal in nsIScriptSecurityManager
2015-10-01 11:47:12 -05:00
Yury Delendik
09c1fc51f1 Merge pull request #6489 from Snuffleupagus/bug-1202902
Upstream changes from Bug 1202902 - Give loader scripts and XUL frame scripts a lexical scope that doesn't break everything?
2015-10-01 11:44:28 -05:00
Jonas Jenwald
192907e0d2 Make XRef_indexObjects even more robust against bad PDF files, by checking for the existence of 'trailer' if 'xref' is not found
Fixes http://www.cyjack.com/cognition/Terence%20McKenna%20-%20Lectures%20on%20Alchemy.pdf.
2015-10-01 15:01:25 +02:00
Jonas Jenwald
26ec36ba4c Upstream changes from Bug 1202902 - Give loader scripts and XUL frame scripts a lexical scope that doesn't break everything?
One of the patches in https://bugzilla.mozilla.org/show_bug.cgi?id=1202902, specifically [`Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff)`](https://hg.mozilla.org/mozilla-central/rev/380817d573cd), touches PDF.js code. Unfortunately it was landed upstream without, as far as I can tell, notifying us about it.

This patch uplifts the relevant changes to avoid future merge conflicts, and for consistency also tweaks `PdfJs-stub.jsm`.
2015-10-01 10:03:10 +02:00
Tim van der Meij
1bdfc47de8 Merge pull request #6411 from Snuffleupagus/remove-Parser_fetchIfRef
Remove `Parser_fetchIfRef` since it's obsolete
2015-09-30 00:38:35 +02:00
Tim van der Meij
a6761a52cc Merge pull request #6485 from Snuffleupagus/Dict-getArray-getAsyncArray
Prevent `PartialEvaluator_buildFormXObject` from failing if the `Matrix` or `BBox` contains indirect objects
2015-09-30 00:02:41 +02:00
Tim van der Meij
e28ad20d15 Merge pull request #6475 from Snuffleupagus/PDFPageView-annotationLayer-div
Tweak `PDFPageView` to reflect that `this.annotationLayer` is an `AnnotationsLayerBuilder` instance, instead of a DOM element (PR 5552 follow-up)
2015-09-29 23:38:04 +02:00
Brendan Dahl
7cdc6f3c12 Merge pull request #6468 from Snuffleupagus/issue-6467
Don't clear the `canvas` until re-rendering is finished when the `scale` or `rotation` is changed (issue 6467)
2015-09-29 11:09:44 -07:00