Commit Graph

9622 Commits

Author SHA1 Message Date
Tim van der Meij
d471e3568d Merge pull request #8151 from Snuffleupagus/rm-toolbarButton-group-CSS
Remove unnecessary `.toolbarButton.group` CSS class
2017-03-10 22:27:57 +01:00
Jonas Jenwald
8f96909e97 Remove unnecessary .toolbarButton.group CSS class
I noticed that we have a `.toolbarButton.group` CSS class, which is currently applied to some buttons in the viewer. Since it attempts to adjust the `margin-right` property, I was initially a bit puzzled as to why there wasn't different rules for LTR/RTL locales.

However, checking the viewer with the DevTools inspector, in both LTR and RTL locales, I quickly found that the rule in question is *always* being overridden by other CSS rules.
It thus seem to me that while this rule was probably useful at some point, it has been dead for years and could now be removed.
2017-03-10 13:49:24 +01:00
Tim van der Meij
fc5810c97a Merge pull request #8144 from timvandermeij/issue-8143
Widget annotations: do not crash if `Parent` is not a dictionary during field name construction (issue 8143)
2017-03-10 00:40:13 +01:00
Tim van der Meij
936d3c0698
Widget annotations: do not crash if Parent is not a dictionary
during field name construction (issue 8143)
2017-03-09 23:51:52 +01:00
Tim van der Meij
6908f1491d Merge pull request #8132 from timvandermeij/findbar-responsiveness
Viewer: enable find functionality for small devices
2017-03-09 23:03:20 +01:00
Jonas Jenwald
b151666c53
Viewer: consistently wrap find bar elements for small screen sizes
This patch ensures that the find bar is not extended to the window width
when element wrapping occurs on small screens.
2017-03-08 23:55:13 +01:00
Tim van der Meij
87a30a7ee1
Viewer: enable find functionality for small devices
The find functionality is currently not available for small devices
because the find dialog is not responsive. This patch fixes that.

To achieve this goal, the HTML is changed to always show the find
button. To prevent issues because of the addition of an extra button for
small views, the previous/next page buttons are hidden if the view
becomes small. These buttons are not useful anyway because on small
devices navigation is usually done via scrolling. The find functionality
is much more useful to have in this case. Moreover, we wrap the existing
elements into separate `div`s so that the browser can position the
elements itself when the view becomes smaller and logically connected
elements stay together when this happens.

In the CSS, extra rules for the find bar have been added to ensure that
the dialog's doorhanger is always below the find button. All findbar
`div`s are forced to be 32 pixels high to prevent the find message text
being aligned under the checkboxes. Finally, the find message is only
visible when there is actually text to display. This prevents wrapping
issues because, by default, the label has padding and margin even if
there is no text.
2017-03-08 23:54:28 +01:00
Jonas Jenwald
c79e5b3f17
Viewer: replace find label with placeholder/tooltip
This is common in the rest of the UI and helps us prevent responsiveness
issues for different length strings in different locales.
2017-03-08 23:54:14 +01:00
Tim van der Meij
a544a3b4a4 Merge pull request #8138 from Snuffleupagus/bug-1345253
Get rid of `element.removeChild(element.firstChild)` usage (bug 1345253)
2017-03-08 22:29:53 +01:00
Jonas Jenwald
468ed1b9a1 Ensure that the outlineWithDeepNesting CSS class is removed when resetting PDFOutlineViewer, to prevent incorrect alignment if a new document is opened 2017-03-08 17:41:11 +01:00
Jonas Jenwald
e07cb8638e Get rid of element.removeChild(element.firstChild) usage (bug 1345253)
Instead of just upstreaming the changes from [bug 1345253](https://bugzilla.mozilla.org/show_bug.cgi?id=1345253) as-is, it seemed better to simply get rid of the loops altogether and use the same approach as in `PDFViewer`/`PDFThumbnailViewer`.
2017-03-08 17:29:50 +01:00
Jason O. Jensen
d230784ac3 Handle cff fonts with erroneous stackSize 2017-03-06 19:28:46 -05:00
Tim van der Meij
5eb090f288
ES6 modules: remove UMD header validation
This patch is another step towards enabling Babel. Since we're moving
towards ES6 modules, we will not be using UMD headers anymore, so we can
remove the validation.
2017-03-04 21:43:25 +01:00
Tim van der Meij
754c4bd0ab Merge pull request #8130 from Snuffleupagus/gulp-lib-rm-web-compatibility
Don't include `web/compatibility.js` in the output for `gulp lib` (PR 8120 follow-up)
2017-03-04 21:27:28 +01:00
Jonas Jenwald
af44ef15f7 Don't include web/compatibility.js in the output for gulp lib (PR 8120 follow-up)
First of all, `compatibility.js` is already available in `lib/shared/compatibility.js`. Second of all, as can be seen in 9142301f35 (diff-9432ebaa58e10ab02874fcb86f689caa), the `lib/web/compatibility.js` file cannot work since the `require` statement isn't compatible with the output of `gulp lib`.
2017-03-04 18:34:28 +01:00
Tim van der Meij
4e3e97be8e Merge pull request #8129 from Snuffleupagus/getInheritedPageProp-undefined
Return `undefined` instead of `Dict.empty` from `Page.getInheritedPageProp` for non-existent properties to prevent possible future bugs
2017-03-04 16:18:24 +01:00
Yury Delendik
c290561488 Merge pull request #8120 from yurydelendik/lib
Publishes processed sources into pdfjs-dist/lib
2017-03-04 08:48:36 -06:00
Jonas Jenwald
9bed87f5dc Return undefined instead of Dict.empty from Page.getInheritedPageProp for non-existent properties to prevent possible future bugs
*This is something that I noticed while working on PR 8126, which is (more) fallout from PR 6065.*

In general, it's actually *not* correct to return `Dict.empty` as the default value for non-existent properties. Please note that a prior PR, see https://github.com/mozilla/pdf.js/pull/5957#issuecomment-103112698, asked for that behaviour but I don't think that's right.

Obviously for properties that are (or should) be `Dict`s it makes sense, however certain properties can be e.g. Strings or Arrays instead. In the latter case, returning `Dict.empty` is just plain wrong, and it's quite fascinating that this hasn't caused any errors in practice. (The existing validation in the various getters has actually saved us here.)

Also, when looking at this code again, it seemed unnecessary to duplicate the `MAX_LOOP_COUNT` check since we could just return immediately instead.
2017-03-04 13:08:39 +01:00
Tim van der Meij
1eb96d7ca9 Merge pull request #8128 from timvandermeij/csp-headers
Network: use the current location to prevent errors when using CSP headers
2017-03-04 00:01:50 +01:00
Yury Delendik
39e8ad24f7 Creates 'lib' for the 'dist' build target. 2017-03-03 16:37:58 -06:00
Yury Delendik
e7cc07cc11 Moves checkProblematicCharRanges to font_spec.js 2017-03-03 16:33:35 -06:00
Job van der Weiden
a05115d2ec
Network: use the current location to prevent errors when using CSP headers
When using content security headers to restrict connections to the same origin,
you may not make connections to `example.com`. This feature detection also
works with a request to the current location.
2017-03-03 23:18:51 +01:00
Jonas Jenwald
24e5b6ee6c Merge pull request #8126 from Snuffleupagus/issue-8125
Ensure that we don't ignore `0` values in `Page.getInheritedPageProp` (issue 8125)
2017-03-03 22:01:59 +01:00
Jonas Jenwald
4a0ff5dbf7 Ensure that we don't ignore 0 values in Page.getInheritedPageProp (issue 8125)
It appears that I accidentally broke this in PR 6065, sorry about that!

The issue in this particular PDF file is that there's `/Rotate` entries on different levels of the `/Pages` tree. We're supposed to use the `/Rotate` entry in the `/Page` dict (which is `0`), but because of an incorrect condition we instead ended up with the one from the `/Pages` dict (which is `180`).

Fixes 8125.
2017-03-03 12:27:40 +01:00
Jonas Jenwald
9163a6fba4 Merge pull request #8112 from Snuffleupagus/JS-action-newWindow
Support the `newWindow` flag in white-listed `app.launchURL` JavaScript actions (PR 7794 follow-up)
2017-03-01 21:24:34 +01:00
Yury Delendik
d0d9843a0e Merge pull request #8087 from yurydelendik/pdf_viewer_req
Allows to pull pdf.js from pdf_viewer using require().
2017-02-28 20:51:18 -06:00
Tim van der Meij
522281c01d Merge pull request #8116 from Snuffleupagus/download_manager-preprocessor
Get rid of a couple `eslint-disable` statements in `web/download_manager.js` by instead relying on the preprocessor dead-code removal added in PR 7942
2017-02-28 22:03:47 +01:00
Tim van der Meij
b75d53a7fa Merge pull request #8115 from Snuffleupagus/CONTRIBUTING-rm-mailing-list
[CONTRIBUTING.md] Remove any mention of the mailing list, and the weekly meetings
2017-02-28 21:52:00 +01:00
Jonas Jenwald
37d596e00d Get rid of a couple eslint-disable statements in web/download_manager.js by instead relying on the preprocessor dead-code removal added in PR 7942 2017-02-28 12:41:43 +01:00
Jonas Jenwald
b0fbfc85f0 [CONTRIBUTING.md] Remove any mention of the mailing list, and the weekly meetings
Given that the mailing list has now been closed, see [bug 1340296](https://bugzilla.mozilla.org/show_bug.cgi?id=1340296), and that there's no weekly meetings any more, we probably shouldn't mention either of those in CONTRIBUTING.md.
Instead, let's just suggest the IRC channel as a means of communication here.
2017-02-28 12:12:57 +01:00
Tim van der Meij
25f772a255 Merge pull request #8050 from yurydelendik/systemjs
Replaces RequireJS to SystemJS.
2017-02-27 23:31:41 +01:00
Tim van der Meij
4e201d3787 Merge pull request #8072 from timvandermeij/annotation-append-operator-list
Annotations: move operator list addition logic to `src/core/document.js`
2017-02-27 22:50:57 +01:00
Tim van der Meij
0739f90707
Annotations: move operator list addition logic to src/core/document.js
Ideally, the `Annotation` class should not have anything to do with the
page's operator list. How annotations are added to the page's operator
list is logic that belongs in `src/core/document.js` instead where the
operator list is constructed.

Moreover, some comments have been added to clarify the intent of the
code.
2017-02-27 22:17:49 +01:00
Tim van der Meij
9db4240b85 Merge pull request #8110 from timvandermeij/interactive-forms-choice-inherit-options
Interactive forms: make choice widget options inheritable (issue 8094)
2017-02-27 22:14:25 +01:00
Tim van der Meij
1da7123f37 Merge pull request #8106 from Snuffleupagus/ObjStm-Dict-objId
Ensure that `Dict`s found in Object Streams are assigned an `objId` in `XRef.fetch`
2017-02-27 21:41:02 +01:00
Jonas Jenwald
2a7e5b8a54 Support the newWindow flag in white-listed app.launchURL JavaScript actions (PR 7794 follow-up)
A simple follow-up to PR 7794, which let's us add support for the `newWindow` parameter; refer to https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_api_reference.pdf#G5.1507380.

The patch also fixes an embarrassing oversight regarding the placement of the case-insensitive flag, and also allows arbitrary white-space at the beginning of JS actions.
2017-02-27 15:58:28 +01:00
Yury Delendik
5b50e0d414 Replaces RequireJS to SystemJS. 2017-02-27 08:32:39 -06:00
Jonas Jenwald
afc3cd2a81 Update l10n files 2017-02-26 13:46:58 +01:00
Tim van der Meij
8990de8614
Interactive forms: make choice widget options inheritable (issue 8094)
Even though the PDF specification does not state that `Opt` fields are
inheritable, in practice there are PDF generators that let annotations
inherit the options from a parent.
2017-02-25 23:34:26 +01:00
Jonas Jenwald
14cc6acb90 Ensure that Dicts found in Object Streams are assigned an objId in XRef.fetch
This fixes something that I noticed while working with the code in `Catalog.getPageDict` when debugging issue 8088.

Note that while I don't have an example where this patch really matters, given that e.g. `PartialEvaluator.hasBlendModes` depends on the `objId` to avoid cyclic references this patch could potentially help for some PDF files.
2017-02-25 10:20:19 +01:00
Brendan Dahl
54e86f441b Merge pull request #8109 from brendandahl/makeref
Add gulp task to generate refs.
2017-02-24 18:20:50 -08:00
Brendan Dahl
8be4db1c34 Add gulp task to generate refs. 2017-02-24 16:59:01 -08:00
Tim van der Meij
752510ffa0 Merge pull request #8107 from yurydelendik/init-via-port
Init PDFWorker via MesssagePort.
2017-02-25 00:13:33 +01:00
Tim van der Meij
59392fd544 Merge pull request #8102 from yurydelendik/mv-compatibilty
Move compatibility code to the shared/compatibility.js.
2017-02-24 22:47:49 +01:00
Tim van der Meij
912c952df7 Merge pull request #8105 from Snuffleupagus/issue-8088-2
Always check all Kids nodes, in `Catalog.getPageDict`, to avoid getting stuck in an empty node further down in the Pages tree (issue 8088)
2017-02-24 22:12:04 +01:00
Yury Delendik
51767d63fe Init PDFWorker via MesssagePort. 2017-02-24 13:33:18 -06:00
Jonas Jenwald
1ce295541c Always check all Kids nodes, in Catalog.getPageDict, to avoid getting stuck in an empty node further down in the Pages tree (issue 8088)
As discussed on IRC, we need to check all nodes at the *bottom* of the tree to ensure that we find the correct `Page` dict.
Furthermore, this patch also gets rid of the caching present in a previous version, since it's not clear if that really helps.

Note that this patch purposely adds an `eq` test, using a reduced test-case, so that we can be sure that the algorithm actually finds the correct `Page` dict for each `pageIndex`.

Fixes 8088.
2017-02-24 12:09:46 +01:00
Yury Delendik
facefb0c79 Move compatibility code to the shared/compatibility.js. 2017-02-23 19:18:44 -06:00
Tim van der Meij
cada411af4 Merge pull request #8091 from timvandermeij/gulp-baseline
Gulp: migrate `baseline` target from `make.js`
2017-02-22 00:31:43 +01:00
Tim van der Meij
0f4e6fdb9d
Gulp: migrate baseline target from make.js 2017-02-21 23:50:57 +01:00